tests/test-http-proxy.t
author Mads Kiilerich <mads@kiilerich.com>
Tue, 28 Sep 2010 02:58:00 +0200
changeset 12579 aa1faedeac5a
parent 12449 fc12114dbaa5
child 12643 d08bb64888bc
permissions -rw-r--r--
graphlog: style with header and footer (issue2395) The glog command didn't emit header and footer from the style, as demonstrated by "hg glog --style xml". Asciiart combined with xml markup hardly makes sense, but header and footer might however be useful for adding for example html pre tags around the graph.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     2
  $ hg init a
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     3
  $ cd a
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     4
  $ echo a > a
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     5
  $ hg ci -Ama -d '1123456789 0'
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     6
  adding a
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     7
  $ hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     8
  $ cat hg.pid >> $DAEMON_PIDS
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
     9
  $ cd ..
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    10
  $ ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    11
  $ echo $! > proxy.pid)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    12
  $ cat proxy.pid >> $DAEMON_PIDS
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    13
  $ sleep 2
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    14
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    15
url for proxy, stream
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    17
  $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    18
  streaming all changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    19
  3 files to transfer, 303 bytes of data
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    20
  transferred * bytes in * seconds (*B/sec) (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    21
  updating to branch default
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    22
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    23
  $ cd b
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    24
  $ hg verify
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    25
  checking changesets
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    26
  checking manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    27
  crosschecking files in changesets and manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    28
  checking files
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    29
  1 files, 1 changesets, 1 total revisions
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    30
  $ cd ..
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    31
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    32
url for proxy, pull
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    33
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    34
  $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    35
  requesting all changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    36
  adding changesets
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    37
  adding manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    38
  adding file changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    39
  added 1 changesets with 1 changes to 1 files
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    40
  updating to branch default
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    41
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    42
  $ cd b-pull
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    43
  $ hg verify
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    44
  checking changesets
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    45
  checking manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    46
  crosschecking files in changesets and manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    47
  checking files
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    48
  1 files, 1 changesets, 1 total revisions
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    49
  $ cd ..
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    50
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    51
host:port for proxy
2612
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2571
diff changeset
    52
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    53
  $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    54
  requesting all changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    55
  adding changesets
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    56
  adding manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    57
  adding file changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    58
  added 1 changesets with 1 changes to 1 files
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    59
  updating to branch default
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    60
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    61
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    62
proxy url with user name and password
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    63
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    64
  $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    65
  requesting all changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    66
  adding changesets
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    67
  adding manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    68
  adding file changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    69
  added 1 changesets with 1 changes to 1 files
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    70
  updating to branch default
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    71
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    72
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    73
url with user name and password
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    74
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    75
  $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    76
  requesting all changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    77
  adding changesets
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    78
  adding manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    79
  adding file changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    80
  added 1 changesets with 1 changes to 1 files
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    81
  updating to branch default
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    82
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    83
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    84
bad host:port for proxy
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    85
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    86
  $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    87
  abort: error: Connection refused
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    88
  [255]
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    89
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    90
do not use the proxy if it is in the no list
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    91
12449
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    92
  $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    93
  requesting all changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    94
  adding changesets
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    95
  adding manifests
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    96
  adding file changes
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    97
  added 1 changesets with 1 changes to 1 files
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    98
  updating to branch default
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
    99
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   100
  $ cat proxy.log
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   101
  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   102
  * - - [*] "GET http://localhost:*/?cmd=capabilities HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   103
  * - - [*] "GET http://localhost:*/?cmd=stream_out HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   104
  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   105
  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   106
  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   107
  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   108
  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   109
  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   110
  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   111
  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   112
  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   113
  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   114
  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
fc12114dbaa5 tests: unify test-http-proxy
Matt Mackall <mpm@selenic.com>
parents: 7919
diff changeset
   115
  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
7269
95a53961d7a6 httprepo: factor out proxy handling
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 7264
diff changeset
   116