author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
Tue, 27 Mar 2007 01:41:17 -0300 | |
changeset 4294 | ccfe423d3d0a |
parent 4291 | 35b2e02367a5 |
child 4298 | 58517f6eb1ad |
permissions | -rwxr-xr-x |
1110 | 1 |
#!/bin/sh |
2 |
||
4291
35b2e02367a5
test-ssh: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
3 |
cp "$TESTDIR"/printenv.py . |
35b2e02367a5
test-ssh: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
4 |
|
1110 | 5 |
# This test tries to exercise the ssh functionality with a dummy script |
6 |
||
7 |
cat <<'EOF' > dummyssh |
|
8 |
#!/bin/sh |
|
9 |
# this attempts to deal with relative pathnames |
|
10 |
cd `dirname $0` |
|
11 |
||
12 |
# check for proper args |
|
13 |
if [ $1 != "user@dummy" ] ; then |
|
14 |
exit -1 |
|
15 |
fi |
|
16 |
||
17 |
# check that we're in the right directory |
|
1168
235e0effa672
Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1110
diff
changeset
|
18 |
if [ ! -x dummyssh ] ; then |
1110 | 19 |
exit -1 |
20 |
fi |
|
21 |
||
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
22 |
SSH_CLIENT='127.0.0.1 1 2' |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
23 |
export SSH_CLIENT |
1110 | 24 |
echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog |
25 |
$2 |
|
26 |
EOF |
|
27 |
chmod +x dummyssh |
|
28 |
||
29 |
echo "# creating 'remote'" |
|
30 |
hg init remote |
|
31 |
cd remote |
|
32 |
echo this > foo |
|
3853
c0b449154a90
switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3684
diff
changeset
|
33 |
echo this > fooO |
c0b449154a90
switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3684
diff
changeset
|
34 |
hg ci -A -m "init" -d "1000000 0" foo fooO |
2621
5a5852a417b1
clone: disable stream support on server side by default.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2613
diff
changeset
|
35 |
echo '[server]' > .hg/hgrc |
2622
064aef9162cc
rename stream hgrc option to compressed.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2621
diff
changeset
|
36 |
echo 'uncompressed = True' >> .hg/hgrc |
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
37 |
echo '[hooks]' >> .hg/hgrc |
4291
35b2e02367a5
test-ssh: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
38 |
echo 'changegroup = python ../printenv.py changegroup-in-remote 0 ../dummylog' >> .hg/hgrc |
1110 | 39 |
|
40 |
cd .. |
|
41 |
||
3274
7ae37d99d47e
ssh: make the error message more clear, add a testcase
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3092
diff
changeset
|
42 |
echo "# repo not found error" |
7ae37d99d47e
ssh: make the error message more clear, add a testcase
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3092
diff
changeset
|
43 |
hg clone -e ./dummyssh ssh://user@dummy/nonexistent local |
7ae37d99d47e
ssh: make the error message more clear, add a testcase
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3092
diff
changeset
|
44 |
|
2612
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
45 |
echo "# clone remote via stream" |
2621
5a5852a417b1
clone: disable stream support on server side by default.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2613
diff
changeset
|
46 |
hg clone -e ./dummyssh --uncompressed ssh://user@dummy/remote local-stream 2>&1 | \ |
3012
fa4229c60dd7
Allow for MB/sec transfer rates in test-http-proxy and test-ssh.
Lee Cantey <lcantey@gmail.com>
parents:
2673
diff
changeset
|
47 |
sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/' |
2612
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
48 |
cd local-stream |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
49 |
hg verify |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
50 |
cd .. |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
51 |
|
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
52 |
echo "# clone remote via pull" |
2613
479e26afa10f
clone: do not make streaming default. add --stream option instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2612
diff
changeset
|
53 |
hg clone -e ./dummyssh ssh://user@dummy/remote local |
1110 | 54 |
|
55 |
echo "# verify" |
|
56 |
cd local |
|
57 |
hg verify |
|
58 |
||
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
59 |
echo '[hooks]' >> .hg/hgrc |
4291
35b2e02367a5
test-ssh: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
60 |
echo 'changegroup = python ../printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc |
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
61 |
|
1110 | 62 |
echo "# empty default pull" |
63 |
hg paths |
|
64 |
hg pull -e ../dummyssh |
|
65 |
||
66 |
echo "# local change" |
|
67 |
echo bleah > foo |
|
1933
7544700fd931
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1168
diff
changeset
|
68 |
hg ci -m "add" -d "1000000 0" |
1110 | 69 |
|
70 |
echo "# updating rc" |
|
71 |
echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc |
|
72 |
echo "[ui]" >> .hg/hgrc |
|
73 |
echo "ssh = ../dummyssh" >> .hg/hgrc |
|
74 |
||
75 |
echo "# find outgoing" |
|
76 |
hg out ssh://user@dummy/remote |
|
77 |
||
1982
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
78 |
echo "# find incoming on the remote side" |
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
79 |
hg incoming -R ../remote -e ../dummyssh ssh://user@dummy/local |
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
80 |
|
1110 | 81 |
echo "# push" |
82 |
hg push |
|
83 |
||
84 |
cd ../remote |
|
85 |
||
86 |
echo "# check remote tip" |
|
87 |
hg tip |
|
88 |
hg verify |
|
3092
25857e00af8e
cat: default to working dir parent instead of tip
Brendan Cully <brendan@kublai.com>
parents:
3012
diff
changeset
|
89 |
hg cat -r tip foo |
1110 | 90 |
|
2439
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
91 |
echo z > z |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
92 |
hg ci -A -m z -d '1000001 0' z |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
93 |
|
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
94 |
cd ../local |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
95 |
echo r > r |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
96 |
hg ci -A -m z -d '1000002 0' r |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
97 |
|
3684
975c2469c316
correct remote heads test in prepush
Matt Mackall <mpm@selenic.com>
parents:
3274
diff
changeset
|
98 |
echo "# push should succeed" |
2439
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
99 |
hg push |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
100 |
|
1110 | 101 |
cd .. |
102 |
cat dummylog |