From: Karel Zak Date: Wed, 27 May 2009 13:20:01 +0000 (+0200) Subject: tests: don't run some mount tests for non-root users X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8ab374488069cd7d2b869bd239199cf8c73d366;p=util-linux tests: don't run some mount tests for non-root users Signed-off-by: Karel Zak --- diff --git a/tests/functions.sh b/tests/functions.sh index 5e8509f7..50ef12d8 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -153,7 +153,7 @@ function ts_init_subtest { [ $TS_NSUBTESTS -eq 0 ] && echo TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 )) - printf "%18s: %-27s ..." "" "$TS_SUBNAME" + printf "%16s: %-27s ..." "" "$TS_SUBNAME" } function ts_init { @@ -161,7 +161,7 @@ function ts_init { ts_init_env "$*" - printf "%15s: %-30s ..." "$TS_COMPONENT" "$TS_DESC" + printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_DESC" [ "$is_fake" == "yes" ] && ts_skip "fake mode" } @@ -218,7 +218,7 @@ function ts_finalize { done if [ $TS_NSUBTESTS -ne 0 ]; then - printf "%13s..." + printf "%11s..." if [ $TS_NSUBFAILED -ne 0 ]; then ts_failed "$TS_NSUBFAILED from $TS_NSUBTESTS sub-tests" else diff --git a/tests/ts/mount/noncanonical b/tests/ts/mount/noncanonical index d9be68be..31149923 100755 --- a/tests/ts/mount/noncanonical +++ b/tests/ts/mount/noncanonical @@ -20,6 +20,7 @@ TS_DESC="non canonical path" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_skip_nonroot [ ! -e "/etc" ] && ts_skip "/etc not such file of directory" diff --git a/tests/ts/mount/paths b/tests/ts/mount/paths index 93b44ae9..bb2cabf3 100755 --- a/tests/ts/mount/paths +++ b/tests/ts/mount/paths @@ -20,6 +20,7 @@ TS_DESC="basic paths" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_skip_nonroot $TS_CMD_MOUNT -n -f -v -v -v /dev/dummy /mnt &> $TS_OUTPUT