test-ssh
92 lines
| 1.6 KiB
| text/plain
|
TextLexer
/ tests / test-ssh
mpm@selenic.com
|
r1110 | #!/bin/sh | ||
# This test tries to exercise the ssh functionality with a dummy script | ||||
cat <<'EOF' > dummyssh | ||||
#!/bin/sh | ||||
# this attempts to deal with relative pathnames | ||||
cd `dirname $0` | ||||
# check for proper args | ||||
if [ $1 != "user@dummy" ] ; then | ||||
exit -1 | ||||
fi | ||||
# check that we're in the right directory | ||||
Thomas Arendsen Hein
|
r1168 | if [ ! -x dummyssh ] ; then | ||
mpm@selenic.com
|
r1110 | exit -1 | ||
fi | ||||
echo Got arguments 1:$1 2:$2 3:$3 4:$4 5:$5 >> dummylog | ||||
$2 | ||||
EOF | ||||
chmod +x dummyssh | ||||
echo "# creating 'remote'" | ||||
hg init remote | ||||
cd remote | ||||
echo this > foo | ||||
Thomas Arendsen Hein
|
r1933 | hg ci -A -m "init" -d "1000000 0" foo | ||
Vadim Gelfer
|
r2621 | echo '[server]' > .hg/hgrc | ||
Vadim Gelfer
|
r2622 | echo 'uncompressed = True' >> .hg/hgrc | ||
mpm@selenic.com
|
r1110 | |||
cd .. | ||||
Vadim Gelfer
|
r2612 | echo "# clone remote via stream" | ||
Vadim Gelfer
|
r2621 | hg clone -e ./dummyssh --uncompressed ssh://user@dummy/remote local-stream 2>&1 | \ | ||
Vadim Gelfer
|
r2612 | sed -e 's/[0-9][0-9.]*/XXX/g' | ||
cd local-stream | ||||
hg verify | ||||
cd .. | ||||
echo "# clone remote via pull" | ||||
Vadim Gelfer
|
r2613 | hg clone -e ./dummyssh ssh://user@dummy/remote local | ||
mpm@selenic.com
|
r1110 | |||
echo "# verify" | ||||
cd local | ||||
hg verify | ||||
echo "# empty default pull" | ||||
hg paths | ||||
hg pull -e ../dummyssh | ||||
echo "# local change" | ||||
echo bleah > foo | ||||
Thomas Arendsen Hein
|
r1933 | hg ci -m "add" -d "1000000 0" | ||
mpm@selenic.com
|
r1110 | |||
echo "# updating rc" | ||||
echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc | ||||
echo "[ui]" >> .hg/hgrc | ||||
echo "ssh = ../dummyssh" >> .hg/hgrc | ||||
echo "# find outgoing" | ||||
hg out ssh://user@dummy/remote | ||||
Thomas Arendsen Hein
|
r1982 | echo "# find incoming on the remote side" | ||
hg incoming -R ../remote -e ../dummyssh ssh://user@dummy/local | ||||
mpm@selenic.com
|
r1110 | echo "# push" | ||
hg push | ||||
cd ../remote | ||||
echo "# check remote tip" | ||||
hg tip | ||||
hg verify | ||||
hg cat foo | ||||
Vadim Gelfer
|
r2439 | echo z > z | ||
hg ci -A -m z -d '1000001 0' z | ||||
cd ../local | ||||
echo r > r | ||||
hg ci -A -m z -d '1000002 0' r | ||||
echo "# push should fail" | ||||
hg push | ||||
echo "# push should succeed" | ||||
hg push -f | ||||
mpm@selenic.com
|
r1110 | cd .. | ||
cat dummylog | ||||