comparison tests/test-http.t @ 41590:349c8879becd

py3: ensure the HTTP password manager returns strings, not bytes The digest handler calls into the password manager on its own, and it apparently expects strings. Perhaps the Basic authentication handler didn't hit this because of its manual password fetch and format in retry_http_basic_auth(). The `pycompat.bytesurl()` on the user and password just above the first url.py diff seems unnecessary, because the password proxy in ui is converting to bytes IIUC.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 05 Feb 2019 17:02:40 -0500
parents 46432c04f010
children 94faa2e84094
comparison
equal deleted inserted replaced
41589:46432c04f010 41590:349c8879becd
223 > opener = orig(*args, **kwargs) 223 > opener = orig(*args, **kwargs)
224 > opener.addheaders.append((r'X-HgTest-AuthType', r'Digest')) 224 > opener.addheaders.append((r'X-HgTest-AuthType', r'Digest'))
225 > return opener 225 > return opener
226 > EOF 226 > EOF
227 227
228 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py || true 228 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py
229 abort: HTTP Error 403: bad user (py3 !) 229 5fed3813f7f5
230 5fed3813f7f5 (no-py3 !)
231 230
232 #if no-reposimplestore 231 #if no-reposimplestore
233 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 232 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
234 streaming all changes 233 streaming all changes
235 10 files to transfer, 1.01 KB of data 234 10 files to transfer, 1.01 KB of data
381 "GET /?cmd=capabilities HTTP/1.1" 200 - 380 "GET /?cmd=capabilities HTTP/1.1" 200 -
382 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull 381 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
383 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull 382 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
384 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull 383 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
385 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest 384 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest
386 "GET /?cmd=capabilities HTTP/1.1" 403 - x-hgtest-authtype:Digest (py3 !) 385 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest
387 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest (no-py3 !) 386 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
388 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !) 387 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
389 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !) 388 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
390 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !) 389 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !) 390 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
392 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !) 391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
393 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !)
394 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) 392 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
395 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !) 393 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
396 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) 394 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
397 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !) 395 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
398 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !) 396 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
459 check error log 457 check error log
460 458
461 $ cat error.log 459 $ cat error.log
462 460
463 $ cat errors2.log 461 $ cat errors2.log
464 $LOCALIP - - [$ERRDATE$] HG error: No hash found for user/realm "b'user'/mercurial" (glob) (py3 !)
465 462
466 check abort error reporting while pulling/cloning 463 check abort error reporting while pulling/cloning
467 464
468 $ $RUNTESTDIR/killdaemons.py 465 $ $RUNTESTDIR/killdaemons.py
469 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py 466 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py