X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/aa381148a3b7fcf0772ea587e3d7969bd637dfcc..0b67d5e396f54dc07fad3a22b05921d4f00768fc:/testsuite/rsync.fns diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index b58bd0db..ca05297f 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -26,6 +26,7 @@ chkdir="$tmpdir/chk" all_plus='+++++++++' allspace=' ' dots='.....' # trailing dots after changes +tab_ch=' ' # a single tab character # Berkley's nice. PATH="$PATH:/usr/ucb" @@ -99,6 +100,10 @@ rsync_ls_lR() { find "$@" -print | sort | sed 's/ /\\ /g' | xargs "$TOOLDIR/tls" $TLS_ARGS } +get_testuid() { + id 2>/dev/null | sed 's/^[^0-9]*\([0-9][0-9]*\).*/\1/' +} + check_perms() { perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'` if test $perms = $2; then @@ -218,7 +223,7 @@ checkit() { eval "$1" status=$? if [ $status != 0 ]; then - failed="YES"; + failed="$failed status=$status" fi echo "-------------" @@ -226,7 +231,7 @@ checkit() { echo "" ( cd "$2" && rsync_ls_lR . ) > "$tmpdir/ls-from" ( cd "$3" && rsync_ls_lR . ) > "$tmpdir/ls-to" - diff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed=YES + diff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed="$failed dir-diff" echo "-------------" echo "check how the files compare with diff:" @@ -234,15 +239,16 @@ checkit() { if [ "x$4" != x ]; then echo " === Skipping (as directed) ===" else - diff -r $diffopt "$2" "$3" || failed=YES + diff -r $diffopt "$2" "$3" || failed="$failed file-diff" fi echo "-------------" if [ -z "$failed" ] ; then return 0 - else - return 1 fi + + echo "Failed: $failed" + return 1 } @@ -258,7 +264,7 @@ build_rsyncd_conf() { uid_setting='uid = 0' gid_setting='gid = 0' - case `id -u` in + case `get_testuid` in 0) ;; *) # Non-root cannot specify uid & gid settings