tests/test-ssh-clone-r
changeset 3449 c8686e3f0291
child 3853 c0b449154a90
equal deleted inserted replaced
3448:6ca49c5fe268 3449:c8686e3f0291
       
     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
       
    16 if [ ! -x dummyssh ] ; then
       
    17 	exit -1
       
    18 fi
       
    19 
       
    20 SSH_CLIENT='127.0.0.1 1 2'
       
    21 export SSH_CLIENT
       
    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 hg init remote
       
    28 cd remote
       
    29 echo "# creating 'remote'"
       
    30 cat >>afile <<EOF
       
    31 0
       
    32 EOF
       
    33 hg add afile
       
    34 hg commit -m "0.0"
       
    35 cat >>afile <<EOF
       
    36 1
       
    37 EOF
       
    38 hg commit -m "0.1"
       
    39 cat >>afile <<EOF
       
    40 2
       
    41 EOF
       
    42 hg commit -m "0.2"
       
    43 cat >>afile <<EOF
       
    44 3
       
    45 EOF
       
    46 hg commit -m "0.3"
       
    47 hg update -C 0
       
    48 cat >>afile <<EOF
       
    49 1
       
    50 EOF
       
    51 hg commit -m "1.1"
       
    52 cat >>afile <<EOF
       
    53 2
       
    54 EOF
       
    55 hg commit -m "1.2"
       
    56 cat >fred <<EOF
       
    57 a line
       
    58 EOF
       
    59 cat >>afile <<EOF
       
    60 3
       
    61 EOF
       
    62 hg add fred
       
    63 hg commit -m "1.3"
       
    64 hg mv afile adifferentfile
       
    65 hg commit -m "1.3m"
       
    66 hg update -C 3
       
    67 hg mv afile anotherfile
       
    68 hg commit -m "0.3m"
       
    69 hg debugindex .hg/data/afile.i
       
    70 hg debugindex .hg/data/adifferentfile.i
       
    71 hg debugindex .hg/data/anotherfile.i
       
    72 hg debugindex .hg/data/fred.i
       
    73 hg debugindex .hg/00manifest.i
       
    74 hg verify
       
    75 cd ..
       
    76 
       
    77 echo "# clone remote via stream"
       
    78 for i in 0 1 2 3 4 5 6 7 8; do
       
    79    hg clone -e ./dummyssh --uncompressed -r "$i" ssh://user@dummy/remote test-"$i" 2>&1
       
    80    if cd test-"$i"; then
       
    81       hg verify
       
    82       cd ..
       
    83    fi
       
    84 done
       
    85 cd test-8
       
    86 hg pull ../test-7
       
    87 hg verify
       
    88 cd ..
       
    89 cd test-1
       
    90 hg pull -e ../dummyssh -r 4 ssh://user@dummy/remote 2>&1
       
    91 hg verify
       
    92 hg pull -e ../dummyssh ssh://user@dummy/remote 2>&1
       
    93 cd ..
       
    94 cd test-2
       
    95 hg pull -e ../dummyssh -r 5 ssh://user@dummy/remote 2>&1
       
    96 hg verify
       
    97 hg pull -e ../dummyssh ssh://user@dummy/remote 2>&1
       
    98 hg verify
       
    99 cd ..