tests/test-http-proxy.t
changeset 12449 fc12114dbaa5
parent 7919 3e6206967570
child 12643 d08bb64888bc
equal deleted inserted replaced
12448:f5d3ff0a8192 12449:fc12114dbaa5
       
     1 
       
     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
       
    16 
       
    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
       
    33 
       
    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
       
    52 
       
    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
       
    63 
       
    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
       
    72 
       
    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
       
    83 
       
    84 bad host:port for proxy
       
    85 
       
    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
       
    91 
       
    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)
       
   116