hands.test 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. # Copyright (C) 1998, 1999 by Philip Hands <phil@hands.com>
  3. # Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org>
  4. #
  5. # This program is distributable under the terms of the GNU GPL (see COPYING)
  6. . "$suitedir/rsync.fns"
  7. hands_setup
  8. # Main script starts here
  9. runtest "basic operation" 'checkit "$RSYNC -av \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
  10. ln "$fromdir/filelist" "$fromdir/dir"
  11. runtest "hard links" 'checkit "$RSYNC -avH \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
  12. rm "$todir/text"
  13. runtest "one file" 'checkit "$RSYNC -avH \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
  14. echo "extra line" >> "$todir/text"
  15. runtest "extra data" 'checkit "$RSYNC -avH --no-whole-file \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
  16. cp "$fromdir/text" "$todir/ThisShouldGo"
  17. runtest " --delete" 'checkit "$RSYNC --delete -avH \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'
  18. cd "$tmpdir"
  19. rm -rf to from/*dir
  20. # Do the real copy, touch up the parent-dir's time, and then check the copy.
  21. $RSYNC -av from/* to/
  22. checkit "$RSYNC -av --exclude='*' from/ to/" "$fromdir" "$todir"
  23. # The script would have aborted on error, so getting here means we've won.
  24. exit 0