tests/test-ssh
author Vadim Gelfer <vadim.gelfer@gmail.com>
Sat, 20 May 2006 12:52:02 -0700
changeset 2329 90368f89340a
parent 1982 70ba0c86da8b
child 2439 e8c4f3d3df8c
permissions -rwxr-xr-x
notify: add debug output. do not fail if no config file. use --debug to see debug output.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1110
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     1
#!/bin/sh
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     2
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     3
# This test tries to exercise the ssh functionality with a dummy script
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     4
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     5
cat <<'EOF' > dummyssh
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     6
#!/bin/sh
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     7
# this attempts to deal with relative pathnames
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     8
cd `dirname $0`
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
     9
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    10
# check for proper args
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    11
if [ $1 != "user@dummy" ] ; then
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    12
	exit -1
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    13
fi
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    14
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    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
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    17
	exit -1
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    18
fi
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    19
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    20
echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    21
$2
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    22
EOF
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    23
chmod +x dummyssh
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    24
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    25
echo "# creating 'remote'"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    26
hg init remote
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    27
cd remote
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    28
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
    29
hg ci -A -m "init" -d "1000000 0" foo
1110
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    30
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    31
cd ..
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    32
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    33
echo "# clone remote"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    34
hg clone -e ./dummyssh ssh://user@dummy/remote local
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    35
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    36
echo "# verify"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    37
cd local
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    38
hg verify
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    39
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    40
echo "# empty default pull"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    41
hg paths
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    42
hg pull -e ../dummyssh
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    43
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    44
echo "# local change"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    45
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
    46
hg ci -m "add" -d "1000000 0"
1110
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    47
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    48
echo "# updating rc"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    49
echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    50
echo "[ui]" >> .hg/hgrc
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    51
echo "ssh = ../dummyssh" >> .hg/hgrc
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    52
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    53
echo "# find outgoing"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    54
hg out ssh://user@dummy/remote
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    55
1982
70ba0c86da8b Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1933
diff changeset
    56
echo "# find incoming on the remote side"
70ba0c86da8b Added test for incoming via ssh.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1933
diff changeset
    57
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
    58
1110
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    59
echo "# push"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    60
hg push
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    61
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    62
cd ../remote
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    63
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    64
echo "# check remote tip"
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    65
hg tip
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    66
hg verify
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    67
hg cat foo
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    68
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    69
cd ..
1032a505488c Add a simple dummy ssh test
mpm@selenic.com
parents:
diff changeset
    70
cat dummylog