svn commit: r288680 - in user/ngie/more-tests: etc/mtree tests/sys tests/sys/acl tools/regression/acltools

Garrett Cooper ngie at FreeBSD.org
Mon Oct 5 00:55:18 UTC 2015


Author: ngie
Date: Mon Oct  5 00:55:16 2015
New Revision: 288680
URL: https://svnweb.freebsd.org/changeset/base/288680

Log:
  Integrate tools/regression/acltools into tests/sys/acl
  
  Apply patches I've been running for months on my GitHub project

Added:
  user/ngie/more-tests/tests/sys/acl/
     - copied from r288678, user/ngie/more-tests/tools/regression/acltools/
  user/ngie/more-tests/tests/sys/acl/00.sh
     - copied, changed from r288678, user/ngie/more-tests/tools/regression/acltools/00.t
  user/ngie/more-tests/tests/sys/acl/01.sh
     - copied, changed from r288678, user/ngie/more-tests/tools/regression/acltools/01.t
  user/ngie/more-tests/tests/sys/acl/02.sh
     - copied, changed from r288678, user/ngie/more-tests/tools/regression/acltools/02.t
  user/ngie/more-tests/tests/sys/acl/03.sh
     - copied, changed from r288678, user/ngie/more-tests/tools/regression/acltools/03.t
  user/ngie/more-tests/tests/sys/acl/04.sh
     - copied, changed from r288678, user/ngie/more-tests/tools/regression/acltools/04.t
Deleted:
  user/ngie/more-tests/tests/sys/acl/00.t
  user/ngie/more-tests/tests/sys/acl/01.t
  user/ngie/more-tests/tests/sys/acl/02.t
  user/ngie/more-tests/tests/sys/acl/03.t
  user/ngie/more-tests/tests/sys/acl/04.t
  user/ngie/more-tests/tools/regression/acltools/
Modified:
  user/ngie/more-tests/etc/mtree/BSD.tests.dist
  user/ngie/more-tests/tests/sys/Makefile

Modified: user/ngie/more-tests/etc/mtree/BSD.tests.dist
==============================================================================
--- user/ngie/more-tests/etc/mtree/BSD.tests.dist	Mon Oct  5 00:51:41 2015	(r288679)
+++ user/ngie/more-tests/etc/mtree/BSD.tests.dist	Mon Oct  5 00:55:16 2015	(r288680)
@@ -356,6 +356,8 @@
         ..
     ..
     sys
+        acl
+        ..
         aio
         ..
         fifo

Modified: user/ngie/more-tests/tests/sys/Makefile
==============================================================================
--- user/ngie/more-tests/tests/sys/Makefile	Mon Oct  5 00:51:41 2015	(r288679)
+++ user/ngie/more-tests/tests/sys/Makefile	Mon Oct  5 00:55:16 2015	(r288680)
@@ -4,6 +4,7 @@
 
 TESTSDIR= ${TESTSBASE}/sys
 
+TESTS_SUBDIRS+=		acl
 TESTS_SUBDIRS+=		aio
 TESTS_SUBDIRS+=		fifo
 TESTS_SUBDIRS+=		file

Copied and modified: user/ngie/more-tests/tests/sys/acl/00.sh (from r288678, user/ngie/more-tests/tools/regression/acltools/00.t)
==============================================================================
--- user/ngie/more-tests/tools/regression/acltools/00.t	Mon Oct  5 00:33:57 2015	(r288678, copy source)
+++ user/ngie/more-tests/tests/sys/acl/00.sh	Mon Oct  5 00:55:16 2015	(r288680)
@@ -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"

Copied and modified: user/ngie/more-tests/tests/sys/acl/01.sh (from r288678, user/ngie/more-tests/tools/regression/acltools/01.t)
==============================================================================
--- user/ngie/more-tests/tools/regression/acltools/01.t	Mon Oct  5 00:33:57 2015	(r288678, copy source)
+++ user/ngie/more-tests/tests/sys/acl/01.sh	Mon Oct  5 00:55:16 2015	(r288680)
@@ -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"

Copied and modified: user/ngie/more-tests/tests/sys/acl/02.sh (from r288678, user/ngie/more-tests/tools/regression/acltools/02.t)
==============================================================================
--- user/ngie/more-tests/tools/regression/acltools/02.t	Mon Oct  5 00:33:57 2015	(r288678, copy source)
+++ user/ngie/more-tests/tests/sys/acl/02.sh	Mon Oct  5 00:55:16 2015	(r288680)
@@ -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"
 

Copied and modified: user/ngie/more-tests/tests/sys/acl/03.sh (from r288678, user/ngie/more-tests/tools/regression/acltools/03.t)
==============================================================================
--- user/ngie/more-tests/tools/regression/acltools/03.t	Mon Oct  5 00:33:57 2015	(r288678, copy source)
+++ user/ngie/more-tests/tests/sys/acl/03.sh	Mon Oct  5 00:55:16 2015	(r288680)
@@ -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
 

Copied and modified: user/ngie/more-tests/tests/sys/acl/04.sh (from r288678, user/ngie/more-tests/tools/regression/acltools/04.t)
==============================================================================
--- user/ngie/more-tests/tools/regression/acltools/04.t	Mon Oct  5 00:33:57 2015	(r288678, copy source)
+++ user/ngie/more-tests/tests/sys/acl/04.sh	Mon Oct  5 00:55:16 2015	(r288680)
@@ -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))
 


More information about the svn-src-user mailing list