##// END OF EJS Templates
tests: unify test-http-proxy
Matt Mackall -
r12449:fc12114d default
parent child Browse files
Show More
@@ -1,45 +1,116 b''
1 #!/bin/sh
2 1
3 hg init a
4 cd a
5 echo a > a
6 hg ci -Ama -d '1123456789 0'
7 hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid
8 cat hg.pid >> $DAEMON_PIDS
2 $ hg init a
3 $ cd a
4 $ echo a > a
5 $ hg ci -Ama -d '1123456789 0'
6 adding a
7 $ hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid
8 $ cat hg.pid >> $DAEMON_PIDS
9 $ cd ..
10 $ ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
11 $ echo $! > proxy.pid)
12 $ cat proxy.pid >> $DAEMON_PIDS
13 $ sleep 2
14
15 url for proxy, stream
9 16
10 cd ..
11 ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
12 echo $! > proxy.pid)
13 cat proxy.pid >> $DAEMON_PIDS
14 sleep 2
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b
18 streaming all changes
19 3 files to transfer, 303 bytes of data
20 transferred * bytes in * seconds (*B/sec) (glob)
21 updating to branch default
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 $ cd b
24 $ hg verify
25 checking changesets
26 checking manifests
27 crosschecking files in changesets and manifests
28 checking files
29 1 files, 1 changesets, 1 total revisions
30 $ cd ..
31
32 url for proxy, pull
15 33
16 echo %% url for proxy, stream
17 http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b | \
18 sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
19 cd b
20 hg verify
21 cd ..
34 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
35 requesting all changes
36 adding changesets
37 adding manifests
38 adding file changes
39 added 1 changesets with 1 changes to 1 files
40 updating to branch default
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 $ cd b-pull
43 $ hg verify
44 checking changesets
45 checking manifests
46 crosschecking files in changesets and manifests
47 checking files
48 1 files, 1 changesets, 1 total revisions
49 $ cd ..
50
51 host:port for proxy
22 52
23 echo %% url for proxy, pull
24 http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
25 cd b-pull
26 hg verify
27 cd ..
53 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
54 requesting all changes
55 adding changesets
56 adding manifests
57 adding file changes
58 added 1 changesets with 1 changes to 1 files
59 updating to branch default
60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61
62 proxy url with user name and password
28 63
29 echo %% host:port for proxy
30 http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
64 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
65 requesting all changes
66 adding changesets
67 adding manifests
68 adding file changes
69 added 1 changesets with 1 changes to 1 files
70 updating to branch default
71 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 72
32 echo %% proxy url with user name and password
33 http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
73 url with user name and password
74
75 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
76 requesting all changes
77 adding changesets
78 adding manifests
79 adding file changes
80 added 1 changesets with 1 changes to 1 files
81 updating to branch default
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 83
35 echo %% url with user name and password
36 http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
84 bad host:port for proxy
37 85
38 echo %% bad host:port for proxy
39 http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
86 $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
87 abort: error: Connection refused
88 [255]
89
90 do not use the proxy if it is in the no list
40 91
41 echo %% do not use the proxy if it is in the no list
42 http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
92 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
93 requesting all changes
94 adding changesets
95 adding manifests
96 adding file changes
97 added 1 changesets with 1 changes to 1 files
98 updating to branch default
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 $ cat proxy.log
101 * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
102 * - - [*] "GET http://localhost:*/?cmd=capabilities HTTP/1.1" - - (glob)
103 * - - [*] "GET http://localhost:*/?cmd=stream_out HTTP/1.1" - - (glob)
104 * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
105 * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
106 * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
107 * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
108 * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
109 * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
110 * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
111 * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
112 * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
113 * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
114 * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
115 * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
43 116
44 cat proxy.log | sed -e 's/^.*\] /XXX /' -e 's/:[0-9][0-9]*/:/'
45 exit 0
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now