ssh-basic.test 1009 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # Copyright (C) 1998,1999 Philip Hands <phil@hands.com>
  3. # Copyright (C) 2001 by Martin Pool <mbp@samba.org>
  4. # This program is distributable under the terms of the GNU GPL (see
  5. # COPYING)
  6. # This script tests ssh, if possible. It's called by runtests.sh
  7. . "$suitedir/rsync.fns"
  8. SSH="$scratchdir/src/support/lsh"
  9. if test x"$rsync_enable_ssh_tests" = xyes; then
  10. if type ssh >/dev/null ; then
  11. SSH=ssh
  12. fi
  13. fi
  14. if [ "`$SSH -o'BatchMode yes' localhost echo yes`" != "yes" ]; then
  15. test_skipped "Skipping SSH tests because ssh conection to localhost not authorised"
  16. fi
  17. echo "Using remote shell: $SSH"
  18. # Create some files for rsync to copy
  19. hands_setup
  20. runtest "ssh: basic test" 'checkit "$RSYNC -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'
  21. mv "$todir/text" "$todir/ThisShouldGo"
  22. runtest "ssh: renamed file" 'checkit "$RSYNC --delete -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'