tests/test-http-proxy
author Thomas Arendsen Hein <thomas@intevation.de>
Fri, 30 Jun 2006 21:41:24 +0200
changeset 2542 a20877c8a3e2
parent 2337 3f24bc5dee81
child 2571 83cfd95eafb5
permissions -rwxr-xr-x
Use more compatible `cmd` instead of $(cmd) in test-http-proxy
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
#!/bin/sh
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
hg init a
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     4
cd a
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
echo a > a
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     6
hg ci -Ama -d '1123456789 0'
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     7
hg serve -p 20059 -d --pid-file=hg.pid
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     8
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
cd ..
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    10
("$TESTDIR/tinyproxy.py" 20060 localhost >/dev/null 2>&1 </dev/null &
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
echo $! > proxy.pid)
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    12
sleep 2
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
echo %% url for proxy
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
http_proxy=http://localhost:20060/ hg --config http_proxy.always=True clone http://localhost:20059/ b
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    17
echo %% host:port for proxy
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    18
http_proxy=localhost:20060 hg clone --config http_proxy.always=True http://localhost:20059/ c
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    19
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    20
echo %% proxy url with user name and password
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    21
http_proxy=http://user:passwd@localhost:20060 hg clone --config http_proxy.always=True http://localhost:20059/ d
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    22
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
echo %% url with user name and password
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    24
http_proxy=http://user:passwd@localhost:20060 hg clone --config http_proxy.always=True http://user:passwd@localhost:20059/ e
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    25
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    26
echo %% bad host:port for proxy
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    27
http_proxy=localhost:20061 hg clone --config http_proxy.always=True http://localhost:20059/ f
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    28
2542
a20877c8a3e2 Use more compatible `cmd` instead of $(cmd) in test-http-proxy
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2337
diff changeset
    29
kill `cat proxy.pid a/hg.pid`
2337
3f24bc5dee81 http: fix many problems with url parsing and auth. added proxy test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    30
exit 0