Mercurial > hg
annotate tests/test-ssh @ 3268:bb057b6ce3cf
Un-debugify debugconfig to showconfig. (issue 317)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 05 Oct 2006 15:51:54 +0200 |
parents | 25857e00af8e |
children | 7ae37d99d47e |
rev | line source |
---|---|
1110 | 1 #!/bin/sh |
2 | |
3 # This test tries to exercise the ssh functionality with a dummy script | |
4 | |
5 cat <<'EOF' > dummyssh | |
6 #!/bin/sh | |
7 # this attempts to deal with relative pathnames | |
8 cd `dirname $0` | |
9 | |
10 # check for proper args | |
11 if [ $1 != "user@dummy" ] ; then | |
12 exit -1 | |
13 fi | |
14 | |
15 # 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
|
16 if [ ! -x dummyssh ] ; then |
1110 | 17 exit -1 |
18 fi | |
19 | |
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
20 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
|
21 export SSH_CLIENT |
1110 | 22 echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog |
23 $2 | |
24 EOF | |
25 chmod +x dummyssh | |
26 | |
27 echo "# creating 'remote'" | |
28 hg init remote | |
29 cd remote | |
30 echo this > 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
|
31 hg ci -A -m "init" -d "1000000 0" foo |
2621
5a5852a417b1
clone: disable stream support on server side by default.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2613
diff
changeset
|
32 echo '[server]' > .hg/hgrc |
2622
064aef9162cc
rename stream hgrc option to compressed.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2621
diff
changeset
|
33 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
|
34 echo '[hooks]' >> .hg/hgrc |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
35 echo 'changegroup = echo changegroup in remote: u=$HG_URL >> ../dummylog' >> .hg/hgrc |
1110 | 36 |
37 cd .. | |
38 | |
2612
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
39 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
|
40 hg clone -e ./dummyssh --uncompressed ssh://user@dummy/remote local-stream 2>&1 | \ |
3015
fa4229c60dd7
Allow for MB/sec transfer rates in test-http-proxy and test-ssh.
Lee Cantey <lcantey@gmail.com>
parents:
2673
diff
changeset
|
41 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
|
42 cd local-stream |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
43 hg verify |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
44 cd .. |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
45 |
ffb895f16925
add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2439
diff
changeset
|
46 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
|
47 hg clone -e ./dummyssh ssh://user@dummy/remote local |
1110 | 48 |
49 echo "# verify" | |
50 cd local | |
51 hg verify | |
52 | |
2673
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
53 echo '[hooks]' >> .hg/hgrc |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
54 echo 'changegroup = echo changegroup in local: u=$HG_URL >> ../dummylog' >> .hg/hgrc |
109a22f5434a
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2622
diff
changeset
|
55 |
1110 | 56 echo "# empty default pull" |
57 hg paths | |
58 hg pull -e ../dummyssh | |
59 | |
60 echo "# local change" | |
61 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
|
62 hg ci -m "add" -d "1000000 0" |
1110 | 63 |
64 echo "# updating rc" | |
65 echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | |
66 echo "[ui]" >> .hg/hgrc | |
67 echo "ssh = ../dummyssh" >> .hg/hgrc | |
68 | |
69 echo "# find outgoing" | |
70 hg out ssh://user@dummy/remote | |
71 | |
1982
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
72 echo "# find incoming on the remote side" |
70ba0c86da8b
Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1933
diff
changeset
|
73 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
|
74 |
1110 | 75 echo "# push" |
76 hg push | |
77 | |
78 cd ../remote | |
79 | |
80 echo "# check remote tip" | |
81 hg tip | |
82 hg verify | |
3095
25857e00af8e
cat: default to working dir parent instead of tip
Brendan Cully <brendan@kublai.com>
parents:
3015
diff
changeset
|
83 hg cat -r tip foo |
1110 | 84 |
2439
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
85 echo z > z |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
86 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
|
87 |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
88 cd ../local |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
89 echo r > r |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
90 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
|
91 |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
92 echo "# push should fail" |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
93 hg push |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
94 |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
95 echo "# push should succeed" |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
96 hg push -f |
e8c4f3d3df8c
extend network protocol to stop clients from locking servers
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1982
diff
changeset
|
97 |
1110 | 98 cd .. |
99 cat dummylog |