X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9439c0cb5a4b020b9bfcfe0351e33c17b9c53b54..043ef55b227146d2482859c66573b3229042ee75:/testsuite/devices.test diff --git a/testsuite/devices.test b/testsuite/devices.test index b25fa6ea..6bdd4b1a 100644 --- a/testsuite/devices.test +++ b/testsuite/devices.test @@ -14,18 +14,11 @@ 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" - export RSYNC_FAKE_SUPER=1 + TLS_ARGS=--fake-super case "`xattr 2>&1`" in *--list:*) mknod() { @@ -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