Made the devices.test script do a real device test when called

normally, or a fake-device test when called with "fake" in the
script name.  Added a devices-fake.test symlink.
This commit is contained in:
Wayne Davison committed 2007-04-24 17:06:09 +00:00
1 parent acac1f5c6f
commit 9557eabaa7
1 file changed
+15 -10
+15 -10
View File
@@ -14,16 +14,9 @@ outfile="$scratchdir/rsync.out"
# Build some hardlinks
case `id -u` in
'') ;; # If "id" failed, try to continue...
0) ;;
*) if [ -f /usr/bin/fakeroot ]; then
echo "Let's try re-running the script under fakeroot..."
exec /usr/bin/fakeroot /bin/sh $RUNSHFLAGS "$0"
fi
# If we can't test the real device code, try to test --fake-super instead
$RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs root/fakeroot/--fake-super for device tests"
case $0 in
*fake*)
$RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests"
RSYNC="$RSYNC --fake-super"
TLS_ARGS=--fake-super
case "`xattr 2>&1`" in
@@ -57,6 +50,18 @@ case `id -u` in
;;
esac
;;
*)
case `id -u` in
'') ;; # If "id" failed, try to continue...
0) ;;
*) if [ -f /usr/bin/fakeroot ]; then
echo "Let's try re-running the script under fakeroot..."
exec /usr/bin/fakeroot /bin/sh $RUNSHFLAGS "$0"
fi
test_skipped "Rsync needs root/fakeroot for device tests"
;;
esac
;;
esac
# TODO: Need to test whether hardlinks are possible on this OS/filesystem