# HG changeset patch # User mpm@selenic.com # Date 1125191492 25200 # Node ID 1032a505488ce22ab6c41d5cec877d082f9dff5e # Parent ee817c5e3ece82a805c528c3b58a9e9376dfd374 Add a simple dummy ssh test This uses the -e flag to run a dummy script rather than actual ssh to test the protocol over a local pipe. diff -r ee817c5e3ece -r 1032a505488c tests/test-ssh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-ssh Sat Aug 27 18:11:32 2005 -0700 @@ -0,0 +1,67 @@ +#!/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 +if \! [ -x dummyssh ] ; then + 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 +hg ci -A -m "init" -d "0 0" foo + +cd .. + +echo "# clone remote" +hg clone -e ./dummyssh ssh://user@dummy/remote local + +echo "# verify" +cd local +hg verify + +echo "# empty default pull" +hg paths +hg pull -e ../dummyssh + +echo "# local change" +echo bleah > foo +hg ci -m "add" -d "0 0" + +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 + +echo "# push" +hg push + +cd ../remote + +echo "# check remote tip" +hg tip +hg verify +hg cat foo + +cd .. +cat dummylog diff -r ee817c5e3ece -r 1032a505488c tests/test-ssh.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-ssh.out Sat Aug 27 18:11:32 2005 -0700 @@ -0,0 +1,56 @@ +# creating 'remote' +# clone remote +requesting all changes +adding changesets +adding manifests +adding file changes +added 1 changesets with 1 changes to 1 files +remote: ./dummyssh: line 11: !: command not found +# verify +checking changesets +checking manifests +crosschecking files in changesets and manifests +checking files +1 files, 1 changesets, 1 total revisions +# empty default pull +default = ssh://user@dummy/remote +pulling from ssh://user@dummy/remote +searching for changes +remote: ../dummyssh: line 11: !: command not found +no changes found +# local change +# updating rc +# find outgoing +searching for changes +remote: ../dummyssh: line 11: !: command not found +changeset: 1:536411b157b4 +tag: tip +user: test +date: Thu Jan 1 00:00:00 1970 +0000 +summary: add + +# push +pushing to ssh://user@dummy/remote +remote: ../dummyssh: line 11: !: command not found +searching for changes +remote: adding changesets +remote: adding manifests +remote: adding file changes +remote: added 1 changesets with 1 changes to 1 files +# check remote tip +changeset: 1:536411b157b4 +tag: tip +user: test +date: Thu Jan 1 00:00:00 1970 +0000 +summary: add + +checking changesets +checking manifests +crosschecking files in changesets and manifests +checking files +1 files, 2 changesets, 2 total revisions +bleah +Got arguments 1:user@dummy 2:hg -R remote serve --stdio 3: 4: 5: +Got arguments 1:user@dummy 2:hg -R remote serve --stdio 3: 4: 5: +Got arguments 1:user@dummy 2:hg -R remote serve --stdio 3: 4: 5: +Got arguments 1:user@dummy 2:hg -R remote serve --stdio 3: 4: 5: