comparison tests/test-http-protocol.t @ 34483:a6d95a8b7243

serve: make tests compatible with chg chg only supports 'hg serve' when the options to the serve command follow the 'hg serve'. For example, 'hg -R <repo> serve ..' is unsupported. This leads to issues with chg running for the following tests: - test-bundle2-exchange.t - test-clone-uncompressed.t - test-hgweb-csp.t - test-http-bad-server.t - test-http-bundle1.t - test-http-protocol.t - test-http.t There was an effort made earlier to fix this issue for chg and the tests were fixed to confirm to the compatible pattern. But the new tests did not take care of the same and hence, fail. Hopefully, there will be continuous build setup for chg after all tests are made compatible with chg so that we can avoid such issues. Test Plan: Ran the aforementioned tests with and without '--chg' option. Differential Revision: https://phab.mercurial-scm.org/D946
author Saurabh Singh <singhsrb@fb.com>
date Wed, 04 Oct 2017 18:39:26 -0700
parents 636cf3f7620d
children 16203c6079e7
comparison
equal deleted inserted replaced
34482:75de5d456b60 34483:a6d95a8b7243
8 $ cd server 8 $ cd server
9 $ touch a 9 $ touch a
10 $ hg -q commit -A -m initial 10 $ hg -q commit -A -m initial
11 $ cd .. 11 $ cd ..
12 12
13 $ hg -R server serve -p $HGPORT -d --pid-file hg.pid 13 $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
14 $ cat hg.pid >> $DAEMON_PIDS 14 $ cat hg.pid >> $DAEMON_PIDS
15 15
16 compression formats are advertised in compression capability 16 compression formats are advertised in compression capability
17 17
18 #if zstd 18 #if zstd
23 23
24 $ killdaemons.py 24 $ killdaemons.py
25 25
26 server.compressionengines can replace engines list wholesale 26 server.compressionengines can replace engines list wholesale
27 27
28 $ hg --config server.compressionengines=none -R server serve -p $HGPORT -d --pid-file hg.pid 28 $ hg serve --config server.compressionengines=none -R server -p $HGPORT -d --pid-file hg.pid
29 $ cat hg.pid > $DAEMON_PIDS 29 $ cat hg.pid > $DAEMON_PIDS
30 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null 30 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null
31 31
32 $ killdaemons.py 32 $ killdaemons.py
33 33
34 Order of engines can also change 34 Order of engines can also change
35 35
36 $ hg --config server.compressionengines=none,zlib -R server serve -p $HGPORT -d --pid-file hg.pid 36 $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
37 $ cat hg.pid > $DAEMON_PIDS 37 $ cat hg.pid > $DAEMON_PIDS
38 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null 38 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null
39 39
40 $ killdaemons.py 40 $ killdaemons.py
41 41
42 Start a default server again 42 Start a default server again
43 43
44 $ hg -R server serve -p $HGPORT -d --pid-file hg.pid 44 $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
45 $ cat hg.pid > $DAEMON_PIDS 45 $ cat hg.pid > $DAEMON_PIDS
46 46
47 Server should send application/mercurial-0.1 to clients if no Accept is used 47 Server should send application/mercurial-0.1 to clients if no Accept is used
48 48
49 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - 49 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
111 e93700bd72895c5addab234c56d4024b487a362f 111 e93700bd72895c5addab234c56d4024b487a362f
112 112
113 Now test protocol preference usage 113 Now test protocol preference usage
114 114
115 $ killdaemons.py 115 $ killdaemons.py
116 $ hg --config server.compressionengines=none,zlib -R server serve -p $HGPORT -d --pid-file hg.pid 116 $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
117 $ cat hg.pid > $DAEMON_PIDS 117 $ cat hg.pid > $DAEMON_PIDS
118 118
119 No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1 119 No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1
120 120
121 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type 121 $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type