Show More
@@ -4,27 +4,28 cp "$TESTDIR"/printenv.py . | |||||
4 |
|
4 | |||
5 | # This test tries to exercise the ssh functionality with a dummy script |
|
5 | # This test tries to exercise the ssh functionality with a dummy script | |
6 |
|
6 | |||
7 |
cat << |
|
7 | cat <<EOF > dummyssh | |
8 | #!/bin/sh |
|
8 | import sys | |
9 | # this attempts to deal with relative pathnames |
|
9 | import os | |
10 | cd `dirname $0` |
|
|||
11 |
|
10 | |||
12 | # check for proper args |
|
11 | os.chdir(os.path.dirname(sys.argv[0])) | |
13 |
if [ |
|
12 | if sys.argv[1] != "user@dummy": | |
14 | exit -1 |
|
13 | sys.exit(-1) | |
15 | fi |
|
14 | ||
|
15 | if not os.path.exists("dummyssh"): | |||
|
16 | sys.exit(-1) | |||
16 |
|
17 | |||
17 | # check that we're in the right directory |
|
18 | os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" | |
18 | if [ ! -x dummyssh ] ; then |
|
|||
19 | exit -1 |
|
|||
20 | fi |
|
|||
21 |
|
19 | |||
22 | SSH_CLIENT='127.0.0.1 1 2' |
|
20 | log = open("dummylog", "ab") | |
23 | export SSH_CLIENT |
|
21 | log.write("Got arguments") | |
24 | echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog |
|
22 | for i, arg in enumerate(sys.argv[1:]): | |
25 | $2 |
|
23 | log.write(" %d:%s" % (i+1, arg)) | |
|
24 | log.write("\n") | |||
|
25 | log.close() | |||
|
26 | r = os.system(sys.argv[2]) | |||
|
27 | sys.exit(bool(r)) | |||
26 | EOF |
|
28 | EOF | |
27 | chmod +x dummyssh |
|
|||
28 |
|
29 | |||
29 | echo "# creating 'remote'" |
|
30 | echo "# creating 'remote'" | |
30 | hg init remote |
|
31 | hg init remote | |
@@ -40,17 +41,17 echo 'changegroup = python ../printenv.p | |||||
40 | cd .. |
|
41 | cd .. | |
41 |
|
42 | |||
42 | echo "# repo not found error" |
|
43 | echo "# repo not found error" | |
43 | hg clone -e ./dummyssh ssh://user@dummy/nonexistent local |
|
44 | hg clone -e "python ./dummyssh" ssh://user@dummy/nonexistent local | |
44 |
|
45 | |||
45 | echo "# clone remote via stream" |
|
46 | echo "# clone remote via stream" | |
46 | hg clone -e ./dummyssh --uncompressed ssh://user@dummy/remote local-stream 2>&1 | \ |
|
47 | hg clone -e "python ./dummyssh" --uncompressed ssh://user@dummy/remote local-stream 2>&1 | \ | |
47 | sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/' |
|
48 | sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/' | |
48 | cd local-stream |
|
49 | cd local-stream | |
49 | hg verify |
|
50 | hg verify | |
50 | cd .. |
|
51 | cd .. | |
51 |
|
52 | |||
52 | echo "# clone remote via pull" |
|
53 | echo "# clone remote via pull" | |
53 | hg clone -e ./dummyssh ssh://user@dummy/remote local |
|
54 | hg clone -e "python ./dummyssh" ssh://user@dummy/remote local | |
54 |
|
55 | |||
55 | echo "# verify" |
|
56 | echo "# verify" | |
56 | cd local |
|
57 | cd local | |
@@ -61,7 +62,7 echo 'changegroup = python ../printenv.p | |||||
61 |
|
62 | |||
62 | echo "# empty default pull" |
|
63 | echo "# empty default pull" | |
63 | hg paths |
|
64 | hg paths | |
64 | hg pull -e ../dummyssh |
|
65 | hg pull -e "python ../dummyssh" | |
65 |
|
66 | |||
66 | echo "# local change" |
|
67 | echo "# local change" | |
67 | echo bleah > foo |
|
68 | echo bleah > foo | |
@@ -70,13 +71,13 hg ci -m "add" -d "1000000 0" | |||||
70 | echo "# updating rc" |
|
71 | echo "# updating rc" | |
71 | echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc |
|
72 | echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | |
72 | echo "[ui]" >> .hg/hgrc |
|
73 | echo "[ui]" >> .hg/hgrc | |
73 | echo "ssh = ../dummyssh" >> .hg/hgrc |
|
74 | echo "ssh = python ../dummyssh" >> .hg/hgrc | |
74 |
|
75 | |||
75 | echo "# find outgoing" |
|
76 | echo "# find outgoing" | |
76 | hg out ssh://user@dummy/remote |
|
77 | hg out ssh://user@dummy/remote | |
77 |
|
78 | |||
78 | echo "# find incoming on the remote side" |
|
79 | echo "# find incoming on the remote side" | |
79 | hg incoming -R ../remote -e ../dummyssh ssh://user@dummy/local |
|
80 | hg incoming -R ../remote -e "python ../dummyssh" ssh://user@dummy/local | |
80 |
|
81 | |||
81 | echo "# push" |
|
82 | echo "# push" | |
82 | hg push |
|
83 | hg push |
@@ -78,13 +78,13 remote: adding changesets | |||||
78 | remote: adding manifests |
|
78 | remote: adding manifests | |
79 | remote: adding file changes |
|
79 | remote: adding file changes | |
80 | remote: added 1 changesets with 1 changes to 1 files |
|
80 | remote: added 1 changesets with 1 changes to 1 files | |
81 |
Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio |
|
81 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio | |
82 |
Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
82 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
83 |
Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
83 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
84 |
Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
84 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
85 |
Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
85 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
86 |
Got arguments 1:user@dummy 2:hg -R local serve --stdio |
|
86 | Got arguments 1:user@dummy 2:hg -R local serve --stdio | |
87 |
Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
87 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
88 | changegroup-in-remote hook: HG_NODE=572896fe480d7581849806ee402175c49cb20037 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
88 | changegroup-in-remote hook: HG_NODE=572896fe480d7581849806ee402175c49cb20037 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 | |
89 |
Got arguments 1:user@dummy 2:hg -R remote serve --stdio |
|
89 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
90 | changegroup-in-remote hook: HG_NODE=ac7448082955a0b2ff5cb4512c1e061c779bbc79 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
90 | changegroup-in-remote hook: HG_NODE=ac7448082955a0b2ff5cb4512c1e061c779bbc79 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
General Comments 0
You need to be logged in to leave comments.
Login now