diff options
-rw-r--r-- | etc/mtree/BSD.tests.dist | 2 | ||||
-rw-r--r-- | tests/sys/Makefile | 1 | ||||
-rw-r--r-- | tests/sys/acl/00.sh (renamed from tools/regression/acltools/00.t) | 19 | ||||
-rw-r--r-- | tests/sys/acl/01.sh (renamed from tools/regression/acltools/01.t) | 21 | ||||
-rw-r--r-- | tests/sys/acl/02.sh (renamed from tools/regression/acltools/02.t) | 19 | ||||
-rw-r--r-- | tests/sys/acl/03.sh (renamed from tools/regression/acltools/03.t) | 17 | ||||
-rw-r--r-- | tests/sys/acl/04.sh (renamed from tools/regression/acltools/04.t) | 14 | ||||
-rwxr-xr-x | tests/sys/acl/aclfuzzer.sh (renamed from tools/regression/acltools/aclfuzzer.sh) | 0 | ||||
-rwxr-xr-x | tests/sys/acl/mktrivial.sh (renamed from tools/regression/acltools/mktrivial.sh) | 0 | ||||
-rw-r--r-- | tests/sys/acl/run (renamed from tools/regression/acltools/run) | 0 | ||||
-rw-r--r-- | tests/sys/acl/tools-crossfs.test (renamed from tools/regression/acltools/tools-crossfs.test) | 0 | ||||
-rw-r--r-- | tests/sys/acl/tools-nfs4-psarc.test (renamed from tools/regression/acltools/tools-nfs4-psarc.test) | 0 | ||||
-rw-r--r-- | tests/sys/acl/tools-nfs4-trivial.test (renamed from tools/regression/acltools/tools-nfs4-trivial.test) | 0 | ||||
-rw-r--r-- | tests/sys/acl/tools-nfs4.test (renamed from tools/regression/acltools/tools-nfs4.test) | 0 | ||||
-rw-r--r-- | tests/sys/acl/tools-posix.test (renamed from tools/regression/acltools/tools-posix.test) | 0 |
15 files changed, 57 insertions, 36 deletions
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 57c85c0..db4cb6f 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -356,6 +356,8 @@ .. .. sys + acl + .. aio .. fifo diff --git a/tests/sys/Makefile b/tests/sys/Makefile index 8f37490..217a8ec 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys +TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file diff --git a/tools/regression/acltools/00.t b/tests/sys/acl/00.sh index 8899088..61e8115 100644 --- a/tools/regression/acltools/00.t +++ b/tests/sys/acl/00.sh @@ -37,12 +37,16 @@ # # Output should be obvious. -echo "1..4" - -if [ `whoami` != "root" ]; then - echo "not ok 1 - you need to be root to run this test." - exit 1 +if [ $(sysctl -n kern.features.ufs_acl 2>/dev/null || echo 0) -eq 0 ]; then + echo "1..0 # SKIP system does not have UFS ACL support" + exit 0 fi +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP you must be root" + exit 0 +fi + +echo "1..4" TESTDIR=$(dirname $(realpath $0)) @@ -50,9 +54,11 @@ TESTDIR=$(dirname $(realpath $0)) MD=`mdconfig -at swap -s 10m` MNT=`mktemp -dt acltools` newfs /dev/$MD > /dev/null +trap "cd /; umount -f $MNT; rmdir $MNT; mdconfig -d -u $MD" EXIT mount -o acls /dev/$MD $MNT if [ $? -ne 0 ]; then echo "not ok 1 - mount failed." + echo 'Bail out!' exit 1 fi @@ -78,8 +84,5 @@ else fi cd / -umount -f $MNT -rmdir $MNT -mdconfig -du $MD echo "ok 4" diff --git a/tools/regression/acltools/01.t b/tests/sys/acl/01.sh index f84e0a9..93487a7 100644 --- a/tools/regression/acltools/01.t +++ b/tests/sys/acl/01.sh @@ -39,21 +39,27 @@ # # Output should be obvious. -echo "1..4" - -if [ `whoami` != "root" ]; then - echo "not ok 1 - you need to be root to run this test." - exit 1 +if ! sysctl vfs.zfs.version.spa >/dev/null 2>&1; then + echo "1..0 # SKIP system doesn't have ZFS loaded" + exit 0 +fi +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP you must be root" + exit 0 fi +echo "1..4" + TESTDIR=$(dirname $(realpath $0)) # Set up the test filesystem. MD=`mdconfig -at swap -s 64m` MNT=`mktemp -dt acltools` +trap "cd /; zpool destroy -f acltools; rmdir $MNT; mdconfig -d -u $MD" EXIT zpool create -m $MNT acltools /dev/$MD if [ $? -ne 0 ]; then echo "not ok 1 - 'zpool create' failed." + echo 'Bail out!' exit 1 fi @@ -78,9 +84,4 @@ else echo "not ok 3" fi -cd / -zpool destroy -f acltools -rmdir $MNT -mdconfig -du $MD - echo "ok 4" diff --git a/tools/regression/acltools/02.t b/tests/sys/acl/02.sh index 9a82c78..8fbb39d 100644 --- a/tools/regression/acltools/02.t +++ b/tests/sys/acl/02.sh @@ -37,12 +37,16 @@ # # Output should be obvious. -echo "1..4" - -if [ `whoami` != "root" ]; then - echo "not ok 1 - you need to be root to run this test." - exit 1 +if [ $(sysctl -n kern.features.ufs_acl 2>/dev/null || echo 0) -eq 0 ]; then + echo "1..0 # SKIP system does not have UFS ACL support" + exit 0 fi +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP you must be root" + exit 0 +fi + +echo "1..4" TESTDIR=$(dirname $(realpath $0)) @@ -50,9 +54,11 @@ TESTDIR=$(dirname $(realpath $0)) MD=`mdconfig -at swap -s 10m` MNT=`mktemp -dt acltools` newfs /dev/$MD > /dev/null +trap "cd /; umount -f $MNT; rmdir $MNT; mdconfig -d -u $MD" EXIT mount -o nfsv4acls /dev/$MD $MNT if [ $? -ne 0 ]; then echo "not ok 1 - mount failed." + echo 'Bail out!' exit 1 fi @@ -82,9 +88,6 @@ else fi cd / -umount -f $MNT -rmdir $MNT -mdconfig -du $MD echo "ok 4" diff --git a/tools/regression/acltools/03.t b/tests/sys/acl/03.sh index a0b4199..2b81b26 100644 --- a/tools/regression/acltools/03.t +++ b/tests/sys/acl/03.sh @@ -34,12 +34,16 @@ # # Output should be obvious. -echo "1..5" - -if [ `whoami` != "root" ]; then - echo "not ok 1 - you need to be root to run this test." - exit 1 +if ! sysctl vfs.zfs.version.spa >/dev/null 2>&1; then + echo "1..0 # SKIP system doesn't have ZFS loaded" + exit 0 fi +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP you must be root" + exit 0 +fi + +echo "1..5" TESTDIR=$(dirname $(realpath $0)) MNTROOT=`mktemp -dt acltools` @@ -51,6 +55,7 @@ mkdir $MNT1 zpool create -m $MNT1 acltools /dev/$MD1 if [ $? -ne 0 ]; then echo "not ok 1 - 'zpool create' failed." + echo 'Bail out!' exit 1 fi @@ -63,6 +68,7 @@ newfs /dev/$MD2 > /dev/null mount -o acls /dev/$MD2 $MNT2 if [ $? -ne 0 ]; then echo "not ok 2 - mount failed." + echo 'Bail out!' exit 1 fi @@ -75,6 +81,7 @@ newfs /dev/$MD3 > /dev/null mount /dev/$MD3 $MNT3 if [ $? -ne 0 ]; then echo "not ok 3 - mount failed." + echo 'Bail out!' exit 1 fi diff --git a/tools/regression/acltools/04.t b/tests/sys/acl/04.sh index 1a13183..5669c5a 100644 --- a/tools/regression/acltools/04.t +++ b/tests/sys/acl/04.sh @@ -31,12 +31,16 @@ # # WARNING: It uses hardcoded ZFS pool name "acltools" -echo "1..3" - -if [ `whoami` != "root" ]; then - echo "not ok 1 - you need to be root to run this test." - exit 1 +if ! sysctl vfs.zfs.version.spa >/dev/null 2>&1; then + echo "1..0 # SKIP system doesn't have ZFS loaded" + exit 0 fi +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP you must be root" + exit 0 +fi + +echo "1..3" TESTDIR=$(dirname $(realpath $0)) diff --git a/tools/regression/acltools/aclfuzzer.sh b/tests/sys/acl/aclfuzzer.sh index dff07d8..dff07d8 100755 --- a/tools/regression/acltools/aclfuzzer.sh +++ b/tests/sys/acl/aclfuzzer.sh diff --git a/tools/regression/acltools/mktrivial.sh b/tests/sys/acl/mktrivial.sh index 99e3614..99e3614 100755 --- a/tools/regression/acltools/mktrivial.sh +++ b/tests/sys/acl/mktrivial.sh diff --git a/tools/regression/acltools/run b/tests/sys/acl/run index 383f47e..383f47e 100644 --- a/tools/regression/acltools/run +++ b/tests/sys/acl/run diff --git a/tools/regression/acltools/tools-crossfs.test b/tests/sys/acl/tools-crossfs.test index 1f59637..1f59637 100644 --- a/tools/regression/acltools/tools-crossfs.test +++ b/tests/sys/acl/tools-crossfs.test diff --git a/tools/regression/acltools/tools-nfs4-psarc.test b/tests/sys/acl/tools-nfs4-psarc.test index 9ab0b51..9ab0b51 100644 --- a/tools/regression/acltools/tools-nfs4-psarc.test +++ b/tests/sys/acl/tools-nfs4-psarc.test diff --git a/tools/regression/acltools/tools-nfs4-trivial.test b/tests/sys/acl/tools-nfs4-trivial.test index 366b099..366b099 100644 --- a/tools/regression/acltools/tools-nfs4-trivial.test +++ b/tests/sys/acl/tools-nfs4-trivial.test diff --git a/tools/regression/acltools/tools-nfs4.test b/tests/sys/acl/tools-nfs4.test index e2ddc2b..e2ddc2b 100644 --- a/tools/regression/acltools/tools-nfs4.test +++ b/tests/sys/acl/tools-nfs4.test diff --git a/tools/regression/acltools/tools-posix.test b/tests/sys/acl/tools-posix.test index 4741db3..4741db3 100644 --- a/tools/regression/acltools/tools-posix.test +++ b/tests/sys/acl/tools-posix.test |