All of lore.kernel.org
 help / color / mirror / Atom feed
* [XFSTESTS 0/6] Richacl Tests
@ 2015-11-18 14:17 Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 1/6] check: Don't complain about missing tests/$FSTYP/group Andreas Gruenbacher
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-11-18 14:17 UTC (permalink / raw)
  To: xfs; +Cc: Andreas Gruenbacher

Here is a first set of patches for adding richacl tests to xfstexts.
The richacl tests are different from the other xfstests in that they are
self verifying: they report success or failure through their exit code
and don't have expected output files (*.out).

Thanks,
Andreas

Andreas Gruenbacher (6):
  check: Don't complain about missing tests/$FSTYP/group
  check: Enforce xfs filesystem recreation on $TEST_DEV
  Rename output file templates to match TEST.out*
  check: Add support for tests without *.out files
  Add richacl tests
  Remove the obsolete nfs4acl tests

 .gitignore                          |  17 ++
 check                               | 118 +++++++++----
 common/rc                           |  24 ++-
 nfs4acl/Makefile                    |  29 ----
 nfs4acl/apply-mask.test             | 143 ----------------
 nfs4acl/basic.test                  |  70 --------
 nfs4acl/chmod.test                  |  31 ----
 nfs4acl/chown.test                  |  63 -------
 nfs4acl/computed-mode.test          |  62 -------
 nfs4acl/create.test                 |  35 ----
 nfs4acl/ctime.test                  |  36 ----
 nfs4acl/delete.test                 |  77 ---------
 nfs4acl/run                         | 298 ---------------------------------
 nfs4acl/unrepresentable.test        |  20 ---
 nfs4acl/write-vs-append.test        |  46 -----
 src/Makefile                        |   2 +-
 src/require-richacls.c              |  35 ++++
 tests/richacl/001-apply-masks       |   1 +
 tests/richacl/002-auto-inheritance  |   1 +
 tests/richacl/003-basic             |   1 +
 tests/richacl/004-chmod             |   1 +
 tests/richacl/005-chown             |   1 +
 tests/richacl/006-create            |   1 +
 tests/richacl/007-ctime             |   1 +
 tests/richacl/008-delete            |   1 +
 tests/richacl/009-setrichacl-modify |   1 +
 tests/richacl/010-write-vs-append   |   1 +
 tests/richacl/Makefile              |  44 +++++
 tests/richacl/apply-masks           | 163 ++++++++++++++++++
 tests/richacl/auto-inheritance      | 191 +++++++++++++++++++++
 tests/richacl/basic                 |  97 +++++++++++
 tests/richacl/chmod                 |  40 +++++
 tests/richacl/chown                 |  42 +++++
 tests/richacl/create                |  36 ++++
 tests/richacl/ctime                 |  35 ++++
 tests/richacl/delete                |  89 ++++++++++
 tests/richacl/group                 |  15 ++
 tests/richacl/setrichacl-modify     |  57 +++++++
 tests/richacl/test-lib.sh           | 149 +++++++++++++++++
 tests/richacl/write-vs-append       |  54 ++++++
 tests/xfs/033                       |   2 +-
 tests/xfs/033.crc.out.linux         | 197 ----------------------
 tests/xfs/033.out.crc.linux         | 197 ++++++++++++++++++++++
 tests/xfs/096                       |   4 +-
 tests/xfs/096.external              |  50 ------
 tests/xfs/096.internal              |  51 ------
 tests/xfs/096.out.external          |  50 ++++++
 tests/xfs/096.out.internal          |  51 ++++++
 tests/xfs/191                       |  75 ---------
 tests/xfs/191.out                   | 324 ------------------------------------
 tests/xfs/group                     |   1 -
 51 files changed, 1485 insertions(+), 1645 deletions(-)
 delete mode 100644 nfs4acl/Makefile
 delete mode 100644 nfs4acl/apply-mask.test
 delete mode 100644 nfs4acl/basic.test
 delete mode 100644 nfs4acl/chmod.test
 delete mode 100644 nfs4acl/chown.test
 delete mode 100644 nfs4acl/computed-mode.test
 delete mode 100644 nfs4acl/create.test
 delete mode 100644 nfs4acl/ctime.test
 delete mode 100644 nfs4acl/delete.test
 delete mode 100755 nfs4acl/run
 delete mode 100644 nfs4acl/unrepresentable.test
 delete mode 100644 nfs4acl/write-vs-append.test
 create mode 100644 src/require-richacls.c
 create mode 120000 tests/richacl/001-apply-masks
 create mode 120000 tests/richacl/002-auto-inheritance
 create mode 120000 tests/richacl/003-basic
 create mode 120000 tests/richacl/004-chmod
 create mode 120000 tests/richacl/005-chown
 create mode 120000 tests/richacl/006-create
 create mode 120000 tests/richacl/007-ctime
 create mode 120000 tests/richacl/008-delete
 create mode 120000 tests/richacl/009-setrichacl-modify
 create mode 120000 tests/richacl/010-write-vs-append
 create mode 100644 tests/richacl/Makefile
 create mode 100755 tests/richacl/apply-masks
 create mode 100755 tests/richacl/auto-inheritance
 create mode 100755 tests/richacl/basic
 create mode 100755 tests/richacl/chmod
 create mode 100755 tests/richacl/chown
 create mode 100755 tests/richacl/create
 create mode 100755 tests/richacl/ctime
 create mode 100755 tests/richacl/delete
 create mode 100644 tests/richacl/group
 create mode 100755 tests/richacl/setrichacl-modify
 create mode 100644 tests/richacl/test-lib.sh
 create mode 100755 tests/richacl/write-vs-append
 delete mode 100644 tests/xfs/033.crc.out.linux
 create mode 100644 tests/xfs/033.out.crc.linux
 delete mode 100644 tests/xfs/096.external
 delete mode 100644 tests/xfs/096.internal
 create mode 100644 tests/xfs/096.out.external
 create mode 100644 tests/xfs/096.out.internal
 delete mode 100755 tests/xfs/191
 delete mode 100644 tests/xfs/191.out

-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [XFSTESTS 1/6] check: Don't complain about missing tests/$FSTYP/group
  2015-11-18 14:17 [XFSTESTS 0/6] Richacl Tests Andreas Gruenbacher
@ 2015-11-18 14:17 ` Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 2/6] check: Enforce xfs filesystem recreation on $TEST_DEV Andreas Gruenbacher
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-11-18 14:17 UTC (permalink / raw)
  To: xfs; +Cc: Andreas Gruenbacher

When filesystems don't have filesystem specific tests, those nonexistent
tests also won't have a group file.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 check | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/check b/check
index 8281322..4a9b332 100755
--- a/check
+++ b/check
@@ -95,6 +95,8 @@ get_group_list()
 	grp=$1
 
 	for d in $SRC_GROUPS $FSTYP; do
+		[ -e "$SRC_DIR/$d/group" ] || continue
+
 		l=$(sed -n < $SRC_DIR/$d/group \
 			-e 's/#.*//' \
 			-e 's/$/ /' \
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [XFSTESTS 2/6] check: Enforce xfs filesystem recreation on $TEST_DEV
  2015-11-18 14:17 [XFSTESTS 0/6] Richacl Tests Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 1/6] check: Don't complain about missing tests/$FSTYP/group Andreas Gruenbacher
@ 2015-11-18 14:17 ` Andreas Gruenbacher
  2015-12-01 14:43   ` Carlos Maiolino
  2015-11-18 14:17 ` [XFSTESTS 3/6] Rename output file templates to match TEST.out* Andreas Gruenbacher
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-11-18 14:17 UTC (permalink / raw)
  To: xfs; +Cc: Andreas Gruenbacher

When recreating xfs filesystems on $TEST_DEV, pass option -f to enforce
the filesystem creation instead of refusing to overwrite existing xfs
filesystems.  We already do that for ext2/ext3/ext4 filesystems.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/rc b/common/rc
index 4c2f42c..ce6ae3d 100644
--- a/common/rc
+++ b/common/rc
@@ -572,6 +572,9 @@ _test_mkfs()
     btrfs)
         $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [XFSTESTS 3/6] Rename output file templates to match TEST.out*
  2015-11-18 14:17 [XFSTESTS 0/6] Richacl Tests Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 1/6] check: Don't complain about missing tests/$FSTYP/group Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 2/6] check: Enforce xfs filesystem recreation on $TEST_DEV Andreas Gruenbacher
@ 2015-11-18 14:17 ` Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 4/6] check: Add support for tests without *.out files Andreas Gruenbacher
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-11-18 14:17 UTC (permalink / raw)
  To: xfs; +Cc: Andreas Gruenbacher

Rename the expected output files so that they all match "$TEST_NAME.out*".
That way, we can statically check if a test has any .out* files.

Tests with multiple output file variants symlink $TEST_NAME.out to one
of those variants.  For those tests, add $TEST_NAME.out to .gitignore.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 .gitignore                  |  16 ++++
 tests/xfs/033               |   2 +-
 tests/xfs/033.crc.out.linux | 197 --------------------------------------------
 tests/xfs/033.out.crc.linux | 197 ++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/096               |   4 +-
 tests/xfs/096.external      |  50 -----------
 tests/xfs/096.internal      |  51 ------------
 tests/xfs/096.out.external  |  50 +++++++++++
 tests/xfs/096.out.internal  |  51 ++++++++++++
 9 files changed, 317 insertions(+), 301 deletions(-)
 delete mode 100644 tests/xfs/033.crc.out.linux
 create mode 100644 tests/xfs/033.out.crc.linux
 delete mode 100644 tests/xfs/096.external
 delete mode 100644 tests/xfs/096.internal
 create mode 100644 tests/xfs/096.out.external
 create mode 100644 tests/xfs/096.out.internal

diff --git a/.gitignore b/.gitignore
index 5dc4f69..7c25c41 100644
--- a/.gitignore
+++ b/.gitignore
@@ -195,3 +195,19 @@
 /dmapi/src/suite2/src/test_invis
 /dmapi/src/suite2/src/test_region
 /dmapi/src/suite2/src/test_rights
+
+# Symlinked .out files
+/tests/generic/088.out
+/tests/generic/097.out
+/tests/xfs/022.out
+/tests/xfs/023.out
+/tests/xfs/031.out
+/tests/xfs/033.out
+/tests/xfs/035.out
+/tests/xfs/036.out
+/tests/xfs/039.out
+/tests/xfs/043.out
+/tests/xfs/055.out
+/tests/xfs/071.out
+/tests/xfs/096.out
+/tests/xfs/146.out
diff --git a/tests/xfs/033 b/tests/xfs/033
index 576d437..4163964 100755
--- a/tests/xfs/033
+++ b/tests/xfs/033
@@ -85,7 +85,7 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
 
 # link correct .out file
 if [ $_fs_has_crcs -eq 1 ]; then
-	_link_out_file $seq.crc.out $seqfull.out
+	_link_out_file $seq.out.crc $seqfull.out
 else
 	_link_out_file $seq.out $seqfull.out
 fi
diff --git a/tests/xfs/033.crc.out.linux b/tests/xfs/033.crc.out.linux
deleted file mode 100644
index a6e86b9..0000000
--- a/tests/xfs/033.crc.out.linux
+++ /dev/null
@@ -1,197 +0,0 @@
-QA output created by 033
-meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
-data     = bsize=XXX blocks=XXX, imaxpct=PCT
-         = sunit=XXX swidth=XXX, unwritten=X
-naming   =VERN bsize=XXX
-log      =LDEV bsize=XXX blocks=XXX
-realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
-Corrupting root inode - setting bits to 0
-Wrote X.XXKb (value 0x0)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0x0 on inode INO
-bad version number 0x0 on inode INO
-inode identifier 0 mismatch on inode INO
-bad magic number 0x0 on inode INO, resetting magic number
-bad version number 0x0 on inode INO, resetting version number
-inode identifier 0 mismatch on inode INO
-cleared root inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-root inode lost
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing root directory
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-resetting inode INO nlinks from 1 to 2
-done
-Corrupting rt bitmap inode - setting bits to 0
-Wrote X.XXKb (value 0x0)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0x0 on inode INO
-bad version number 0x0 on inode INO
-inode identifier 0 mismatch on inode INO
-bad magic number 0x0 on inode INO, resetting magic number
-bad version number 0x0 on inode INO, resetting version number
-inode identifier 0 mismatch on inode INO
-cleared realtime bitmap inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime bitmap inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
-Corrupting rt summary inode - setting bits to 0
-Wrote X.XXKb (value 0x0)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0x0 on inode INO
-bad version number 0x0 on inode INO
-inode identifier 0 mismatch on inode INO
-bad magic number 0x0 on inode INO, resetting magic number
-bad version number 0x0 on inode INO, resetting version number
-inode identifier 0 mismatch on inode INO
-cleared realtime summary inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime summary inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
-Corrupting root inode - setting bits to -1
-Wrote X.XXKb (value 0xffffffff)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0xffff on inode INO
-bad version number 0xffffffff on inode INO
-inode identifier 18446744073709551615 mismatch on inode INO
-bad magic number 0xffff on inode INO, resetting magic number
-bad version number 0xffffffff on inode INO, resetting version number
-inode identifier 18446744073709551615 mismatch on inode INO
-cleared root inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-root inode lost
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing root directory
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-resetting inode INO nlinks from 1 to 2
-done
-Corrupting rt bitmap inode - setting bits to -1
-Wrote X.XXKb (value 0xffffffff)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0xffff on inode INO
-bad version number 0xffffffff on inode INO
-inode identifier 18446744073709551615 mismatch on inode INO
-bad magic number 0xffff on inode INO, resetting magic number
-bad version number 0xffffffff on inode INO, resetting version number
-inode identifier 18446744073709551615 mismatch on inode INO
-cleared realtime bitmap inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime bitmap inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
-Corrupting rt summary inode - setting bits to -1
-Wrote X.XXKb (value 0xffffffff)
-Phase 1 - find and verify superblock...
-Phase 2 - using <TYPEOF> log
-        - zero log...
-        - scan filesystem freespace and inode maps...
-        - found root inode chunk
-Phase 3 - for each AG...
-        - scan and clear agi unlinked lists...
-        - process known inodes and perform inode discovery...
-bad magic number 0xffff on inode INO
-bad version number 0xffffffff on inode INO
-inode identifier 18446744073709551615 mismatch on inode INO
-bad magic number 0xffff on inode INO, resetting magic number
-bad version number 0xffffffff on inode INO, resetting version number
-inode identifier 18446744073709551615 mismatch on inode INO
-cleared realtime summary inode INO
-        - process newly discovered inodes...
-Phase 4 - check for duplicate blocks...
-        - setting up duplicate extent list...
-        - check for inodes claiming duplicate blocks...
-Phase 5 - rebuild AG headers and trees...
-        - reset superblock...
-Phase 6 - check inode connectivity...
-reinitializing realtime summary inode
-        - resetting contents of realtime bitmap and summary inodes
-        - traversing filesystem ...
-        - traversal finished ...
-        - moving disconnected inodes to lost+found ...
-Phase 7 - verify and correct link counts...
-done
diff --git a/tests/xfs/033.out.crc.linux b/tests/xfs/033.out.crc.linux
new file mode 100644
index 0000000..a6e86b9
--- /dev/null
+++ b/tests/xfs/033.out.crc.linux
@@ -0,0 +1,197 @@
+QA output created by 033
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+Corrupting root inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared root inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+root inode lost
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing root directory
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+resetting inode INO nlinks from 1 to 2
+done
+Corrupting rt bitmap inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared realtime bitmap inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime bitmap inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting rt summary inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared realtime summary inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime summary inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting root inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared root inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+root inode lost
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing root directory
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+resetting inode INO nlinks from 1 to 2
+done
+Corrupting rt bitmap inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared realtime bitmap inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime bitmap inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting rt summary inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared realtime summary inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime summary inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
diff --git a/tests/xfs/096 b/tests/xfs/096
index c289c10..f949e83 100755
--- a/tests/xfs/096
+++ b/tests/xfs/096
@@ -109,9 +109,9 @@ _require_v2log
 # choose .out file based on internal/external log
 rm -f $seqfull.out
 if [ "$USE_EXTERNAL" = yes ]; then
-	ln -s $seq.external $seqfull.out
+	ln -s $seq.out.external $seqfull.out
 else
-	ln -s $seq.internal $seqfull.out
+	ln -s $seq.out.internal $seqfull.out
 fi
 
 # maximum log record size
diff --git a/tests/xfs/096.external b/tests/xfs/096.external
deleted file mode 100644
index 3122330..0000000
--- a/tests/xfs/096.external
+++ /dev/null
@@ -1,50 +0,0 @@
-QA output created by 096
-
-# su too big but must be a multiple of fs block size too
---- mkfs=-l version=2,su=262656 ---
-log stripe unit (262656) must be a multiple of the block size (4096)
-
-
-# test log stripe greater than LR size
---- mkfs=-l version=2,su=266240 ---
-meta-data=DEV isize=N      agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=0      swidth=0 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
-# same test but get log stripe from data stripe
---- mkfs=-l version=2 -d su=266240,sw=1 ---
-meta-data=DEV isize=N      agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=65     swidth=65 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-         =                       sunit=N blks
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
-# test out data stripe
---- mkfs=-m crc=0 -l version=1 -d su=266240,sw=1 ---
-meta-data=DEV isize=N      agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=65     swidth=65 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-         =                       sunit=N blks
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
-# test out data stripe the same but using sunit & swidth
---- mkfs=-m crc=0 -l version=1 -d sunit=520,swidth=520 ---
-meta-data=DEV isize=N      agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=65     swidth=65 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-         =                       sunit=N blks
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
diff --git a/tests/xfs/096.internal b/tests/xfs/096.internal
deleted file mode 100644
index 80201d2..0000000
--- a/tests/xfs/096.internal
+++ /dev/null
@@ -1,51 +0,0 @@
-QA output created by 096
-
-# su too big but must be a multiple of fs block size too
---- mkfs=-l version=2,su=262656 ---
-log stripe unit (262656) must be a multiple of the block size (4096)
-
-
-# test log stripe greater than LR size
---- mkfs=-l version=2,su=266240 ---
-meta-data=DEV isize=N    agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=0      swidth=0 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-         =                       sunit=N blks
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
-# same test but get log stripe from data stripe
---- mkfs=-l version=2 -d su=266240,sw=1 ---
-meta-data=DEV isize=N    agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=65     swidth=65 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-         =                       sunit=N blks
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
-# test out data stripe
---- mkfs=-m crc=0 -l version=1 -d su=266240,sw=1 ---
-meta-data=DEV isize=N    agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=65     swidth=65 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-         =                       sunit=N blks
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
-# test out data stripe the same but using sunit & swidth
---- mkfs=-m crc=0 -l version=1 -d sunit=520,swidth=520 ---
-meta-data=DEV isize=N    agcount=N, agsize=N blks
-data     =                       bsize=4096   blocks=N, imaxpct=N
-         =                       sunit=65     swidth=65 blks, unwritten=1
-naming   =version 2              bsize=4096
-log      =LOG                    bsize=4096   blocks=N, version=N
-         =                       sunit=N blks
-realtime =REALTIME               extsz=N, blocks=N, rtextents=N
-
-
diff --git a/tests/xfs/096.out.external b/tests/xfs/096.out.external
new file mode 100644
index 0000000..3122330
--- /dev/null
+++ b/tests/xfs/096.out.external
@@ -0,0 +1,50 @@
+QA output created by 096
+
+# su too big but must be a multiple of fs block size too
+--- mkfs=-l version=2,su=262656 ---
+log stripe unit (262656) must be a multiple of the block size (4096)
+
+
+# test log stripe greater than LR size
+--- mkfs=-l version=2,su=266240 ---
+meta-data=DEV isize=N      agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=0      swidth=0 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
+# same test but get log stripe from data stripe
+--- mkfs=-l version=2 -d su=266240,sw=1 ---
+meta-data=DEV isize=N      agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=65     swidth=65 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+         =                       sunit=N blks
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
+# test out data stripe
+--- mkfs=-m crc=0 -l version=1 -d su=266240,sw=1 ---
+meta-data=DEV isize=N      agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=65     swidth=65 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+         =                       sunit=N blks
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
+# test out data stripe the same but using sunit & swidth
+--- mkfs=-m crc=0 -l version=1 -d sunit=520,swidth=520 ---
+meta-data=DEV isize=N      agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=65     swidth=65 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+         =                       sunit=N blks
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
diff --git a/tests/xfs/096.out.internal b/tests/xfs/096.out.internal
new file mode 100644
index 0000000..80201d2
--- /dev/null
+++ b/tests/xfs/096.out.internal
@@ -0,0 +1,51 @@
+QA output created by 096
+
+# su too big but must be a multiple of fs block size too
+--- mkfs=-l version=2,su=262656 ---
+log stripe unit (262656) must be a multiple of the block size (4096)
+
+
+# test log stripe greater than LR size
+--- mkfs=-l version=2,su=266240 ---
+meta-data=DEV isize=N    agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=0      swidth=0 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+         =                       sunit=N blks
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
+# same test but get log stripe from data stripe
+--- mkfs=-l version=2 -d su=266240,sw=1 ---
+meta-data=DEV isize=N    agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=65     swidth=65 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+         =                       sunit=N blks
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
+# test out data stripe
+--- mkfs=-m crc=0 -l version=1 -d su=266240,sw=1 ---
+meta-data=DEV isize=N    agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=65     swidth=65 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+         =                       sunit=N blks
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
+# test out data stripe the same but using sunit & swidth
+--- mkfs=-m crc=0 -l version=1 -d sunit=520,swidth=520 ---
+meta-data=DEV isize=N    agcount=N, agsize=N blks
+data     =                       bsize=4096   blocks=N, imaxpct=N
+         =                       sunit=65     swidth=65 blks, unwritten=1
+naming   =version 2              bsize=4096
+log      =LOG                    bsize=4096   blocks=N, version=N
+         =                       sunit=N blks
+realtime =REALTIME               extsz=N, blocks=N, rtextents=N
+
+
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [XFSTESTS 4/6] check: Add support for tests without *.out files
  2015-11-18 14:17 [XFSTESTS 0/6] Richacl Tests Andreas Gruenbacher
                   ` (2 preceding siblings ...)
  2015-11-18 14:17 ` [XFSTESTS 3/6] Rename output file templates to match TEST.out* Andreas Gruenbacher
@ 2015-11-18 14:17 ` Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 5/6] Add richacl tests Andreas Gruenbacher
  2015-11-18 14:17 ` [XFSTESTS 6/6] Remove the obsolete nfs4acl tests Andreas Gruenbacher
  5 siblings, 0 replies; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-11-18 14:17 UTC (permalink / raw)
  To: xfs; +Cc: Andreas Gruenbacher

Add support for tests which report their status through their exit code
instead of producing output that is compared with the expected output.

When such a test returns with exit code 77, it is assumed to have been
skipped; all other non-zero exit codes are treated as test failures.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 check | 77 +++++++++++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 50 insertions(+), 27 deletions(-)

diff --git a/check b/check
index 4a9b332..5ecc12b 100755
--- a/check
+++ b/check
@@ -204,6 +204,13 @@ _prepare_test_list()
 	fi
 }
 
+# Check if a test has any .out* files
+has_out_files()
+{
+    set -- "$1".out*
+    [ $# -gt 0 -a -e "$1" ]
+}
+
 # Process command arguments first.
 while [ $# -gt 0 ]; do
 	case "$1" in
@@ -612,6 +619,13 @@ for section in $HOST_OPTIONS_SECTIONS; do
 		    err=true
 		fi
 
+		if ! has_out_files $seq; then
+		    if [ $sts -eq 77 ]; then
+			cat $tmp.out > $seqres.notrun
+			sts=0
+		    fi
+		fi
+
 		if [ -f $seqres.notrun ]
 		then
 		    $timestamp || echo -n " [not run] "
@@ -624,41 +638,50 @@ for section in $HOST_OPTIONS_SECTIONS; do
 			echo -n " [failed, exit status $sts]"
 			err=true
 		    fi
-		    if [ ! -f $seq.out ]
-		    then
-			echo " - no qualified output"
-			err=true
-		    else
 
-			# coreutils 8.16+ changed quote formats in error messages from
-			# `foo' to 'foo'. Filter old versions to match the new version.
-			sed -i "s/\`/\'/g" $tmp.out
-			if diff $seq.out $tmp.out >/dev/null 2>&1
+		    if has_out_files $seq; then
+			if [ ! -f $seq.out ]
 			then
-			    if $err
+			    echo " - no qualified output"
+			    err=true
+			else
+			    # coreutils 8.16+ changed quote formats in error messages from
+			    # `foo' to 'foo'. Filter old versions to match the new version.
+			    sed -i "s/\`/\'/g" $tmp.out
+
+			    if ! diff $seq.out $tmp.out >/dev/null 2>&1
 			    then
-				:
-			    else
-				echo "$seqnum `expr $stop - $start`" >>$tmp.time
-				echo -n " `expr $stop - $start`s"
+				echo " - output mismatch (see $seqres.out.bad)"
+				mv $tmp.out $seqres.out.bad
+				$diff $seq.out $seqres.out.bad | {
+				    if test "$DIFF_LENGTH" -le 0; then
+					    cat
+				    else
+					    head -n "$DIFF_LENGTH"
+					    echo "..."
+					    echo "(Run '$diff $seq.out $seqres.out.bad'" \
+						    " to see the entire diff)"
+				    fi; } | \
+				    sed -e 's/^\(.\)/    \1/'
+				err=true
 			    fi
-			    echo ""
+			fi
+		    else
+			if ! $err; then
+			    mv $tmp.out $seqres.out.good
 			else
-			    echo " - output mismatch (see $seqres.out.bad)"
 			    mv $tmp.out $seqres.out.bad
-			    $diff $seq.out $seqres.out.bad | {
-				if test "$DIFF_LENGTH" -le 0; then
-					cat
-				else
-					head -n "$DIFF_LENGTH"
-					echo "..."
-					echo "(Run '$diff $seq.out $seqres.out.bad'" \
-						" to see the entire diff)"
-				fi; } | \
-				sed -e 's/^\(.\)/    \1/'
-			    err=true
+			    echo " - output (see $seqres.out.bad)"
+			    cat $seqres.out.bad
 			fi
 		    fi
+
+		    if ! $err; then
+			echo "$seqnum `expr $stop - $start`" >>$tmp.time
+			echo -n " `expr $stop - $start`s"
+			echo ""
+		    fi
+
 		    try="$try $seqnum"
 		    n_try=`expr $n_try + 1`
 		    _check_filesystems
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [XFSTESTS 5/6] Add richacl tests
  2015-11-18 14:17 [XFSTESTS 0/6] Richacl Tests Andreas Gruenbacher
                   ` (3 preceding siblings ...)
  2015-11-18 14:17 ` [XFSTESTS 4/6] check: Add support for tests without *.out files Andreas Gruenbacher
@ 2015-11-18 14:17 ` Andreas Gruenbacher
  2015-11-23 23:08   ` Dave Chinner
  2015-11-18 14:17 ` [XFSTESTS 6/6] Remove the obsolete nfs4acl tests Andreas Gruenbacher
  5 siblings, 1 reply; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-11-18 14:17 UTC (permalink / raw)
  To: xfs; +Cc: Andreas Gruenbacher

Add the Rich Access Control List tests from the richacl package.  The
new tests require TEST_DEV and TEST_DIR to be set.

When the check script is run, it first makes sure that the test
filesystem has richacls enabled or disabled as appropriate: with the
-richacl option, richacls must be enabled; without the -richacl option,
richacls must be disabled.  If TEST_DEV has incorrect richacl support,
the TEST_DEV filesystem is recreated.

The -richacl option currently selects the tests in the richacl group to
be run.  Additional test groups or tests can be specified on the command
line, e.g.,

  ./check -richacl -g quick

(Eventually, the -richacl option will be changed to only skip tests
which are incompatible with richacls.)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 .gitignore                          |   1 +
 check                               |  39 +++++++-
 common/rc                           |  23 ++++-
 src/Makefile                        |   2 +-
 src/require-richacls.c              |  35 +++++++
 tests/richacl/001-apply-masks       |   1 +
 tests/richacl/002-auto-inheritance  |   1 +
 tests/richacl/003-basic             |   1 +
 tests/richacl/004-chmod             |   1 +
 tests/richacl/005-chown             |   1 +
 tests/richacl/006-create            |   1 +
 tests/richacl/007-ctime             |   1 +
 tests/richacl/008-delete            |   1 +
 tests/richacl/009-setrichacl-modify |   1 +
 tests/richacl/010-write-vs-append   |   1 +
 tests/richacl/Makefile              |  44 +++++++++
 tests/richacl/apply-masks           | 163 ++++++++++++++++++++++++++++++
 tests/richacl/auto-inheritance      | 191 ++++++++++++++++++++++++++++++++++++
 tests/richacl/basic                 |  97 ++++++++++++++++++
 tests/richacl/chmod                 |  40 ++++++++
 tests/richacl/chown                 |  42 ++++++++
 tests/richacl/create                |  36 +++++++
 tests/richacl/ctime                 |  35 +++++++
 tests/richacl/delete                |  89 +++++++++++++++++
 tests/richacl/group                 |  15 +++
 tests/richacl/setrichacl-modify     |  57 +++++++++++
 tests/richacl/test-lib.sh           | 149 ++++++++++++++++++++++++++++
 tests/richacl/write-vs-append       |  54 ++++++++++
 28 files changed, 1114 insertions(+), 8 deletions(-)
 create mode 100644 src/require-richacls.c
 create mode 120000 tests/richacl/001-apply-masks
 create mode 120000 tests/richacl/002-auto-inheritance
 create mode 120000 tests/richacl/003-basic
 create mode 120000 tests/richacl/004-chmod
 create mode 120000 tests/richacl/005-chown
 create mode 120000 tests/richacl/006-create
 create mode 120000 tests/richacl/007-ctime
 create mode 120000 tests/richacl/008-delete
 create mode 120000 tests/richacl/009-setrichacl-modify
 create mode 120000 tests/richacl/010-write-vs-append
 create mode 100644 tests/richacl/Makefile
 create mode 100755 tests/richacl/apply-masks
 create mode 100755 tests/richacl/auto-inheritance
 create mode 100755 tests/richacl/basic
 create mode 100755 tests/richacl/chmod
 create mode 100755 tests/richacl/chown
 create mode 100755 tests/richacl/create
 create mode 100755 tests/richacl/ctime
 create mode 100755 tests/richacl/delete
 create mode 100644 tests/richacl/group
 create mode 100755 tests/richacl/setrichacl-modify
 create mode 100644 tests/richacl/test-lib.sh
 create mode 100755 tests/richacl/write-vs-append

diff --git a/.gitignore b/.gitignore
index 7c25c41..d7ff600 100644
--- a/.gitignore
+++ b/.gitignore
@@ -116,6 +116,7 @@
 /src/cloner
 /src/renameat2
 /src/t_rename_overwrite
+/src/require-richacls
 
 # dmapi/ binaries
 /dmapi/src/common/cmd/read_invis
diff --git a/check b/check
index 5ecc12b..89b6d8a 100755
--- a/check
+++ b/check
@@ -60,7 +60,7 @@ then
     exit 1
 fi
 
-SRC_GROUPS="generic shared"
+SRC_GROUPS="generic shared richacl"
 export SRC_DIR="tests"
 
 usage()
@@ -71,6 +71,7 @@ check options
     -nfs                test NFS
     -cifs               test CIFS
     -tmpfs              test TMPFS
+    -richacl            test Rich Access Control Lists
     -l			line mode diff
     -udiff		show unified diff (default)
     -n			show me, do not run tests
@@ -220,6 +221,11 @@ while [ $# -gt 0 ]; do
 	-cifs)	FSTYP=cifs ;;
 	-tmpfs)	FSTYP=tmpfs ;;
 
+	-richacl)
+		RICHACL=1
+		GROUP_LIST="$GROUP_LIST richacl"
+		;;
+
 	-g)	group=$2 ; shift ;
 		GROUP_LIST="$GROUP_LIST ${group//,/ }"
 		;;
@@ -417,6 +423,34 @@ else
 	trap "_wrapup; exit \$status" 0 1 2 3 15
 fi
 
+# Check if the filesystem on a block device is compatible with how the test
+# suite is being run.  Currently, we use this to check if the filesystem
+# has richacl support when needed.
+_dev_is_compatible() {
+    local dev=$1 HAS_RICHACL=
+
+    case "$FSTYP" in
+    xfs)
+	if xfs_db -r -c version "$dev" | grep -qw RICHACL; then
+	    HAS_RICHACL=1
+	fi
+	;;
+
+    ext2|ext3|ext4)
+	if tune2fs -l "$dev" | grep -q '^Filesystem features.*\<richacl\>'; then
+	    HAS_RICHACL=1
+	fi
+	;;
+
+    *)
+	# Other filesystems don't currently have richacl support; there
+	# is no point in recreating them.
+	HAS_RICHACL=$RICHACL
+	;;
+    esac
+    [ "$HAS_RICHACL" = "$RICHACL" ]
+}
+
 for section in $HOST_OPTIONS_SECTIONS; do
 	OLD_FSTYP=$FSTYP
 	OLD_MOUNT_OPTIONS=$MOUNT_OPTIONS
@@ -446,7 +480,8 @@ for section in $HOST_OPTIONS_SECTIONS; do
 		echo "SECTION       -- $section"
 	fi
 
-	if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then
+	if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ] ||
+	   ! _dev_is_compatible "$TEST_DEV"; then
 		echo "RECREATING    -- $FSTYP on $TEST_DEV"
 		umount $TEST_DEV 2> /dev/null
 		if ! _test_mkfs >$tmp.err 2>&1
diff --git a/common/rc b/common/rc
index ce6ae3d..0dd8e4f 100644
--- a/common/rc
+++ b/common/rc
@@ -559,6 +559,19 @@ _scratch_mkfs_ext4()
 
 _test_mkfs()
 {
+    local OPT=$MKFS_OPTIONS
+
+    if [ -n "$RICHACL" ]; then
+	case "$FSTYP" in
+	xfs)
+	    OPT="$OPT -m richacl=1"
+	    ;;
+	ext2|ext3|ext4)
+	    OPT="$OPT -O richacl"
+	    ;;
+	esac
+    fi
+
     case $FSTYP in
     nfs*)
 	# do nothing for nfs
@@ -567,19 +580,19 @@ _test_mkfs()
 	# do nothing for cifs
 	;;
     udf)
-        $MKFS_UDF_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null
+        $MKFS_UDF_PROG $OPT $* $TEST_DEV > /dev/null
 	;;
     btrfs)
-        $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null
+        $MKFS_BTRFS_PROG $OPT $* $TEST_DEV > /dev/null
 	;;
     xfs)
-	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	$MKFS_PROG -t $FSTYP -- -f $OPT $* $TEST_DEV
 	;;
     ext2|ext3|ext4)
-	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
+	$MKFS_PROG -t $FSTYP -- -F $OPT $* $TEST_DEV
 	;;
     *)
-	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
+	yes | $MKFS_PROG -t $FSTYP -- $OPT $* $TEST_DEV
 	;;
     esac
 }
diff --git a/src/Makefile b/src/Makefile
index 4781736..7908f3c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -19,7 +19,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
 	bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \
 	stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \
 	seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \
-	renameat2 t_getcwd e4compact
+	renameat2 t_getcwd e4compact require-richacls
 
 SUBDIRS =
 
diff --git a/src/require-richacls.c b/src/require-richacls.c
new file mode 100644
index 0000000..dce984f
--- /dev/null
+++ b/src/require-richacls.c
@@ -0,0 +1,35 @@
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+#include <sys/types.h>
+#include <sys/xattr.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <libgen.h>
+
+int main(int argc, char *argv[])
+{
+	int ret;
+
+	ret = getxattr(".", "system.richacl", NULL, 0);
+	if (ret < 0 && errno != ENODATA) {
+		char cwd[PATH_MAX];
+
+		if (!getcwd(cwd, sizeof(cwd)))
+			strcpy(cwd, ".");
+		if (errno == ENOTSUP) {
+			printf("This test requires a filesystem with richacl "
+			       "support at %s\n",
+			       cwd);
+			return 77;
+		} else {
+			perror(cwd);
+			return 1;
+		}
+	}
+	return 0;
+}
diff --git a/tests/richacl/001-apply-masks b/tests/richacl/001-apply-masks
new file mode 120000
index 0000000..256bb2b
--- /dev/null
+++ b/tests/richacl/001-apply-masks
@@ -0,0 +1 @@
+apply-masks
\ No newline at end of file
diff --git a/tests/richacl/002-auto-inheritance b/tests/richacl/002-auto-inheritance
new file mode 120000
index 0000000..98472fc
--- /dev/null
+++ b/tests/richacl/002-auto-inheritance
@@ -0,0 +1 @@
+auto-inheritance
\ No newline at end of file
diff --git a/tests/richacl/003-basic b/tests/richacl/003-basic
new file mode 120000
index 0000000..ea5233d
--- /dev/null
+++ b/tests/richacl/003-basic
@@ -0,0 +1 @@
+basic
\ No newline at end of file
diff --git a/tests/richacl/004-chmod b/tests/richacl/004-chmod
new file mode 120000
index 0000000..8acd9e4
--- /dev/null
+++ b/tests/richacl/004-chmod
@@ -0,0 +1 @@
+chmod
\ No newline at end of file
diff --git a/tests/richacl/005-chown b/tests/richacl/005-chown
new file mode 120000
index 0000000..6fb0fcd
--- /dev/null
+++ b/tests/richacl/005-chown
@@ -0,0 +1 @@
+chown
\ No newline at end of file
diff --git a/tests/richacl/006-create b/tests/richacl/006-create
new file mode 120000
index 0000000..f4ab424
--- /dev/null
+++ b/tests/richacl/006-create
@@ -0,0 +1 @@
+create
\ No newline at end of file
diff --git a/tests/richacl/007-ctime b/tests/richacl/007-ctime
new file mode 120000
index 0000000..3ddadee
--- /dev/null
+++ b/tests/richacl/007-ctime
@@ -0,0 +1 @@
+ctime
\ No newline at end of file
diff --git a/tests/richacl/008-delete b/tests/richacl/008-delete
new file mode 120000
index 0000000..bbd98f4
--- /dev/null
+++ b/tests/richacl/008-delete
@@ -0,0 +1 @@
+delete
\ No newline at end of file
diff --git a/tests/richacl/009-setrichacl-modify b/tests/richacl/009-setrichacl-modify
new file mode 120000
index 0000000..e3ebe54
--- /dev/null
+++ b/tests/richacl/009-setrichacl-modify
@@ -0,0 +1 @@
+setrichacl-modify
\ No newline at end of file
diff --git a/tests/richacl/010-write-vs-append b/tests/richacl/010-write-vs-append
new file mode 120000
index 0000000..f19a074
--- /dev/null
+++ b/tests/richacl/010-write-vs-append
@@ -0,0 +1 @@
+write-vs-append
\ No newline at end of file
diff --git a/tests/richacl/Makefile b/tests/richacl/Makefile
new file mode 100644
index 0000000..46662c5
--- /dev/null
+++ b/tests/richacl/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2015  Red Hat, Inc.
+#
+
+# TOPDIR = ..
+# include $(TOPDIR)/include/builddefs
+#
+# TESTS = apply-masks basic chmod chown create delete setrichacl-modify \
+# 	write-vs-append ctime auto-inheritance
+#
+# LSRCFILES = test-lib.sh $(TESTS)
+#
+# default install install-dev install-lib:
+#
+# include $(BUILDRULES)
+
+#$(TARGETS):
+#	@echo "    [CC]    $@"
+#	$(Q)$(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
+
+#TESTS_ENVIRONMENT = \
+#	abs_top_builddir=$(abs_top_builddir); \
+#	export abs_top_builddir;
+#
+#
+#
+#
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/richacl
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(TARGET_DIR)
+	$(INSTALL) -m 755 [0-9]?? $(TESTS) $(TARGET_DIR)
+	$(INSTALL) -m 644 group $(TARGET_DIR)
+	#$(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+
+# Nothing.
+install-dev install-lib:
diff --git a/tests/richacl/apply-masks b/tests/richacl/apply-masks
new file mode 100755
index 0000000..7a99cf9
--- /dev/null
+++ b/tests/richacl/apply-masks
@@ -0,0 +1,163 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_richacls
+use_tmpdir
+
+ncheck "touch x"
+ncheck "setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+    group@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set 'everyone@:wp::allow owner@:r::allow group@:r::allow' x"
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+    group@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set 'everyone@:wp::deny owner@:rwp::allow group@:rwp::allow' x"
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+    group@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set 'owner@:rwCo::allow' x"
+check "getrichacl x" <<EOF
+x:
+ owner@:rw-------Co--::allow
+EOF
+
+ncheck "setrichacl --set 'owner@:rwpCo::allow' x"
+check "getrichacl x" <<EOF
+x:
+ owner@:rwp----------::allow
+EOF
+
+ncheck "chmod 644 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set '77:rwp::allow' x"
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+        77:rwp----------::allow
+    group@:r------------::deny
+ everyone@:r------------::allow
+EOF
+
+ncheck "chmod 644 x"
+check "getrichacl --numeric-ids x" <<EOF
+x:
+    owner@:rwp----------::allow
+        77:r------------::allow
+    group@:r------------::deny
+ everyone@:r------------::allow
+EOF
+
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+        77:rwp----------::allow
+    group@:r------------::deny
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set '77:rwp::allow everyone@:r::allow' x"
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+        77:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set '77:r::allow everyone@:rwp::allow' x"
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+        77:rwp----------::allow
+    owner@:rwp----------::allow
+    group@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set '77:wp::deny everyone@:rwp::allow' x"
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+        77:-wp----------::deny
+    group@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set '77:rwp::allow 77:wp::deny everyone@:rwp::allow' x"
+ncheck "chmod 664 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+        77:rwp----------::allow
+        77:-wp----------::deny
+    group@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+ncheck "setrichacl --set 'everyone@:rwp::allow' x"
+ncheck "chmod 066 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::deny
+ everyone@:rwp----------::allow
+EOF
+
+ncheck "chmod 006 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::deny
+    group@:rwp----------::deny
+ everyone@:rwp----------::allow
+EOF
+
+ncheck "chmod 606 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+    group@:rwp----------::deny
+ everyone@:rwp----------::allow
+EOF
+
+ncheck "setrichacl --set '77:rwp::allow everyone@:rwp::allow' x"
+ncheck "chmod 606 x"
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+    group@:rwp----------::deny
+ everyone@:rwp----------::allow
+EOF
+
+ncheck "chmod 646 x"
+check "getrichacl x" <<EOF
+x:
+        77:r------------::allow
+    owner@:rwp----------::allow
+    group@:-wp----------::deny
+        77:-wp----------::deny
+ everyone@:rwp----------::allow
+EOF
diff --git a/tests/richacl/auto-inheritance b/tests/richacl/auto-inheritance
new file mode 100755
index 0000000..7e40f0b
--- /dev/null
+++ b/tests/richacl/auto-inheritance
@@ -0,0 +1,191 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_richacls
+use_tmpdir
+
+umask 022
+
+ncheck "mkdir d1"
+ncheck "setrichacl --modify 101:rw:fd:deny d1"
+ncheck "setrichacl --modify 102:rw:f:deny d1"
+ncheck "setrichacl --modify 103:rw:d:deny d1"
+ncheck "setrichacl --modify 101:rw:fdig:deny d1"
+
+ncheck "setrichacl --modify flags:a d1"
+
+check "getrichacl --numeric --raw d1" <<EOF
+d1:
+     flags:a
+     owner:rwpxd-----------::mask
+     group:r--x------------::mask
+     other:r--x------------::mask
+       101:rw--------------:fd:deny
+       102:rw--------------:f:deny
+       103:rw--------------:d:deny
+       101:rw--------------:fdig:deny
+    owner@:rwpxd-----------::allow
+ everyone@:r--x------------::allow
+EOF
+
+ncheck "mkdir d1/d2"
+ncheck "touch d1/d3"
+
+# Mode bits derived from inherited ACEs
+check "getrichacl --numeric --raw d1/d2" <<EOF
+d1/d2:
+ flags:map
+ owner:----------------::mask
+ group:----------------::mask
+ other:----------------::mask
+   101:rw--------------:fda:deny
+   102:rw--------------:fia:deny
+   103:rw--------------:da:deny
+   101:rw--------------:fdiga:deny
+EOF
+
+check "getrichacl --numeric --raw d1/d3" <<EOF
+d1/d3:
+ flags:map
+ owner:----------------::mask
+ group:----------------::mask
+ other:----------------::mask
+   101:rw--------------:a:deny
+   102:rw--------------:a:deny
+   101:rw--------------:ga:deny
+EOF
+
+ncheck "mkdir d1/d2/d4"
+ncheck "touch d1/d2/d4/d5"
+
+# Protected files
+ncheck "mkdir d1/d6"
+ncheck "touch d1/d7"
+
+check "getrichacl --numeric --raw d1/d2/d4" <<EOF
+d1/d2/d4:
+ flags:map
+ owner:----------------::mask
+ group:----------------::mask
+ other:----------------::mask
+   101:rw--------------:fda:deny
+   102:rw--------------:fia:deny
+   103:rw--------------:da:deny
+   101:rw--------------:fdiga:deny
+EOF
+
+check "getrichacl --numeric --raw d1/d2/d4/d5" <<EOF
+d1/d2/d4/d5:
+ flags:map
+ owner:----------------::mask
+ group:----------------::mask
+ other:----------------::mask
+   101:rw--------------:a:deny
+   102:rw--------------:a:deny
+   101:rw--------------:ga:deny
+EOF
+
+# Clear protected flag from all the ACLs
+ncheck "setrichacl --modify flags:a d1/d2"
+ncheck "setrichacl --modify flags:a d1/d3"
+ncheck "setrichacl --modify flags:a d1/d2/d4"
+ncheck "setrichacl --modify flags:a d1/d2/d4/d5"
+
+ncheck "getrichacl --numeric d1 | sed -e 's/:fd:deny/:fd:allow/' > acl.txt"
+check "cat acl.txt" <<EOF
+d1:
+     flags:a
+       101:rw-----------:fd:allow
+       102:rw-----------:f:deny
+       103:rw-----------:d:deny
+       101:rw-----------:fdig:deny
+    owner@:rwpxd--------::allow
+ everyone@:r--x---------::allow
+EOF
+
+ncheck "setrichacl --set-file acl.txt d1"
+
+check "getrichacl --numeric --raw d1" <<EOF
+d1:
+     flags:a
+     owner:rwpxd-----------::mask
+     group:rw-x------------::mask
+     other:r--x------------::mask
+       101:rw--------------:fd:allow
+       102:rw--------------:f:deny
+       103:rw--------------:d:deny
+       101:rw--------------:fdig:deny
+    owner@:rwpxd-----------::allow
+ everyone@:r--x------------::allow
+EOF
+
+check "getrichacl --numeric --raw d1/d2" <<EOF
+d1/d2:
+ flags:a
+ owner:rw--------------::mask
+ group:rw--------------::mask
+ other:----------------::mask
+   101:rw--------------:fda:allow
+   102:rw--------------:fia:deny
+   103:rw--------------:da:deny
+   101:rw--------------:fdiga:deny
+EOF
+
+check "getrichacl --numeric --raw d1/d3" <<EOF
+d1/d3:
+ flags:a
+ owner:rw--------------::mask
+ group:rw--------------::mask
+ other:----------------::mask
+   101:rw--------------:a:allow
+   102:rw--------------:a:deny
+   101:rw--------------:ga:deny
+EOF
+
+check "getrichacl --numeric --raw d1/d2/d4" <<EOF
+d1/d2/d4:
+ flags:a
+ owner:rw--------------::mask
+ group:rw--------------::mask
+ other:----------------::mask
+   101:rw--------------:fda:allow
+   102:rw--------------:fia:deny
+   103:rw--------------:da:deny
+   101:rw--------------:fdiga:deny
+EOF
+
+check "getrichacl --numeric --raw d1/d2/d4/d5" <<EOF
+d1/d2/d4/d5:
+ flags:a
+ owner:rw--------------::mask
+ group:rw--------------::mask
+ other:----------------::mask
+   101:rw--------------:a:allow
+   102:rw--------------:a:deny
+   101:rw--------------:ga:deny
+EOF
+
+# No automatic inheritance for protected files
+check "getrichacl --numeric --raw d1/d6" <<EOF
+d1/d6:
+ flags:map
+ owner:----------------::mask
+ group:----------------::mask
+ other:----------------::mask
+   101:rw--------------:fda:deny
+   102:rw--------------:fia:deny
+   103:rw--------------:da:deny
+   101:rw--------------:fdiga:deny
+EOF
+
+check "getrichacl --numeric --raw d1/d7" <<EOF
+d1/d7:
+ flags:map
+ owner:----------------::mask
+ group:----------------::mask
+ other:----------------::mask
+   101:rw--------------:a:deny
+   102:rw--------------:a:deny
+   101:rw--------------:ga:deny
+EOF
diff --git a/tests/richacl/basic b/tests/richacl/basic
new file mode 100755
index 0000000..3c3d0e0
--- /dev/null
+++ b/tests/richacl/basic
@@ -0,0 +1,97 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_richacls
+require_getfattr
+use_tmpdir
+
+umask 022
+
+ncheck "touch x"
+ncheck "setrichacl --set 'everyone@:rwp::allow' x"
+check "ls -l x | sed -e 's/[. ].*//'" <<EOF
+-rw-rw-rw-
+EOF
+
+check "getrichacl x" <<EOF
+x:
+ everyone@:rwp----------::allow
+EOF
+
+ncheck 'chmod 664 x'
+check "ls -l x | sed -e 's/[. ].*//'" <<EOF
+-rw-rw-r--
+EOF
+
+check "getrichacl x" <<EOF
+x:
+    owner@:rwp----------::allow
+    group@:rwp----------::allow
+ everyone@:r------------::allow
+EOF
+
+# Note that unlike how the test cases look at first sight, we do *not* require
+# a richacl-enabled version of ls here ...
+
+ncheck "mkdir sub"
+ncheck "setrichacl --set 'everyone@:rwpxd:fd:allow' sub"
+check "ls -dl sub | sed -e 's/[.+ ].*/+/'" <<EOF
+drwxrwxrwx+
+EOF
+
+#check 'getfattr sub | grep -e system\.richacl' <<EOF
+check 'getfattr -m system\.richacl sub' <<EOF
+# file: sub
+system.richacl
+EOF
+
+ncheck "chmod 775 sub"
+check "ls -dl sub | sed -e 's/[.+ ].*/+/'" <<EOF
+drwxrwxr-x+
+EOF
+
+check 'getfattr -m system\.richacl sub' <<EOF
+# file: sub
+system.richacl
+EOF
+
+check "getrichacl sub" <<EOF
+sub:
+    owner@:rwpxd--------::allow
+    group@:rwpxd--------::allow
+ everyone@:rwpxd--------:fdi:allow
+ everyone@:r--x---------::allow
+EOF
+
+ncheck "touch sub/f"
+check "ls -l sub/f | sed -e 's/[. ].*//'" <<EOF
+-rw-rw-rw-
+EOF
+
+check "getrichacl sub/f" <<EOF
+sub/f:
+ everyone@:rwp----------::allow
+EOF
+
+ncheck "mkdir sub/sub2"
+check "ls -dl sub/sub2 | sed -e 's/[.+ ].*/+/'" <<EOF
+drwxrwxrwx+
+EOF
+
+check "getrichacl sub/sub2" <<EOF
+sub/sub2:
+ everyone@:rwpxd--------:fd:allow
+EOF
+
+ncheck "mkdir -m 750 sub/sub3"
+check "ls -dl sub/sub3 | sed -e 's/[.+ ].*/+/'" <<EOF
+drwxr-x---+
+EOF
+
+check "getrichacl sub/sub3" <<EOF
+sub/sub3:
+    owner@:rwpxd--------::allow
+    group@:r--x---------::allow
+ everyone@:rwpxd--------:fdi:allow
+EOF
diff --git a/tests/richacl/chmod b/tests/richacl/chmod
new file mode 100755
index 0000000..1b229f0
--- /dev/null
+++ b/tests/richacl/chmod
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_runas
+require_richacls
+use_tmpdir
+
+export LC_ALL=C
+
+# Create file as root
+ncheck "touch a"
+
+# We cannot set the acl as another user
+runas -u 99 -g 99
+check "setrichacl --set '99:rwc::allow' a || echo status: \$?" <<EOF
+a: Operation not permitted
+status: 1
+EOF
+
+# We cannot chmod as another user
+check "chmod 666 a || echo status: \$?" <<EOF
+chmod: changing permissions of 'a': Operation not permitted
+status: 1
+EOF
+
+# Give user 99 the write_acl permission
+runas
+ncheck "setrichacl --set '99:rwpC::allow' a"
+
+# Now user 99 can setrichacl and chmod ...
+runas -u 99 -g 99
+ncheck "setrichacl --set '99:rwpC::allow' a"
+ncheck "chmod 666 a"
+
+# ... but chmod disables the write_acl permission
+check "setrichacl --set '99:rwpC::allow' a || echo status: \$?" <<EOF
+a: Operation not permitted
+status: 1
+EOF
diff --git a/tests/richacl/chown b/tests/richacl/chown
new file mode 100755
index 0000000..2f1389e
--- /dev/null
+++ b/tests/richacl/chown
@@ -0,0 +1,42 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_runas
+require_richacls
+use_tmpdir
+
+export LC_ALL=C
+
+# Create file as root
+ncheck "touch a"
+
+# Chown and chgrp with no take ownership permission fails
+runas -u 99 -g 99
+check "chown 99 a || echo status: \$?" <<EOF
+chown: changing ownership of 'a': Operation not permitted
+status: 1
+EOF
+check "chgrp 99 a || echo status: \$?" <<EOF
+chgrp: changing group of 'a': Operation not permitted
+status: 1
+EOF
+
+# Add the take_ownership permission
+runas
+ncheck "setrichacl --set '99:rwpo::allow' a"
+
+# Chown and chgrp to a user or group the process is not in fails
+runas -u 99 -g 99
+check "chown 100 a || echo status: \$?" <<EOF
+chown: changing ownership of 'a': Operation not permitted
+status: 1
+EOF
+check "chgrp 100 a || echo status: \$?" <<EOF
+chgrp: changing group of 'a': Operation not permitted
+status: 1
+EOF
+
+# Chown and chgrp to a user and group the process is in succeeds
+ncheck "chown 99 a"
+ncheck "chgrp 99 a"
diff --git a/tests/richacl/create b/tests/richacl/create
new file mode 100755
index 0000000..d3d0b98
--- /dev/null
+++ b/tests/richacl/create
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_runas
+require_richacls
+use_tmpdir
+
+export LC_ALL=C
+
+# Create directories as root with different permissions
+ncheck "mkdir d1 d2 d3"
+ncheck "setrichacl --set '99:wx::allow' d2"
+ncheck "setrichacl --set '99:px::allow' d3"
+
+runas -u 99 -g 99
+
+# Cannot create files or directories without permissions
+check "touch d1/f || :" <<EOF
+touch: cannot touch 'd1/f': Permission denied
+EOF
+check "mkdir d1/d || :" <<EOF
+mkdir: cannot create directory 'd1/d': Permission denied
+EOF
+
+# Can create files with add_file (w) permission
+ncheck "touch d2/f"
+check "mkdir d2/d || :" <<EOF
+mkdir: cannot create directory 'd2/d': Permission denied
+EOF
+
+# Can create directories with add_subdirectory (p) permission
+check "touch d3/f || :" <<EOF
+touch: cannot touch 'd3/f': Permission denied
+EOF
+ncheck "mkdir d3/d"
diff --git a/tests/richacl/ctime b/tests/richacl/ctime
new file mode 100755
index 0000000..b737218
--- /dev/null
+++ b/tests/richacl/ctime
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_runas
+require_richacls
+use_tmpdir
+
+export LC_ALL=C
+
+ncheck "touch a"
+
+# Without write access, the ctime cannot be changed
+runas -u 99 -g 99
+check "touch a || :" <<EOF
+touch: cannot touch 'a': Permission denied
+EOF
+
+runas
+ncheck "setrichacl --set '99:rw::allow' a"
+
+# With write access, the ctime can be set to the current time, but not to
+# any other time
+runas -u 99 -g 99
+ncheck "touch a"
+check "touch -d '1 hour ago' a || :" <<EOF
+touch: setting times of 'a': Operation not permitted
+EOF
+
+runas
+ncheck "setrichacl --set '99:rwA::allow' a"
+
+# With set_attributes access, the ctime can be set to an arbitrary time
+runas -u 99 -g 99
+ncheck "touch -d '1 hour ago' a"
diff --git a/tests/richacl/delete b/tests/richacl/delete
new file mode 100755
index 0000000..ec4a50f
--- /dev/null
+++ b/tests/richacl/delete
@@ -0,0 +1,89 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_runas
+require_richacls
+use_tmpdir
+
+umask 022
+export LC_ALL=C
+
+ncheck "chmod go+w ."
+ncheck "mkdir d1 d2 d3 d4 d5 d6 d7"
+ncheck "touch d1/f d1/g d2/f d3/f d4/f d5/f d6/f d7/f d7/g d7/h"
+ncheck "chmod o+w d1/g"
+ncheck "chown 99 d2"
+ncheck "chgrp 99 d3"
+ncheck "chmod g+w d3"
+ncheck "setrichacl --set '99:wx::allow' d4"
+ncheck "setrichacl --set '99:d::allow' d5"
+ncheck "setrichacl --set '99:xd::allow' d6"
+ncheck "setrichacl --set '99:D::allow' d7/f d7/g d7/h"
+ncheck "chmod 664 d7/g"
+
+ncheck "mkdir s2 s3 s4 s5 s6 s7"
+ncheck "chmod +t s2 s3 s4 s5 s6 s7"
+ncheck "touch s2/f s3/f s4/f s5/f s6/f s7/f s7/g s7/h"
+ncheck "chown 99 s2"
+ncheck "chgrp 99 s3"
+ncheck "chmod g+w s3"
+ncheck "setrichacl --set '99:wx::allow' s4"
+ncheck "setrichacl --set '99:d::allow' s5"
+ncheck "setrichacl --set '99:xd::allow' s6"
+ncheck "setrichacl --set '99:D::allow' s7/f s7/g s7/h"
+ncheck "chmod 664 s7/g"
+
+runas -u 99 -g 99
+
+# Cannot delete files with no or only with write permissions on the directory
+check "rm -f d1/f d1/g || :" <<EOF
+rm: cannot remove 'd1/f': Permission denied
+rm: cannot remove 'd1/g': Permission denied
+EOF
+
+# Can delete files in directories we own
+ncheck "rm -f d2/f s2/f"
+
+# Can delete files in non-sticky directories we have write access to
+check "rm -f d3/f s3/f || :" <<EOF
+rm: cannot remove 's3/f': Operation not permitted
+EOF
+
+# "Write_data/execute" access does not include delete_child access, so deleting
+# is not allowed:
+check "rm -f d4/f s4/f || :" <<EOF
+rm: cannot remove 'd4/f': Permission denied
+rm: cannot remove 's4/f': Permission denied
+EOF
+
+# "Delete_child" access alone also is not sufficient
+check "rm -f d5/f s5/f || :" <<EOF
+rm: cannot remove 'd5/f': Permission denied
+rm: cannot remove 's5/f': Permission denied
+EOF
+
+# "Execute/delete_child" access is sufficient for non-sticky directories
+check "rm -f d6/f s6/f || :" <<EOF
+rm: cannot remove 's6/f': Operation not permitted
+EOF
+
+# "Delete" access on the child is sufficient, even in sticky directories.
+check "rm -f d7/f s7/f || :" <<EOF
+EOF
+
+# Regression: Delete access must not override add_file / add_subdirectory
+# access.
+ncheck "touch h"
+check "mv h d7/h || :" <<EOF
+mv: cannot move 'h' to 'd7/h': Permission denied
+EOF
+check "mv h s7/h || :" <<EOF
+mv: cannot move 'h' to 's7/h': Permission denied
+EOF
+
+# A chmod turns off the "delete" permission
+check "rm -f d7/g s7/g || :" <<EOF
+rm: cannot remove 'd7/g': Permission denied
+rm: cannot remove 's7/g': Permission denied
+EOF
diff --git a/tests/richacl/group b/tests/richacl/group
new file mode 100644
index 0000000..1fb29f5
--- /dev/null
+++ b/tests/richacl/group
@@ -0,0 +1,15 @@
+# QA groups control file
+# Defines test groups and nominal group owners
+# - do not start group names with a digit
+# - comment line before each group is "new" description
+#
+001-apply-masks richacl
+002-auto-inheritance richacl
+003-basic richacl
+004-chmod richacl
+005-chown richacl
+006-create richacl
+007-ctime richacl
+008-delete richacl
+009-setrichacl-modify richacl
+010-write-vs-append richacl
diff --git a/tests/richacl/setrichacl-modify b/tests/richacl/setrichacl-modify
new file mode 100755
index 0000000..1ff6ae4
--- /dev/null
+++ b/tests/richacl/setrichacl-modify
@@ -0,0 +1,57 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_richacls
+use_tmpdir
+
+umask 022
+
+ncheck "touch f"
+ncheck "setrichacl --set 'flags:a 101:w::deny 101:rw::allow 101:w:a:deny 101:rw:a:allow' f"
+ncheck "setrichacl --modify '202:w::deny' f"
+check "getrichacl --numeric f" <<EOF
+f:
+ flags:a
+   101:-w-----------::deny
+   202:-w-----------::deny
+   101:rw-----------::allow
+   101:-w-----------:a:deny
+   101:rw-----------:a:allow
+EOF
+
+ncheck "setrichacl --set 'flags:a 101:w::deny 101:rw::allow 101:w:a:deny 101:rw:a:allow' f"
+ncheck "setrichacl --modify '202:rw::allow' f"
+check "getrichacl --numeric f" <<EOF
+f:
+ flags:a
+   101:-w-----------::deny
+   101:rw-----------::allow
+   202:rw-----------::allow
+   101:-w-----------:a:deny
+   101:rw-----------:a:allow
+EOF
+
+ncheck "setrichacl --set 'flags:a 101:w::deny 101:rw::allow 101:w:a:deny 101:rw:a:allow' f"
+ncheck "setrichacl --modify '202:w:a:deny' f"
+check "getrichacl --numeric f" <<EOF
+f:
+ flags:a
+   101:-w-----------::deny
+   101:rw-----------::allow
+   101:-w-----------:a:deny
+   202:-w-----------:a:deny
+   101:rw-----------:a:allow
+EOF
+
+ncheck "setrichacl --set 'flags:a 101:w::deny 101:rw::allow 101:w:a:deny 101:rw:a:allow' f"
+ncheck "setrichacl --modify ' 202:rw:a:allow' f"
+check "getrichacl --numeric f" <<EOF
+f:
+ flags:a
+   101:-w-----------::deny
+   101:rw-----------::allow
+   101:-w-----------:a:deny
+   101:rw-----------:a:allow
+   202:rw-----------:a:allow
+EOF
diff --git a/tests/richacl/test-lib.sh b/tests/richacl/test-lib.sh
new file mode 100644
index 0000000..4f264f4
--- /dev/null
+++ b/tests/richacl/test-lib.sh
@@ -0,0 +1,149 @@
+# Library for simple test scripts
+# Copyright (C) 2009, 2011-2013 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# in any medium, are permitted without royalty provided the copyright
+# notice and this notice are preserved.
+
+use_tmpdir() {
+    tmpdir=$PWD/tmp.$$
+    mkdir "$tmpdir" && cd "$tmpdir" || exit 2
+}
+
+require_runas() {
+    if ! $here/src/runas -u 99 -g 99 true ; then
+	echo "This test must be run as root" >&2
+	exit 77
+    fi
+}
+
+require_richacls() {
+    $here/src/require-richacls || exit $?
+    if ! type -f getrichacl setrichacl > /dev/null; then
+	echo "This test requires the getrichacl and setrichacl utilities" >&2
+	exit 77
+    fi
+}
+
+require_getfattr() {
+    if ! type -f getfattr > /dev/null ; then
+	echo "This test requires the getfattr utility" >&2
+	exit 77
+    fi
+}
+
+_RUNAS=
+runas() {
+    _start_test -1 runas "$*"
+    if [ $# = 0 ]; then
+	_RUNAS=
+    else
+	_RUNAS="$here/src/runas $* --"
+    fi
+    echo "ok"
+}
+
+if diff -u -L expected -L got /dev/null /dev/null 2> /dev/null; then
+    eval '_compare() {
+	diff -u -L expected -L got "$1" "$2"
+    }'
+else
+    eval '_compare() {
+	echo "expected:"
+	cat "$1"
+	echo "got:"
+	cat "$2"
+    }'
+fi
+
+_check() {
+    local frame=$1
+    shift
+    _start_test "$frame" "$*"
+    expected=`cat`
+    if got=`set +x; eval "$_RUNAS $*" 3>&2 </dev/null 2>&1` && \
+            test "$expected" = "$got" ; then
+	echo "ok"
+	checks_succeeded="$checks_succeeded + 1"
+    else
+	echo "FAILED"
+	if test "$expected" != "$got" ; then
+	    echo "$expected" > expected~
+	    echo "$got" > got~
+	    _compare expected~ got~
+	    rm -f expected~ got~
+	fi
+	checks_failed="$checks_failed + 1"
+    fi
+}
+
+check() {
+    _check 0 "$@"
+}
+
+ncheck() {
+    _check 0 "$@" < /dev/null
+}
+
+parent_check() {
+    _check 1 "$@"
+}
+
+parent_ncheck() {
+    _check 1 "$@" < /dev/null
+}
+
+cleanup() {
+    status=$?
+    checks_succeeded=`expr $checks_succeeded`
+    checks_failed=`expr $checks_failed`
+    checks_total=`expr $checks_succeeded + $checks_failed`
+    if test $checks_total -gt 0 ; then
+	if test $checks_failed -gt 0 && test $status -eq 0 ; then
+	    status=1
+	fi
+	echo "$checks_total tests ($checks_succeeded passed," \
+	     "$checks_failed failed)"
+    fi
+    if test -n "$tmpdir" ; then
+	chmod -R u+rwx "$tmpdir" 2>/dev/null
+	cd / && rm -rf "$tmpdir"
+    fi
+    exit $status
+}
+
+if test -z "`echo -n`"; then
+    if eval 'test -n "${BASH_LINENO[0]}" 2>/dev/null'; then
+	eval '
+	    _start_test() {
+		local frame=$1
+		shift
+		printf "[${BASH_LINENO[2+frame]}] $* -- "
+	    }'
+    else
+	eval '
+	    _start_test() {
+		shift
+		printf "* $* -- "
+	    }'
+    fi
+else
+    eval '
+	_start_test() {
+	    shift
+	    printf "* $*\\n"
+	}'
+fi
+
+if ! type cat > /dev/null 2> /dev/null; then
+    echo "This test requires the cat utility" >&2
+    exit 77
+fi
+
+export PATH=$here/src:$PATH
+
+[ -z "$TEST_DIR" ] || cd "$TEST_DIR"
+
+checks_succeeded=0
+checks_failed=0
+trap cleanup 0
diff --git a/tests/richacl/write-vs-append b/tests/richacl/write-vs-append
new file mode 100755
index 0000000..4528f3a
--- /dev/null
+++ b/tests/richacl/write-vs-append
@@ -0,0 +1,54 @@
+#! /bin/sh
+
+. ${0%/*}/test-lib.sh
+
+require_runas
+require_richacls
+use_tmpdir
+
+export LC_ALL=C
+
+ncheck "touch a b c d e f"
+ncheck "setrichacl --set 'owner@:rwp::allow' a"
+ncheck "setrichacl --set 'owner@:rwp::allow 99:w::allow' b"
+ncheck "setrichacl --set 'owner@:rwp::allow 99:p::allow' c"
+ncheck "setrichacl --set 'owner@:rwp::allow 99:wp::allow' d"
+ncheck "setrichacl --set '99:a::deny owner@:rwp::allow 99:w::allow' e"
+ncheck "setrichacl --set '99:w::deny owner@:rwp::allow 99:p::allow' f"
+
+runas -u 99 -g 99
+check "sh -c 'echo a > a' || :" <<EOF
+sh: a: Permission denied
+EOF
+ncheck "sh -c 'echo b > b' || :"
+check "sh -c 'echo c > c' || :" <<EOF
+sh: c: Permission denied
+EOF
+ncheck "sh -c 'echo d > d' || :"
+ncheck "sh -c 'echo e > e' || :"
+check "sh -c 'echo f > f' || :" <<EOF
+sh: f: Permission denied
+EOF
+
+check "sh -c 'echo A >> a' || :" <<EOF
+sh: a: Permission denied
+EOF
+check "sh -c 'echo B >> b' || :" <<EOF
+sh: b: Permission denied
+EOF
+ncheck "sh -c 'echo C >> c' || :"
+ncheck "sh -c 'echo D >> d' || :"
+check "sh -c 'echo E >> e' || :" <<EOF
+sh: e: Permission denied
+EOF
+ncheck "sh -c 'echo F >> f' || :"
+
+runas
+check "cat a b c d e f" <<EOF
+b
+C
+d
+D
+e
+F
+EOF
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [XFSTESTS 6/6] Remove the obsolete nfs4acl tests
  2015-11-18 14:17 [XFSTESTS 0/6] Richacl Tests Andreas Gruenbacher
                   ` (4 preceding siblings ...)
  2015-11-18 14:17 ` [XFSTESTS 5/6] Add richacl tests Andreas Gruenbacher
@ 2015-11-18 14:17 ` Andreas Gruenbacher
  5 siblings, 0 replies; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-11-18 14:17 UTC (permalink / raw)
  To: xfs; +Cc: Andreas Gruenbacher

The nfs4acl tests don't make sense anymore as they have been obsoleted
by richacls.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 nfs4acl/Makefile             |  29 ----
 nfs4acl/apply-mask.test      | 143 -------------------
 nfs4acl/basic.test           |  70 ----------
 nfs4acl/chmod.test           |  31 -----
 nfs4acl/chown.test           |  63 ---------
 nfs4acl/computed-mode.test   |  62 ---------
 nfs4acl/create.test          |  35 -----
 nfs4acl/ctime.test           |  36 -----
 nfs4acl/delete.test          |  77 ----------
 nfs4acl/run                  | 298 ---------------------------------------
 nfs4acl/unrepresentable.test |  20 ---
 nfs4acl/write-vs-append.test |  46 ------
 tests/xfs/191                |  75 ----------
 tests/xfs/191.out            | 324 -------------------------------------------
 tests/xfs/group              |   1 -
 15 files changed, 1310 deletions(-)
 delete mode 100644 nfs4acl/Makefile
 delete mode 100644 nfs4acl/apply-mask.test
 delete mode 100644 nfs4acl/basic.test
 delete mode 100644 nfs4acl/chmod.test
 delete mode 100644 nfs4acl/chown.test
 delete mode 100644 nfs4acl/computed-mode.test
 delete mode 100644 nfs4acl/create.test
 delete mode 100644 nfs4acl/ctime.test
 delete mode 100644 nfs4acl/delete.test
 delete mode 100755 nfs4acl/run
 delete mode 100644 nfs4acl/unrepresentable.test
 delete mode 100644 nfs4acl/write-vs-append.test
 delete mode 100755 tests/xfs/191
 delete mode 100644 tests/xfs/191.out

diff --git a/nfs4acl/Makefile b/nfs4acl/Makefile
deleted file mode 100644
index 42313f3..0000000
--- a/nfs4acl/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-#-----------------------------------------------------------------------
-# Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-#-----------------------------------------------------------------------
-
-TOPDIR = ..
-include $(TOPDIR)/include/builddefs
-
-LSRCFILES = run \
-	    apply-mask.test chmod.test computed-mode.test ctime.test \
-	    unrepresentable.test basic.test chown.test create.test \
-	    delete.test write-vs-append.test
-
-include $(BUILDRULES)
-
-default install install-dev install-lib:
diff --git a/nfs4acl/apply-mask.test b/nfs4acl/apply-mask.test
deleted file mode 100644
index 9b9483a..0000000
--- a/nfs4acl/apply-mask.test
+++ /dev/null
@@ -1,143 +0,0 @@
-$ rm -rf d
-$ mkdir d
-$ cd d
-
-$ touch x
-
-$ nfs4acl --set 'owner@:rw::allow group@:rw::allow everyone@:r::allow' x
-$ nfs4acl --get x
-> x:
-> owner@:rw::allow
-> group@:rw::allow
-> everyone@:r::allow
->
-
-$ nfs4acl --set 'everyone@:w::allow owner@:r::allow group@:r::allow' x
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> owner@:rw::allow
-> group@:rw::allow
->
-
-$ nfs4acl --set 'everyone@:w::deny owner@:rw::allow group@:rw::allow' x
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> owner@:r::allow
-> group@:r::allow
->
-
-$ nfs4acl --set 'owner@:rwmo::allow' x
-$ nfs4acl --get x
-> x:
-> owner@:rwmo::allow
->
-
-$ chmod 644 x
-$ nfs4acl --get x
-> x:
-> owner@:rw::allow
->
-
-$ nfs4acl --set 'root:rw::allow' x
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> root:rw::allow
->
-
-$ chmod 644 x
-$ nfs4acl --get x
-> x:
-> root:r::allow
->
-
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> root:rw::allow
->
-
-$ nfs4acl --set 'root:rw::allow everyone@:r::allow' x
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> root:rw::allow
-> everyone@:r::allow
->
-
-$ nfs4acl --set 'root:r::allow everyone@:rw::allow' x
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> root:rw::allow
-> owner@:rw::allow
-> group@:rw::allow
-> everyone@:r::allow
->
-
-$ nfs4acl --set 'root:w::deny everyone@:rw::allow' x
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> root:w::deny
-> owner@:rw::allow
-> group@:rw::allow
-> root:r::allow
-> everyone@:r::allow
->
-
-$ nfs4acl --set 'root:rw::allow root:w::deny everyone@:rw::allow' x
-$ chmod 664 x
-$ nfs4acl --get x
-> x:
-> root:rw::allow
-> root:w::deny
-> owner@:rw::allow
-> group@:rw::allow
-> everyone@:r::allow
->
-
-$ nfs4acl --set 'everyone@:rw::allow' x
-$ chmod 066 x
-$ nfs4acl --get x
-> x:
-> owner@:rw::deny
-> everyone@:rw::allow
-> 
-
-$ chmod 006 x
-$ nfs4acl --get x
-> x:
-> owner@:rw::deny
-> group@:rw::deny
-> everyone@:rw::allow
-> 
-
-$ chmod 606 x
-$ nfs4acl --get x
-> x:
-> group@:rw::deny
-> everyone@:rw::allow
-> 
-
-$ nfs4acl --set 'root:rw::allow everyone@:rw::allow' x
-$ chmod 606 x
-$ nfs4acl --get x
-> x:
-> group@:rw::deny
-> everyone@:rw::allow
-> 
-
-$ chmod 646 x
-$ nfs4acl --get x
-> x:
-> root:r::allow
-> group@:w::deny
-> root:w::deny
-> everyone@:rw::allow
-> 
-
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/basic.test b/nfs4acl/basic.test
deleted file mode 100644
index 1ae2896..0000000
--- a/nfs4acl/basic.test
+++ /dev/null
@@ -1,70 +0,0 @@
-$ rm -rf d
-$ mkdir d
-$ cd d
-
-$ chown bin .
-$ su bin
-
-$ touch x
-$ nfs4acl --set 'everyone@:rw::allow' x
-$ ls -l x | cut -d ' ' -f 1
-> -rw-rw-rw-
-
-$ nfs4acl --get x
-> x:
-> everyone@:rw::allow
->
-
-$ chmod 664 x
-$ ls -l x | cut -d ' ' -f 1
-> -rw-rw-r--
-
-$ nfs4acl --get x
-> x:
-> owner@:rw::allow
-> group@:rw::allow
-> everyone@:r::allow
->
-
-$ mkdir sub 
-$ nfs4acl --set 'everyone@:rwax:fd:allow' sub
-$ ls -dl sub | cut -d ' ' -f 1
-> drwxrwxrwx
-
-$ nfs4acl --get sub
-> sub:
-> everyone@:rwax:fd:allow
->
-
-$ chmod 775 sub
-$ ls -dl sub | cut -d ' ' -f 1
-> drwxrwxr-x
-$ nfs4acl --get sub
-> sub:
-> owner@:rwax::allow
-> group@:rwax::allow
-> everyone@:rwax:fdi:allow
-> everyone@:rx::allow
->
-
-$ touch sub/f
-$ ls -l sub/f | cut -d ' ' -f 1
-> -rw-rw-rw-
-
-$ nfs4acl --get sub/f
-> sub/f:
-> everyone@:rwa::allow
->
-
-$ mkdir sub/sub2
-$ ls -dl sub/sub2 | cut -d ' ' -f 1
-> drwxrwxrwx
-
-$ nfs4acl --get sub/sub2
-> sub/sub2:
-> everyone@:rwax:fd:allow
->
-
-$ su
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/chmod.test b/nfs4acl/chmod.test
deleted file mode 100644
index f4238b0..0000000
--- a/nfs4acl/chmod.test
+++ /dev/null
@@ -1,31 +0,0 @@
-$ mkdir d
-$ cd d
-
-$ whoami
-> root
-
-$ touch a
-	
-Neet to have write_acl permission to chmod or set the acl:
-	$ su bin
-	$ chmod 666 a
-	> chmod: changing permissions of `a': Operation not permitted
-	$ nfs4acl --set 'bin:rwM::allow' a
-	> a: Operation not permitted
-	
-$ su
-$ nfs4acl --set 'bin:rwm::allow' a
-	
-Can set the acl now:
-	$ su bin
-	$ nfs4acl --set 'bin:rwm::allow' a
-	
-A chmod limits the permissions to the specified mode, which always disables
-write_acl:
-	$ chmod 666 a
-	$ nfs4acl --set 'bin:rwm::allow' a
-	> a: Operation not permitted
-
-$ su
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/chown.test b/nfs4acl/chown.test
deleted file mode 100644
index df29bf4..0000000
--- a/nfs4acl/chown.test
+++ /dev/null
@@ -1,63 +0,0 @@
-$ mkdir d
-$ cd d
-
-$ whoami
-> root
-
-$ id -Gn daemon
-> daemon bin
-
-$ touch a
-
-Chown and chgrp with no take ownership permission fails:
-	$ su daemon
-	$ chown daemon a
-	> chown: changing ownership of `a': Operation not permitted
-	$ chgrp daemon a
-	> chgrp: changing group of `a': Operation not permitted
-	$ nfs4acl --set 'daemon:rwo::allow' a
-	> a: Operation not permitted
-
-Add the take_ownership permission. This is reflected in the file masks; the
-file mode cannot show this though:
-	$ su
-	$ nfs4acl --set 'daemon:rwo::allow' a
-
-Chown and chgrp to an arbitrary other user or group fails:
-	$ su daemon
-	$ chown root a
-	> chown: changing ownership of `a': Operation not permitted
-	$ chgrp root a
-	> chgrp: changing group of `a': Operation not permitted
-
-Changing the mode makes that an upper bound of the permissions granted, even
-when the file mode stays the same:
-	$ su
-	$ ls -l a | cut -d ' ' -f1
-	> -rw-rw----
-	$ chmod 660 a
-
-Chown and chgrp to the same user or a group the process is in now fails
-because the masks now do not grant change_ownership access:
-	$ su daemon
-	$ chown daemon a
-	> chown: changing ownership of `a': Operation not permitted
-	$ chgrp daemon a
-	> chgrp: changing group of `a': Operation not permitted
-	$ chgrp bin a
-	> chgrp: changing group of `a': Operation not permitted
-
-Add back change_ownership:
-	$ su
-	$ nfs4acl --set 'daemon:rwo::allow' a
-
-Now, chgrp to one of the groups the process is in and chown to the same user
-succeeds:
-	$ su daemon
-	$ chgrp daemon a
-	$ chgrp bin a
-	$ chown daemon a
-
-$ su
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/computed-mode.test b/nfs4acl/computed-mode.test
deleted file mode 100644
index baa68d6..0000000
--- a/nfs4acl/computed-mode.test
+++ /dev/null
@@ -1,62 +0,0 @@
-$ rm -rf d
-$ mkdir d
-$ cd d
-
-$ mkdir e
-
-$ nfs4acl --set 'owner@:rwx:f:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -rw-------
-$ rm e/f
-
-$ nfs4acl --set 'group@:rwx:f:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -rw-rw----
-$ rm e/f
-
-$ nfs4acl --set 'everyone@:rwx:f:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -rw-rw-rw-
-$ rm e/f
-
-$ nfs4acl --set 'owner@:rwx:f:allow root:rx:f:deny root:rx:f:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -rw-------
-$ rm e/f
-
-$ nfs4acl --set 'owner@:rwx::allow everyone@:w:fi:deny everyone@:rwx:fi:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -r--r--r--
-$ rm e/f
-
-$ nfs4acl --set 'owner@:rwx::allow root:rx:fi:deny root:rx:fi:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> ----------
-$ rm e/f
-
-$ nfs4acl --set 'owner@:rx:fi:allow group@:rwx:fi:deny everyone@:rwx:f:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -rw----rw-
-$ rm e/f
-
-$ nfs4acl --set 'owner@:rx:fi:allow root:rwx:fi:deny everyone@:rwx:f:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -rw-rw-rw-
-$ rm e/f
-
-$ nfs4acl --set 'everyone@:w:fi:deny root:rx:fi:allow everyone@:rwx:f:allow' e
-$ touch e/f
-$ ls -l e/f | cut -d ' ' -f 1
-> -r--r--r--
-$ rm e/f
-
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/create.test b/nfs4acl/create.test
deleted file mode 100644
index e140f4b..0000000
--- a/nfs4acl/create.test
+++ /dev/null
@@ -1,35 +0,0 @@
-$ mkdir d
-$ cd d
-
-$ whoami
-> root
-
-$ mkdir d1 d2 d3 d4
-$ nfs4acl --set 'daemon:wx::allow' d2
-$ nfs4acl --set 'daemon:ax::allow' d3
-$ nfs4acl --set 'daemon:wax::allow' d4
-
-$ su daemon
-
-Cannot create files or directories without permissions:
-	$ touch d1/f
-	> touch: cannot touch `d1/f': Permission denied
-	$ mkdir d1/d
-	> mkdir: cannot create directory `d1/d': Permission denied
-
-Can create files with add_file (w) permission:
-	$ touch d2/f
-	$ mkdir d2/d
-	> mkdir: cannot create directory `d2/d': Permission denied
-
-Can create directories with add_subdirectory (p) permission:
-	$ touch d3/f
-	> touch: cannot touch `d3/f': Permission denied
-	$ mkdir d3/d
-
-Both permissions at the same time:
-	$ touch d4/f
-	$ mkdir d4/d
-$ su
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/ctime.test b/nfs4acl/ctime.test
deleted file mode 100644
index 614d79b..0000000
--- a/nfs4acl/ctime.test
+++ /dev/null
@@ -1,36 +0,0 @@
-$ mkdir d
-$ cd d
-
-$ whoami
-> root
-
-$ touch a b
-$ sleep 1
-
-Without write access, the ctime cannot be changed.
-	$ su bin
-	$ touch a
-	> touch: cannot touch `a': Permission denied
-
-With write access, the ctime can be set to the current time, but not to
-any other time:
-	$ su
-	$ nfs4acl --set 'bin:rw::allow' a
-
-	$ su bin
-	$ touch a
-	$ [ b -ot a ] || echo 'b should be older than a'
-	$ touch -r b a
-	> touch: setting times of `a': Operation not permitted
-
-With set_attributes access, the ctime can be set to an arbitrary time:
-	$ su
-	$ nfs4acl --set 'bin:rwt::allow' a
-
-	$ su bin
-	$ touch -r b a
-	$ [ b -ot a -o a -ot b ] && echo 'a should be as old as b'
-
-$ su
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/delete.test b/nfs4acl/delete.test
deleted file mode 100644
index 9c5f24f..0000000
--- a/nfs4acl/delete.test
+++ /dev/null
@@ -1,77 +0,0 @@
-$ mkdir d
-$ cd d
-
-$ whoami
-> root
-
-$ id -Gn daemon
-> daemon bin
-
-$ mkdir n1
-$ touch n1/f
-
-$ mkdir d2 d3 d4 d5 d6 d7
-$ touch d2/f d3/f d4/f d5/f d6/f d7/f d7/g
-$ chown daemon d2
-$ chgrp bin d3
-$ chmod g+w d3
-$ nfs4acl --set 'daemon:wx::allow' d4
-$ nfs4acl --set 'daemon:d::allow' d5
-$ nfs4acl --set 'daemon:xd::allow' d6
-$ nfs4acl --set 'daemon:D::allow' d7/f d7/g
-$ chmod 664 d7/g
-
-$ mkdir s2 s3 s4 s5 s6 s7
-$ chmod +t s2 s3 s4 s5 s6 s7
-$ touch s2/f s3/f s4/f s5/f s6/f s7/f s7/g
-$ chown daemon s2
-$ chgrp bin s3
-$ chmod g+w s3
-$ nfs4acl --set 'daemon:wx::allow' s4
-$ nfs4acl --set 'daemon:d::allow' s5
-$ nfs4acl --set 'daemon:xd::allow' s6
-$ nfs4acl --set 'daemon:D::allow' s7/f
-$ nfs4acl --set 'daemon:D::allow' s7/g s7/g
-$ chmod 664 s7/g
-
-$ su daemon
-
-Cannot delete files without permissions:
-	$ rm n1/f
-	> rm: cannot remove `n1/f': Permission denied
-
-Can delete files we own:
-	$ rm d2/f s2/f
-
-Cannot delete files where we are in the owning group in a non-sticky directory,
-but not in a sticky one:
-	$ rm d3/f s3/f
-	> rm: cannot remove `s3/f': Operation not permitted
-
-"Write_data/execute" access does not include delete_child access, and so this
-is not enough for deleting:
-	$ rm d4/f s4/f
-	> rm: cannot remove `d4/f': Permission denied
-	> rm: cannot remove `s4/f': Permission denied
-
-"Delete_child" access alone also is not sufficient:
-	$ rm d5/f s5/f
-	> rm: cannot remove `d5/f': Permission denied
-	> rm: cannot remove `s5/f': Permission denied
-
-"Execute/delete_child" on the directory does allow that, though, but only in
-a non-sticky directory:
-	$ rm d6/f s6/f
-	> rm: cannot remove `s6/f': Operation not permitted
-
-"Delete" on the child itself overrides the sticky check as well:
-	$ rm d7/f s7/f
-
-But Delete is not a subset of POSIX read/write, so chmod turns it off:
-	$ rm d7/g s7/g
-	> rm: cannot remove `d7/g': Permission denied
-	> rm: cannot remove `s7/g': Permission denied
-
-$ su
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/run b/nfs4acl/run
deleted file mode 100755
index 360739e..0000000
--- a/nfs4acl/run
+++ /dev/null
@@ -1,298 +0,0 @@
-#!/usr/bin/perl -w -U
-
-#
-# Possible improvements:
-#
-# - distinguish stdout and stderr output
-# - add environment variable like assignments
-# - run up to a specific line
-# - resume at a specific line
-#
-
-use strict;
-use FileHandle;
-use Getopt::Std;
-use POSIX qw(isatty setuid getcwd);
-use vars qw($opt_l $opt_v);
-
-no warnings qw(taint);
-
-$opt_l = ~0;  # a really huge number
-getopts('l:v');
-
-my ($OK, $FAILED) = ("ok", "failed");
-if (isatty(fileno(STDOUT))) {
-	$OK = "\033[32m" . $OK . "\033[m";
-	$FAILED = "\033[31m\033[1m" . $FAILED . "\033[m";
-}
-
-sub exec_test($$);
-sub process_test($$$$);
-
-my ($prog, $in, $out) = ([], [], []);
-my $prog_line = 0;
-my ($tests, $failed) = (0,0);
-my $lineno;
-my $width = ($ENV{COLUMNS} || 80) >> 1;
-
-for (;;) {
-  my $line = <>; $lineno++;
-  if (defined $line) {
-    # Substitute %VAR and %{VAR} with environment variables.
-    $line =~ s[%(\w+)][$ENV{$1}]eg;
-    $line =~ s[%{(\w+)}][$ENV{$1}]eg;
-  }
-  if (defined $line) {
-    if ($line =~ s/^\s*< ?//) {
-      push @$in, $line;
-    } elsif ($line =~ s/^\s*> ?//) {
-      push @$out, $line;
-    } else {
-      process_test($prog, $prog_line, $in, $out);
-      last if $prog_line >= $opt_l;
-
-      $prog = [];
-      $prog_line = 0;
-    }
-    if ($line =~ s/^\s*\$ ?//) {
-      $line =~ s/\s+#.*//;  # remove comments here...
-      $prog = [ map { s/\\(.)/$1/g; $_ } split /(?<!\\)\s+/, $line ];
-      $prog_line = $lineno;
-      $in = [];
-      $out = [];
-    }
-  } else {
-    process_test($prog, $prog_line, $in, $out);
-    last;
-  }
-}
-
-my $status = sprintf("%d commands (%d passed, %d failed)",
-	$tests, $tests-$failed, $failed);
-if (isatty(fileno(STDOUT))) {
-	if ($failed) {
-		$status = "\033[31m\033[1m" . $status . "\033[m";
-	} else {
-		$status = "\033[32m" . $status . "\033[m";
-	}
-}
-print $status, "\n";
-exit $failed ? 1 : 0;
-
-
-sub process_test($$$$) {
-  my ($prog, $prog_line, $in, $out) = @_;
-
-  return unless @$prog;
-
-       my $p = [ @$prog ];
-       print "[$prog_line] \$ ", join(' ',
-             map { s/\s/\\$&/g; $_ } @$p), " -- ";
-       my $result = exec_test($prog, $in);
-       my @good = ();
-       my $nmax = (@$out > @$result) ? @$out : @$result;
-       for (my $n=0; $n < $nmax; $n++) {
-	   my $use_re;
-	   if (defined $out->[$n] && $out->[$n] =~ /^~ /) {
-		$use_re = 1;
-		$out->[$n] =~ s/^~ //g;
-	   }
-
-           if (!defined($out->[$n]) || !defined($result->[$n]) ||
-               (!$use_re && $result->[$n] ne $out->[$n]) ||
-               ( $use_re && $result->[$n] !~ /^$out->[$n]/)) {
-               push @good, ($use_re ? '!~' : '!=');
-	   }
-	   else {
-               push @good, ($use_re ? '=~' : '==');
-           }
-       }
-       my $good = !(grep /!/, @good);
-       $tests++;
-       $failed++ unless $good;
-       print $good ? $OK : $FAILED, "\n";
-       if (!$good || $opt_v) {
-         for (my $n=0; $n < $nmax; $n++) {
-	   my $l = defined($out->[$n]) ? $out->[$n] : "~";
-	   chomp $l;
-	   my $r = defined($result->[$n]) ? $result->[$n] : "~";
-	   chomp $r;
-	   print sprintf("%-" . ($width-3) . "s %s %s\n",
-			 $r, $good[$n], $l);
-         }
-       }
-}
-
-
-sub su($) {
-  my ($user) = @_;
-
-  $user ||= "root";
-
-  my ($login, $pass, $uid, $gid) = getpwnam($user)
-    or return [ "su: user $user does not exist\n" ];
-  my @groups = ();
-  my $fh = new FileHandle("/etc/group")
-    or return [ "opening /etc/group: $!\n" ];
-  while (<$fh>) {
-    chomp;
-    my ($group, $passwd, $gid, $users) = split /:/;
-    foreach my $u (split /,/, $users) {
-      push @groups, $gid
-	if ($user eq $u);
-    }
-  }
-  $fh->close;
-
-  my $groups = join(" ", ($gid, $gid, @groups));
-  #print STDERR "[[$groups]]\n";
-  $! = 0;  # reset errno
-  $> = 0;
-  $( = $gid;
-  $) = $groups;
-  if ($!) {
-    return [ "su: $!\n" ];
-  }
-  if ($uid != 0) {
-    $> = $uid;
-    #$< = $uid;
-    if ($!) {
-      return [ "su: $prog->[1]: $!\n" ];
-    }
-  }
-  #print STDERR "[($>,$<)($(,$))]";
-  return [];
-}
-
-
-sub sg($) {
-  my ($group) = @_;
-
-  my $gid = getgrnam($group)
-    or return [ "sg: group $group does not exist\n" ];
-  my %groups = map { $_ eq $gid ? () : ($_ => 1) } (split /\s/, $));
-  
-  #print STDERR "<<", join("/", keys %groups), ">>\n";
-  my $groups = join(" ", ($gid, $gid, keys %groups));
-  #print STDERR "[[$groups]]\n";
-  $! = 0;  # reset errno
-  if ($> != 0) {
-	  my $uid = $>;
-	  $> = 0;
-	  $( = $gid;
-	  $) = $groups;
-	  $> = $uid;
-  } else {
-	  $( = $gid;
-	  $) = $groups;
-  }
-  if ($!) {
-    return [ "sg: $!\n" ];
-  }
-  print STDERR "[($>,$<)($(,$))]";
-  return [];
-}
-
-
-sub exec_test($$) {
-  my ($prog, $in) = @_;
-  local (*IN, *IN_DUP, *IN2, *OUT_DUP, *OUT, *OUT2);
-  my $needs_shell = (join('', @$prog) =~ /[][|<>"'`\$\*\?]/);
-
-  if ($prog->[0] eq "umask") {
-    umask oct $prog->[1];
-    return [];
-  } elsif ($prog->[0] eq "cd") {
-    if (!chdir $prog->[1]) {
-      return [ "chdir: $prog->[1]: $!\n" ];
-    }
-    $ENV{PWD} = getcwd;
-    return [];
-  } elsif ($prog->[0] eq "su") {
-    return su($prog->[1]);
-  } elsif ($prog->[0] eq "sg") {
-    return sg($prog->[1]);
-  } elsif ($prog->[0] eq "export") {
-    my ($name, $value) = split /=/, $prog->[1];
-    # FIXME: need to evaluate $value, so that things like this will work:
-    # export dir=$PWD/dir
-    $ENV{$name} = $value;
-    return [];
-  } elsif ($prog->[0] eq "unset") {
-    delete $ENV{$prog->[1]};
-    return [];
-  }
-
-  pipe *IN2, *OUT
-    or die "Can't create pipe for reading: $!";
-  open *IN_DUP, "<&STDIN"
-    or *IN_DUP = undef;
-  open *STDIN, "<&IN2"
-    or die "Can't duplicate pipe for reading: $!";
-  close *IN2;
-
-  open *OUT_DUP, ">&STDOUT"
-    or die "Can't duplicate STDOUT: $!";
-  pipe *IN, *OUT2
-    or die "Can't create pipe for writing: $!";
-  open *STDOUT, ">&OUT2"
-    or die "Can't duplicate pipe for writing: $!";
-  close *OUT2;
-
-  *STDOUT->autoflush();
-  *OUT->autoflush();
-
-  if (fork()) {
-    # Server
-    if (*IN_DUP) {
-      open *STDIN, "<&IN_DUP"
-        or die "Can't duplicate STDIN: $!";
-      close *IN_DUP
-        or die "Can't close STDIN duplicate: $!";
-    }
-    open *STDOUT, ">&OUT_DUP"
-      or die "Can't duplicate STDOUT: $!";
-    close *OUT_DUP
-      or die "Can't close STDOUT duplicate: $!";
-
-    foreach my $line (@$in) {
-      #print "> $line";
-      print OUT $line;
-    }
-    close *OUT
-      or die "Can't close pipe for writing: $!";
-
-    my $result = [];
-    while (<IN>) {
-      #print "< $_";
-      if ($needs_shell) {
-	s#^/bin/sh: line \d+: ##;
-      }
-      push @$result, $_;
-    }
-    return $result;
-  } else {
-    # Client
-    $< = $>;
-    close IN
-      or die "Can't close read end for input pipe: $!";
-    close OUT
-      or die "Can't close write end for output pipe: $!";
-    close OUT_DUP
-      or die "Can't close STDOUT duplicate: $!";
-    local *ERR_DUP;
-    open ERR_DUP, ">&STDERR"
-      or die "Can't duplicate STDERR: $!";
-    open STDERR, ">&STDOUT"
-      or die "Can't join STDOUT and STDERR: $!";
-
-    if ($needs_shell) {
-      exec ('/bin/sh', '-c', join(" ", @$prog));
-    } else {
-      exec @$prog;
-    }
-    print STDERR $prog->[0], ": $!\n";
-    exit;
-  }
-}
-
diff --git a/nfs4acl/unrepresentable.test b/nfs4acl/unrepresentable.test
deleted file mode 100644
index 17fe5d4..0000000
--- a/nfs4acl/unrepresentable.test
+++ /dev/null
@@ -1,20 +0,0 @@
-Test cases for (acl, masks) pairs that cannot be represented as
-pure ACLs
-
-$ rm -rf d
-$ mkdir d
-$ cd d
-
-$ touch x
-
-$ nfs4acl --set 'group@:rw::allow' x
-$ chmod 600 x
-$ ls -l x | cut -d ' ' -f 1
-> -rw-------
-$ nfs4acl --get x
-> x:
->
-$ rm -f x
-
-$ cd ..
-$ rm -rf d
diff --git a/nfs4acl/write-vs-append.test b/nfs4acl/write-vs-append.test
deleted file mode 100644
index f1f940a..0000000
--- a/nfs4acl/write-vs-append.test
+++ /dev/null
@@ -1,46 +0,0 @@
-$ mkdir d
-$ cd d
-
-$ whoami
-> root
-
-$ touch a b c d e f
-$ nfs4acl --set 'owner@:*::allow' a
-$ nfs4acl --set 'owner@:*::allow bin:w::allow' b
-$ nfs4acl --set 'owner@:*::allow bin:a::allow' c
-$ nfs4acl --set 'owner@:*::allow bin:wa::allow' d
-$ nfs4acl --set 'bin:a::deny owner@:*::allow bin:w::allow' e
-$ nfs4acl --set 'bin:w::deny owner@:*::allow bin:a::allow' f
-
-$ su bin
-$ echo a > a
-> /bin/sh: a: Permission denied
-$ echo b > b
-$ echo c > c
-> /bin/sh: c: Permission denied
-$ echo d > d
-$ echo e > e
-$ echo f > f
-> /bin/sh: f: Permission denied
-
-$ echo A >> a
-> /bin/sh: a: Permission denied
-$ echo B >> b
-> /bin/sh: b: Permission denied
-$ echo C >> c
-$ echo D >> d
-$ echo E >> e
-> /bin/sh: e: Permission denied
-$ echo F >> f
-
-$ su
-$ cat a b c d e f
-> b
-> C
-> d
-> D
-> e
-> F
-
-$ cd ..
-$ rm -rf d
diff --git a/tests/xfs/191 b/tests/xfs/191
deleted file mode 100755
index e9aef20..0000000
--- a/tests/xfs/191
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/bash
-# FS QA Test No. 191
-#
-# To call into the nfs4acl qa suite of Andreas Gruenbacher.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-#-----------------------------------------------------------------------
-#
-
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-
-# real QA test starts here
-
-# Modify as appropriate.
-_supported_fs xfs
-_supported_os Linux
-
-_require_scratch
-_scratch_mkfs_xfs -i nfs4acl 1>$tmp.mkfs 2>$seqres.full
-if [ $? -ne 0 ]
-then
-	_notrun "no mkfs support for NFS v4 ACLs"
-fi
-
-_scratch_mount 2>/dev/null
-if [ $? -ne 0 ]
-then
-	_notrun "no kernel mount support for NFS v4 ACLs"
-fi
-
-set_prog_path nfs4acl >>$seqres.full
-if [ $? -ne 0 ]
-then
-	_notrun "no nfs4acl utility found"
-fi
-
-cd $SCRATCH_MNT
-for file in $here/nfs4acl/*.test
-do
-	print_file=`echo $file | sed 's/.*nfs4acl/nfs4acl/'`
-	echo ""
-	echo "*** $print_file ***"
-	echo ""
-	$here/nfs4acl/run $file
-done
-
-# success, all done
-status=0
-exit
diff --git a/tests/xfs/191.out b/tests/xfs/191.out
deleted file mode 100644
index 7a37ec8..0000000
--- a/tests/xfs/191.out
+++ /dev/null
@@ -1,324 +0,0 @@
-QA output created by 191
-
-*** nfs4acl/apply-mask.test ***
-
-[1] $ rm -rf d -- ok
-[2] $ mkdir d -- ok
-[3] $ cd d -- ok
-[5] $ touch x -- ok
-[7] $ nfs4acl --set 'owner@:rw::allow group@:rw::allow everyone@:r::allow' x -- ok
-[8] $ nfs4acl --get x -- ok
-[15] $ nfs4acl --set 'everyone@:w::allow owner@:r::allow group@:r::allow' x -- ok
-[16] $ chmod 664 x -- ok
-[17] $ nfs4acl --get x -- ok
-[23] $ nfs4acl --set 'everyone@:w::deny owner@:rw::allow group@:rw::allow' x -- ok
-[24] $ chmod 664 x -- ok
-[25] $ nfs4acl --get x -- ok
-[31] $ nfs4acl --set 'owner@:rwmo::allow' x -- ok
-[32] $ nfs4acl --get x -- ok
-[37] $ chmod 644 x -- ok
-[38] $ nfs4acl --get x -- ok
-[43] $ nfs4acl --set 'root:rw::allow' x -- ok
-[44] $ chmod 664 x -- ok
-[45] $ nfs4acl --get x -- ok
-[50] $ chmod 644 x -- ok
-[51] $ nfs4acl --get x -- ok
-[56] $ chmod 664 x -- ok
-[57] $ nfs4acl --get x -- ok
-[62] $ nfs4acl --set 'root:rw::allow everyone@:r::allow' x -- ok
-[63] $ chmod 664 x -- ok
-[64] $ nfs4acl --get x -- ok
-[70] $ nfs4acl --set 'root:r::allow everyone@:rw::allow' x -- ok
-[71] $ chmod 664 x -- ok
-[72] $ nfs4acl --get x -- ok
-[80] $ nfs4acl --set 'root:w::deny everyone@:rw::allow' x -- ok
-[81] $ chmod 664 x -- ok
-[82] $ nfs4acl --get x -- ok
-[91] $ nfs4acl --set 'root:rw::allow root:w::deny everyone@:rw::allow' x -- ok
-[92] $ chmod 664 x -- ok
-[93] $ nfs4acl --get x -- ok
-[102] $ nfs4acl --set 'everyone@:rw::allow' x -- ok
-[103] $ chmod 066 x -- ok
-[104] $ nfs4acl --get x -- ok
-[110] $ chmod 006 x -- ok
-[111] $ nfs4acl --get x -- ok
-[118] $ chmod 606 x -- ok
-[119] $ nfs4acl --get x -- ok
-[125] $ nfs4acl --set 'root:rw::allow everyone@:rw::allow' x -- ok
-[126] $ chmod 606 x -- ok
-[127] $ nfs4acl --get x -- ok
-[133] $ chmod 646 x -- ok
-[134] $ nfs4acl --get x -- ok
-[142] $ cd .. -- ok
-[143] $ rm -rf d -- ok
-49 commands (49 passed, 0 failed)
-
-*** nfs4acl/basic.test ***
-
-[1] $ rm -rf d -- ok
-[2] $ mkdir d -- ok
-[3] $ cd d -- ok
-[5] $ chown bin . -- ok
-[6] $ su bin -- ok
-[8] $ touch x -- ok
-[9] $ nfs4acl --set 'everyone@:rw::allow' x -- ok
-[10] $ ls -l x | cut -d ' ' -f 1 -- ok
-[13] $ nfs4acl --get x -- ok
-[18] $ chmod 664 x -- ok
-[19] $ ls -l x | cut -d ' ' -f 1 -- ok
-[22] $ nfs4acl --get x -- ok
-[29] $ mkdir sub -- ok
-[30] $ nfs4acl --set 'everyone@:rwax:fd:allow' sub -- ok
-[31] $ ls -dl sub | cut -d ' ' -f 1 -- ok
-[34] $ nfs4acl --get sub -- ok
-[39] $ chmod 775 sub -- ok
-[40] $ ls -dl sub | cut -d ' ' -f 1 -- ok
-[42] $ nfs4acl --get sub -- ok
-[50] $ touch sub/f -- ok
-[51] $ ls -l sub/f | cut -d ' ' -f 1 -- ok
-[54] $ nfs4acl --get sub/f -- ok
-[59] $ mkdir sub/sub2 -- ok
-[60] $ ls -dl sub/sub2 | cut -d ' ' -f 1 -- ok
-[63] $ nfs4acl --get sub/sub2 -- ok
-[68] $ su -- ok
-[69] $ cd .. -- ok
-[70] $ rm -rf d -- ok
-28 commands (28 passed, 0 failed)
-
-*** nfs4acl/chmod.test ***
-
-[1] $ mkdir d -- ok
-[2] $ cd d -- ok
-[4] $ whoami -- ok
-[7] $ touch a -- ok
-[10] $ su bin -- ok
-[11] $ chmod 666 a -- ok
-[13] $ nfs4acl --set 'bin:rwM::allow' a -- ok
-[16] $ su -- ok
-[17] $ nfs4acl --set 'bin:rwm::allow' a -- ok
-[20] $ su bin -- ok
-[21] $ nfs4acl --set 'bin:rwm::allow' a -- ok
-[25] $ chmod 666 a -- ok
-[26] $ nfs4acl --set 'bin:rwm::allow' a -- ok
-[29] $ su -- ok
-[30] $ cd .. -- ok
-[31] $ rm -rf d -- ok
-16 commands (16 passed, 0 failed)
-
-*** nfs4acl/chown.test ***
-
-[1] $ mkdir d -- ok
-[2] $ cd d -- ok
-[4] $ whoami -- ok
-[7] $ id -Gn daemon -- ok
-[10] $ touch a -- ok
-[13] $ su daemon -- ok
-[14] $ chown daemon a -- ok
-[16] $ chgrp daemon a -- ok
-[18] $ nfs4acl --set 'daemon:rwo::allow' a -- ok
-[23] $ su -- ok
-[24] $ nfs4acl --set 'daemon:rwo::allow' a -- ok
-[27] $ su daemon -- ok
-[28] $ chown root a -- ok
-[30] $ chgrp root a -- ok
-[35] $ su -- ok
-[36] $ ls -l a | cut -d ' ' -f1 -- ok
-[38] $ chmod 660 a -- ok
-[42] $ su daemon -- ok
-[43] $ chown daemon a -- ok
-[45] $ chgrp daemon a -- ok
-[47] $ chgrp bin a -- ok
-[51] $ su -- ok
-[52] $ nfs4acl --set 'daemon:rwo::allow' a -- ok
-[56] $ su daemon -- ok
-[57] $ chgrp daemon a -- ok
-[58] $ chgrp bin a -- ok
-[59] $ chown daemon a -- ok
-[61] $ su -- ok
-[62] $ cd .. -- ok
-[63] $ rm -rf d -- ok
-30 commands (30 passed, 0 failed)
-
-*** nfs4acl/computed-mode.test ***
-
-[1] $ rm -rf d -- ok
-[2] $ mkdir d -- ok
-[3] $ cd d -- ok
-[5] $ mkdir e -- ok
-[7] $ nfs4acl --set 'owner@:rwx:f:allow' e -- ok
-[8] $ touch e/f -- ok
-[9] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[11] $ rm e/f -- ok
-[13] $ nfs4acl --set 'group@:rwx:f:allow' e -- ok
-[14] $ touch e/f -- ok
-[15] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[17] $ rm e/f -- ok
-[19] $ nfs4acl --set 'everyone@:rwx:f:allow' e -- ok
-[20] $ touch e/f -- ok
-[21] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[23] $ rm e/f -- ok
-[25] $ nfs4acl --set 'owner@:rwx:f:allow root:rx:f:deny root:rx:f:allow' e -- ok
-[26] $ touch e/f -- ok
-[27] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[29] $ rm e/f -- ok
-[31] $ nfs4acl --set 'owner@:rwx::allow everyone@:w:fi:deny everyone@:rwx:fi:allow' e -- ok
-[32] $ touch e/f -- ok
-[33] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[35] $ rm e/f -- ok
-[37] $ nfs4acl --set 'owner@:rwx::allow root:rx:fi:deny root:rx:fi:allow' e -- ok
-[38] $ touch e/f -- ok
-[39] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[41] $ rm e/f -- ok
-[43] $ nfs4acl --set 'owner@:rx:fi:allow group@:rwx:fi:deny everyone@:rwx:f:allow' e -- ok
-[44] $ touch e/f -- ok
-[45] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[47] $ rm e/f -- ok
-[49] $ nfs4acl --set 'owner@:rx:fi:allow root:rwx:fi:deny everyone@:rwx:f:allow' e -- ok
-[50] $ touch e/f -- ok
-[51] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[53] $ rm e/f -- ok
-[55] $ nfs4acl --set 'everyone@:w:fi:deny root:rx:fi:allow everyone@:rwx:f:allow' e -- ok
-[56] $ touch e/f -- ok
-[57] $ ls -l e/f | cut -d ' ' -f 1 -- ok
-[59] $ rm e/f -- ok
-[61] $ cd .. -- ok
-[62] $ rm -rf d -- ok
-42 commands (42 passed, 0 failed)
-
-*** nfs4acl/create.test ***
-
-[1] $ mkdir d -- ok
-[2] $ cd d -- ok
-[4] $ whoami -- ok
-[7] $ mkdir d1 d2 d3 d4 -- ok
-[8] $ nfs4acl --set 'daemon:wx::allow' d2 -- ok
-[9] $ nfs4acl --set 'daemon:ax::allow' d3 -- ok
-[10] $ nfs4acl --set 'daemon:wax::allow' d4 -- ok
-[12] $ su daemon -- ok
-[15] $ touch d1/f -- ok
-[17] $ mkdir d1/d -- ok
-[21] $ touch d2/f -- ok
-[22] $ mkdir d2/d -- ok
-[26] $ touch d3/f -- ok
-[28] $ mkdir d3/d -- ok
-[31] $ touch d4/f -- ok
-[32] $ mkdir d4/d -- ok
-[33] $ su -- ok
-[34] $ cd .. -- ok
-[35] $ rm -rf d -- ok
-19 commands (19 passed, 0 failed)
-
-*** nfs4acl/ctime.test ***
-
-[1] $ mkdir d -- ok
-[2] $ cd d -- ok
-[4] $ whoami -- ok
-[7] $ touch a b -- ok
-[8] $ sleep 1 -- ok
-[11] $ su bin -- ok
-[12] $ touch a -- ok
-[17] $ su -- ok
-[18] $ nfs4acl --set 'bin:rw::allow' a -- ok
-[20] $ su bin -- ok
-[21] $ touch a -- ok
-[22] $ [ b -ot a ] || echo 'b should be older than a' -- ok
-[23] $ touch -r b a -- ok
-[27] $ su -- ok
-[28] $ nfs4acl --set 'bin:rwt::allow' a -- ok
-[30] $ su bin -- ok
-[31] $ touch -r b a -- ok
-[32] $ [ b -ot a -o a -ot b ] && echo 'a should be as old as b' -- ok
-[34] $ su -- ok
-[35] $ cd .. -- ok
-[36] $ rm -rf d -- ok
-21 commands (21 passed, 0 failed)
-
-*** nfs4acl/delete.test ***
-
-[1] $ mkdir d -- ok
-[2] $ cd d -- ok
-[4] $ whoami -- ok
-[7] $ id -Gn daemon -- ok
-[10] $ mkdir n1 -- ok
-[11] $ touch n1/f -- ok
-[13] $ mkdir d2 d3 d4 d5 d6 d7 -- ok
-[14] $ touch d2/f d3/f d4/f d5/f d6/f d7/f d7/g -- ok
-[15] $ chown daemon d2 -- ok
-[16] $ chgrp bin d3 -- ok
-[17] $ chmod g+w d3 -- ok
-[18] $ nfs4acl --set 'daemon:wx::allow' d4 -- ok
-[19] $ nfs4acl --set 'daemon:d::allow' d5 -- ok
-[20] $ nfs4acl --set 'daemon:xd::allow' d6 -- ok
-[21] $ nfs4acl --set 'daemon:D::allow' d7/f d7/g -- ok
-[22] $ chmod 664 d7/g -- ok
-[24] $ mkdir s2 s3 s4 s5 s6 s7 -- ok
-[25] $ chmod +t s2 s3 s4 s5 s6 s7 -- ok
-[26] $ touch s2/f s3/f s4/f s5/f s6/f s7/f s7/g -- ok
-[27] $ chown daemon s2 -- ok
-[28] $ chgrp bin s3 -- ok
-[29] $ chmod g+w s3 -- ok
-[30] $ nfs4acl --set 'daemon:wx::allow' s4 -- ok
-[31] $ nfs4acl --set 'daemon:d::allow' s5 -- ok
-[32] $ nfs4acl --set 'daemon:xd::allow' s6 -- ok
-[33] $ nfs4acl --set 'daemon:D::allow' s7/f -- ok
-[34] $ nfs4acl --set 'daemon:D::allow' s7/g s7/g -- ok
-[35] $ chmod 664 s7/g -- ok
-[37] $ su daemon -- ok
-[40] $ rm n1/f -- ok
-[44] $ rm d2/f s2/f -- ok
-[48] $ rm d3/f s3/f -- ok
-[53] $ rm d4/f s4/f -- ok
-[58] $ rm d5/f s5/f -- ok
-[64] $ rm d6/f s6/f -- ok
-[68] $ rm d7/f s7/f -- ok
-[71] $ rm d7/g s7/g -- ok
-[75] $ su -- ok
-[76] $ cd .. -- ok
-[77] $ rm -rf d -- ok
-40 commands (40 passed, 0 failed)
-
-*** nfs4acl/unrepresentable.test ***
-
-[4] $ rm -rf d -- ok
-[5] $ mkdir d -- ok
-[6] $ cd d -- ok
-[8] $ touch x -- ok
-[10] $ nfs4acl --set 'group@:rw::allow' x -- ok
-[11] $ chmod 600 x -- ok
-[12] $ ls -l x | cut -d ' ' -f 1 -- ok
-[14] $ nfs4acl --get x -- ok
-[17] $ rm -f x -- ok
-[19] $ cd .. -- ok
-[20] $ rm -rf d -- ok
-11 commands (11 passed, 0 failed)
-
-*** nfs4acl/write-vs-append.test ***
-
-[1] $ mkdir d -- ok
-[2] $ cd d -- ok
-[4] $ whoami -- ok
-[7] $ touch a b c d e f -- ok
-[8] $ nfs4acl --set 'owner@:*::allow' a -- ok
-[9] $ nfs4acl --set 'owner@:*::allow bin:w::allow' b -- ok
-[10] $ nfs4acl --set 'owner@:*::allow bin:a::allow' c -- ok
-[11] $ nfs4acl --set 'owner@:*::allow bin:wa::allow' d -- ok
-[12] $ nfs4acl --set 'bin:a::deny owner@:*::allow bin:w::allow' e -- ok
-[13] $ nfs4acl --set 'bin:w::deny owner@:*::allow bin:a::allow' f -- ok
-[15] $ su bin -- ok
-[16] $ echo a > a -- ok
-[18] $ echo b > b -- ok
-[19] $ echo c > c -- ok
-[21] $ echo d > d -- ok
-[22] $ echo e > e -- ok
-[23] $ echo f > f -- ok
-[26] $ echo A >> a -- ok
-[28] $ echo B >> b -- ok
-[30] $ echo C >> c -- ok
-[31] $ echo D >> d -- ok
-[32] $ echo E >> e -- ok
-[34] $ echo F >> f -- ok
-[36] $ su -- ok
-[37] $ cat a b c d e f -- ok
-[45] $ cd .. -- ok
-[46] $ rm -rf d -- ok
-27 commands (27 passed, 0 failed)
diff --git a/tests/xfs/group b/tests/xfs/group
index 9884329..4a67df1 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -176,7 +176,6 @@
 188 ci dir auto
 189 mount auto quick
 190 rw auto quick
-191 nfs4acl auto
 194 rw auto
 195 ioctl dump auto quick
 196 quota auto quick
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-11-18 14:17 ` [XFSTESTS 5/6] Add richacl tests Andreas Gruenbacher
@ 2015-11-23 23:08   ` Dave Chinner
  2015-12-03 23:10     ` Andreas Gruenbacher
  2015-12-06 17:31     ` Andreas Gruenbacher
  0 siblings, 2 replies; 18+ messages in thread
From: Dave Chinner @ 2015-11-23 23:08 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: xfs

On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
> Add the Rich Access Control List tests from the richacl package.  The
> new tests require TEST_DEV and TEST_DIR to be set.
> 
> When the check script is run, it first makes sure that the test
> filesystem has richacls enabled or disabled as appropriate: with the
> -richacl option, richacls must be enabled; without the -richacl option,
> richacls must be disabled.  If TEST_DEV has incorrect richacl support,
> the TEST_DEV filesystem is recreated.

No, we don't recreate the testdev like this with the test harness.
The test device is intended to remain unchanged from run to run, so
give us long term aging of the test filesystem over months of
regression test running.

If you want to test the testdev with richacls enabled, then you need
to manually create the testdev with richacls. Any test that
specifically needs to enable richacls should use the scratch device
and use a _requires_scratch_richacls() test to check that the
scratch device can be created with richacl support.

> The -richacl option currently selects the tests in the richacl group to
> be run.  Additional test groups or tests can be specified on the command
> line, e.g.,
> 
>>   ./check -richacl -g quick
> (Eventually, the -richacl option will be changed to only skip tests
> which are incompatible with richacls.)

No, this is wrong. If you want to check richacls, it should be via a
test group, not a specific command line option

   ./check -g richacl

That makes the first 2 patches in the series go away.

> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
>  .gitignore                          |   1 +
>  check                               |  39 +++++++-
>  common/rc                           |  23 ++++-
>  src/Makefile                        |   2 +-
>  src/require-richacls.c              |  35 +++++++

That's a red flag. For XFS, in common/rc:

_require_xfs_richacl()
{
	_scratch_mkfs_xfs_supported -m richacl=1 >/dev/null 2>&1 \
	           || _notrun "mkfs.xfs doesn't have richacl feature"

	_scratch_mkfs_xfs -m richacl=1 >/dev/null 2>&1 \
	_scratch_mount >/dev/null 2>&1 \
	           || _notrun "Kernel doesn't support richacl feature"
	umount $SCRATCH_MNT
}

_require_scratch_richacl()
{
	case "$FSTYP" in
	xfs)	_require_xfs_richacl
		;;
	ext4)	_require_ext4_richacl
		;;
	*)	_notrun "this test requires a richacl support on SCRATCHDEV"
		;;
	esac
}

>  tests/richacl/001-apply-masks       |   1 +
>  tests/richacl/002-auto-inheritance  |   1 +
>  tests/richacl/003-basic             |   1 +
>  tests/richacl/004-chmod             |   1 +
>  tests/richacl/005-chown             |   1 +
>  tests/richacl/006-create            |   1 +
>  tests/richacl/007-ctime             |   1 +
>  tests/richacl/008-delete            |   1 +
>  tests/richacl/009-setrichacl-modify |   1 +
>  tests/richacl/010-write-vs-append   |   1 +

These seem very short for tests. Oh, they just call one of the
files below:

>  tests/richacl/Makefile              |  44 +++++++++
>  tests/richacl/apply-masks           | 163 ++++++++++++++++++++++++++++++
>  tests/richacl/auto-inheritance      | 191 ++++++++++++++++++++++++++++++++++++
>  tests/richacl/basic                 |  97 ++++++++++++++++++
>  tests/richacl/chmod                 |  40 ++++++++
>  tests/richacl/chown                 |  42 ++++++++
>  tests/richacl/create                |  36 +++++++
>  tests/richacl/ctime                 |  35 +++++++
>  tests/richacl/delete                |  89 +++++++++++++++++
>  tests/richacl/group                 |  15 +++
>  tests/richacl/setrichacl-modify     |  57 +++++++++++
>  tests/richacl/test-lib.sh           | 149 ++++++++++++++++++++++++++++
>  tests/richacl/write-vs-append       |  54 ++++++++++

That's a strange way of running tests, an dmost definitely not the
way xfstests are written or supposed to be executed. And looking at
tests/richacl/Makefile, these files need to be installed somewhere
in the path for the tests to work. This is unnecessary complexity;
the tests should simply execute in place in the source tree and not
require any special installation steps.

i.e. only the numbered version of the test should exist,
and all the other files be moved into them. They shouldn't be in
tests/richacl, either - these are generic tests and so should
be in tests/generic, using whatever the next unused test numbers
are. And then, in the tests/generic/group file, there will be
entries like:

178-apply-masks	auto quick richacl
179-auto-inheritance auto quick richacl
....

These tests need to use the common xfstests structure (i.e. the
setup code from the "new" script).

The file that has all the common functionality in it (test-lib.sh)
needs to be moved to common/richacl and included along with the
necessary common files. At this point, the makefile can also go
away.

> diff --git a/tests/richacl/apply-masks b/tests/richacl/apply-masks
> new file mode 100755
> index 0000000..7a99cf9
> --- /dev/null
> +++ b/tests/richacl/apply-masks
> @@ -0,0 +1,163 @@
> +#! /bin/sh

We use /bin/bash in xfstests.

> +
> +. ${0%/*}/test-lib.sh
> +
> +require_richacls
> +use_tmpdir

No test actually uses $tmpdir, so why does this exist?

> +
> +ncheck "touch x"
> +ncheck "setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x"
> +check "getrichacl x" <<EOF
> +x:
> +    owner@:rwp----------::allow
> +    group@:rwp----------::allow
> + everyone@:r------------::allow
> +EOF

Ok, let's break this down, because most of the tests are similar.

ncheck is not needed, as golden output matching will catch an
unexpected error.

check is not needed, because the output of the command should
match what is in the golden output file. i.e, this test should be
simply:

touch x
setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x
getrichacl x

And the golden output file should contain:

x:
    owner@:rwp----------::allow
    group@:rwp----------::allow
 everyone@:r------------::allow

The fact that you do golden output matching directly in the script
to calculate "checks_succeeded" and "checks_failed" and then check
those at the end of the test to set the exit status is completely
unnecessary. The xfstests tsts harness does all this pattern
matching for you via the golden output file. Using output files
correctly make patches 3 and 4 in this series go away.

> +# We cannot set the acl as another user
> +runas -u 99 -g 99
> +check "setrichacl --set '99:rwc::allow' a || echo status: \$?" <<EOF
> +a: Operation not permitted
> +status: 1
> +EOF

In this case, check hides the fact the test attempts to run as a
different user. now we've got rid of the "check" wrappers, we should
just be doing:

runas=$here/src/runas

$runas -u 99 -g 99 -- setrichacl --set '99:rwc::allow' 

and capturing the expected error in the golden output file. This is
the same as ACL and other permission tests in xfstests. e.g:

$ git grep -l runas
.gitignore
src/Makefile
tests/generic/026
tests/generic/093
tests/generic/099
tests/generic/237
tests/shared/051
$

> +cleanup() {
> +    status=$?
> +    checks_succeeded=`expr $checks_succeeded`
> +    checks_failed=`expr $checks_failed`
> +    checks_total=`expr $checks_succeeded + $checks_failed`
> +    if test $checks_total -gt 0 ; then
> +	if test $checks_failed -gt 0 && test $status -eq 0 ; then
> +	    status=1
> +	fi
> +	echo "$checks_total tests ($checks_succeeded passed," \
> +	     "$checks_failed failed)"
> +    fi
> +    if test -n "$tmpdir" ; then
> +	chmod -R u+rwx "$tmpdir" 2>/dev/null
> +	cd / && rm -rf "$tmpdir"
> +    fi
> +    exit $status
> +}

This is all completely unnecessary because the golden output
matching done by the harness will fail the test if there is any
error at all. The whole point of using xfstests is that you don't
need to carry all this test harness install/run/test/check stuff in
the tests themselves. This stuff should be no different to the posix
ACL tests in structure (e.g. see generic/099), and should be just as
simple to maintain.....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 2/6] check: Enforce xfs filesystem recreation on $TEST_DEV
  2015-11-18 14:17 ` [XFSTESTS 2/6] check: Enforce xfs filesystem recreation on $TEST_DEV Andreas Gruenbacher
@ 2015-12-01 14:43   ` Carlos Maiolino
  0 siblings, 0 replies; 18+ messages in thread
From: Carlos Maiolino @ 2015-12-01 14:43 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: xfs

On Wed, Nov 18, 2015 at 03:17:45PM +0100, Andreas Gruenbacher wrote:
> When recreating xfs filesystems on $TEST_DEV, pass option -f to enforce
> the filesystem creation instead of refusing to overwrite existing xfs
> filesystems.  We already do that for ext2/ext3/ext4 filesystems.
> 

I don't believe this is a right thing to do, $TEST_DEV isn't supposed to be
rebuilt, but, to be kept around over several xfstests runs, for filesystem aging
testing.

Having this here might cause a xfstests user to accidentally mkfs an aged
filesystem, which IMHO is not something we want to do with $TEST_DEV


> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
>  common/rc | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 4c2f42c..ce6ae3d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -572,6 +572,9 @@ _test_mkfs()
>      btrfs)
>          $MKFS_BTRFS_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null
>  	;;
> +    xfs)
> +	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
> +	;;
>      ext2|ext3|ext4)
>  	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
>  	;;
> -- 
> 2.5.0
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

-- 
Carlos

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-11-23 23:08   ` Dave Chinner
@ 2015-12-03 23:10     ` Andreas Gruenbacher
  2015-12-07 21:36       ` Dave Chinner
  2015-12-06 17:31     ` Andreas Gruenbacher
  1 sibling, 1 reply; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-12-03 23:10 UTC (permalink / raw)
  To: Dave Chinner; +Cc: XFS Developers

Dave,

On Tue, Nov 24, 2015 at 12:08 AM, Dave Chinner <david@fromorbit.com> wrote:
> On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
[...]
>> +ncheck "touch x"
>> +ncheck "setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x"
>> +check "getrichacl x" <<EOF
>> +x:
>> +    owner@:rwp----------::allow
>> +    group@:rwp----------::allow
>> + everyone@:r------------::allow
>> +EOF
>
> Ok, let's break this down, because most of the tests are similar.
>
> ncheck is not needed, as golden output matching will catch an
> unexpected error.
>
> check is not needed, because the output of the command should
> match what is in the golden output file. i.e, this test should be
> simply:
>
> touch x
> setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x
> getrichacl x
>
> And the golden output file should contain:
>
> x:
>     owner@:rwp----------::allow
>     group@:rwp----------::allow
>  everyone@:r------------::allow
>
> The fact that you do golden output matching directly in the script
> to calculate "checks_succeeded" and "checks_failed" and then check
> those at the end of the test to set the exit status is completely
> unnecessary. The xfstests tsts harness does all this pattern
> matching for you via the golden output file. Using output files
> correctly make patches 3 and 4 in this series go away.

This is really not where I want to go with those tests. I'm not using
golden output files on full purpose; I really do want the output and
exit status of each command under test to be checked individually. I
also do want proper logging and error reporting --- Which commands
from where in the test script were executed with which parameters?
Were they successful and did they produce the expected output? If not,
what's the difference between the expected and actual output?

With xfstest output matching, I get none of that reliably. I don't
even get to know which exact commands are executed; parameters which
differ from run to run are masked on purpose (grepping for "sed" in
xfstests shows some examples). When a test fails, I have to start
guessing which command might have caused the failure; the tests are
peppered with echo "Here I am" statements to make that possible at
all.

For example, the above test produces the following log:

    [8] touch x -- ok
    [9] setrichacl --set 'owner@:rwp::allow group@:rwp::allow
everyone@:r::allow' x -- ok
    [10] getrichacl x -- ok
  [...]
    46 tests (46 passed, 0 failed)

A failure would come out as follows (with exit status 1):

    [8] touch x -- ok
    [9] setrichacl --set 'owner@:rwp::allow group@:rwp::allow
everyone@:r::allow' x -- ok
    [10] getrichacl x -- FAILED
    --- expected
    +++ got
    @@ -1,4 +1,4 @@
    x:
    -    owner@:rwp----------::allow
    -    group@:rwp----------::allow
    +    owner@:r------------::allow
    +    group@:r------------::allow
     everyone@:r------------::allow
  [...]
    46 tests (45 passed, 1 failed)

I also do want these tests to remain functional inside the richacl
package, where they are coming from.

Thanks,
Andreas

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-11-23 23:08   ` Dave Chinner
  2015-12-03 23:10     ` Andreas Gruenbacher
@ 2015-12-06 17:31     ` Andreas Gruenbacher
  2015-12-07 21:11       ` Dave Chinner
  1 sibling, 1 reply; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-12-06 17:31 UTC (permalink / raw)
  To: Dave Chinner; +Cc: XFS Developers

Dave,

On Tue, Nov 24, 2015 at 12:08 AM, Dave Chinner <david@fromorbit.com> wrote:
> On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
>> Add the Rich Access Control List tests from the richacl package.  The
>> new tests require TEST_DEV and TEST_DIR to be set.
>>
>> When the check script is run, it first makes sure that the test
>> filesystem has richacls enabled or disabled as appropriate: with the
>> -richacl option, richacls must be enabled; without the -richacl option,
>> richacls must be disabled.  If TEST_DEV has incorrect richacl support,
>> the TEST_DEV filesystem is recreated.
>
> No, we don't recreate the testdev like this with the test harness.
> The test device is intended to remain unchanged from run to run, so
> give us long term aging of the test filesystem over months of
> regression test running.
>
> If you want to test the testdev with richacls enabled, then you need
> to manually create the testdev with richacls.  Any test that
> specifically needs to enable richacls should use the scratch device
> and use a _requires_scratch_richacls() test to check that the
> scratch device can be created with richacl support.

well, let's leave it to users to create their TEST_DEV with richacl
support if they want the richacl tests to be run then. Those tests
will already be skipped on unsuitable filesystems anyway.

>> The -richacl option currently selects the tests in the richacl group to
>> be run.  Additional test groups or tests can be specified on the command
>> line, e.g.,
>>
>>>   ./check -richacl -g quick
>> (Eventually, the -richacl option will be changed to only skip tests
>> which are incompatible with richacls.)
>
> No, this is wrong. If you want to check richacls, it should be via a
> test group, not a specific command line option
>
>    ./check -g richacl

The richacl tests were in a separate group already ...

> That makes the first 2 patches in the series go away.
>
>> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
>> ---
>>  .gitignore                          |   1 +
>>  check                               |  39 +++++++-
>>  common/rc                           |  23 ++++-
>>  src/Makefile                        |   2 +-
>>  src/require-richacls.c              |  35 +++++++
>
> That's a red flag.

What is, any why?

>>  tests/richacl/001-apply-masks       |   1 +
>>  tests/richacl/002-auto-inheritance  |   1 +
>>  tests/richacl/003-basic             |   1 +
>>  tests/richacl/004-chmod             |   1 +
>>  tests/richacl/005-chown             |   1 +
>>  tests/richacl/006-create            |   1 +
>>  tests/richacl/007-ctime             |   1 +
>>  tests/richacl/008-delete            |   1 +
>>  tests/richacl/009-setrichacl-modify |   1 +
>>  tests/richacl/010-write-vs-append   |   1 +
>
> These seem very short for tests. Oh, they just call one of the
> files below:
>
>>  tests/richacl/Makefile              |  44 +++++++++
>>  tests/richacl/apply-masks           | 163 ++++++++++++++++++++++++++++++
>>  tests/richacl/auto-inheritance      | 191 ++++++++++++++++++++++++++++++++++++
>>  tests/richacl/basic                 |  97 ++++++++++++++++++
>>  tests/richacl/chmod                 |  40 ++++++++
>>  tests/richacl/chown                 |  42 ++++++++
>>  tests/richacl/create                |  36 +++++++
>>  tests/richacl/ctime                 |  35 +++++++
>>  tests/richacl/delete                |  89 +++++++++++++++++
>>  tests/richacl/group                 |  15 +++
>>  tests/richacl/setrichacl-modify     |  57 +++++++++++
>>  tests/richacl/test-lib.sh           | 149 ++++++++++++++++++++++++++++
>>  tests/richacl/write-vs-append       |  54 ++++++++++
>
> That's a strange way of running tests, an dmost definitely not the
> way xfstests are written or supposed to be executed.
>
> And looking at tests/richacl/Makefile, these files need to be
> installed somewhere in the path for the tests to work.

No, the tests don't need to be installed anywhere, they can just as
well be run directly. Compare with tests/generic/Makefile which also
has an install target which looks similar.

> i.e. only the numbered version of the test should exist,
> and all the other files be moved into them. They shouldn't be in
> tests/richacl, either - these are generic tests and so should
> be in tests/generic, using whatever the next unused test numbers
> are. And then, in the tests/generic/group file, there will be
> entries like:
>
> 178-apply-masks auto quick richacl
> 179-auto-inheritance auto quick richacl
> ....

The richacl tests started out in the richacl package, they were not
written for xfstests form scratch. I want to keep them working there
as well, and integrate them into xfstests with as little friction on
either side as necessary.

The symlinks avoid having to rename files on every update of those tests.

> These tests need to use the common xfstests structure (i.e. the
> setup code from the "new" script).

Why does the new script require TEST_DEV and TEST_DIR to be set when
it doesn't run tests? I'm not running the tests on the same host on
which I build the test suite.

> The file that has all the common functionality in it (test-lib.sh)
> needs to be moved to common/richacl and included along with the
> necessary common files. At this point, the makefile can also go
> away.

What's the benefit? The tests don't need anything from common/, I want
to keep them well separated so that updating them will remain easy.

>> diff --git a/tests/richacl/apply-masks b/tests/richacl/apply-masks
>> new file mode 100755
>> index 0000000..7a99cf9
>> --- /dev/null
>> +++ b/tests/richacl/apply-masks
>> @@ -0,0 +1,163 @@
>> +#! /bin/sh
>
> We use /bin/bash in xfstests.

Okay, those scripts are not dependent on any of the xfstests
infrastructure and don't require bash, but I can use /bin/bash just as
well.

>> +
>> +. ${0%/*}/test-lib.sh
>> +
>> +require_richacls
>> +use_tmpdir
>
> No test actually uses $tmpdir, so why does this exist?

All the tests run inside $tmpdir:

  use_tmpdir() {
      tmpdir=$PWD/tmp.$$
      mkdir "$tmpdir" && cd "$tmpdir" || exit 2
  }

I'll repost an updated patch set shortly.

Thanks,
Andreas

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-12-06 17:31     ` Andreas Gruenbacher
@ 2015-12-07 21:11       ` Dave Chinner
  2015-12-07 23:45         ` Andreas Gruenbacher
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Chinner @ 2015-12-07 21:11 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: XFS Developers

On Sun, Dec 06, 2015 at 06:31:20PM +0100, Andreas Gruenbacher wrote:
> Dave,
> 
> On Tue, Nov 24, 2015 at 12:08 AM, Dave Chinner <david@fromorbit.com> wrote:
> > On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
> >> Add the Rich Access Control List tests from the richacl package.  The
> >> new tests require TEST_DEV and TEST_DIR to be set.
> >>
> >> When the check script is run, it first makes sure that the test
> >> filesystem has richacls enabled or disabled as appropriate: with the
> >> -richacl option, richacls must be enabled; without the -richacl option,
> >> richacls must be disabled.  If TEST_DEV has incorrect richacl support,
> >> the TEST_DEV filesystem is recreated.
> >
> > No, we don't recreate the testdev like this with the test harness.
> > The test device is intended to remain unchanged from run to run, so
> > give us long term aging of the test filesystem over months of
> > regression test running.
> >
> > If you want to test the testdev with richacls enabled, then you need
> > to manually create the testdev with richacls.  Any test that
> > specifically needs to enable richacls should use the scratch device
> > and use a _requires_scratch_richacls() test to check that the
> > scratch device can be created with richacl support.
> 
> well, let's leave it to users to create their TEST_DEV with richacl
> support if they want the richacl tests to be run then. Those tests
> will already be skipped on unsuitable filesystems anyway.

No, that's not the way xfstests works, or how developers really
expect it to run. If you have new functionality that requires
specific on-disk format requirements that are different to the
defaults that the developers userspace progs are using then you
should be usingthe scratch device for those tests after probing that
the userspace toolset supports the required functionality.

> 
> >> The -richacl option currently selects the tests in the richacl group to
> >> be run.  Additional test groups or tests can be specified on the command
> >> line, e.g.,
> >>
> >>>   ./check -richacl -g quick
> >> (Eventually, the -richacl option will be changed to only skip tests
> >> which are incompatible with richacls.)
> >
> > No, this is wrong. If you want to check richacls, it should be via a
> > test group, not a specific command line option
> >
> >    ./check -g richacl
> 
> The richacl tests were in a separate group already ...

No, they aren't - you've set them up as a /filesystem/ group, not a
test group.

> > That makes the first 2 patches in the series go away.
> >
> >> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> >> ---
> >>  .gitignore                          |   1 +
> >>  check                               |  39 +++++++-
> >>  common/rc                           |  23 ++++-
> >>  src/Makefile                        |   2 +-
> >>  src/require-richacls.c              |  35 +++++++
> >
> > That's a red flag.
> 
> What is, any why?

That you are using C code to detect whether an on-disk feature is
supported or not. This is done through running the userspace tools
to check they support the on-disk feature, then icreating a
filesystem with those tools and mounting it to determine whether the
kernel supports the feature correctly as well.

> > i.e. only the numbered version of the test should exist,
> > and all the other files be moved into them. They shouldn't be in
> > tests/richacl, either - these are generic tests and so should
> > be in tests/generic, using whatever the next unused test numbers
> > are. And then, in the tests/generic/group file, there will be
> > entries like:
> >
> > 178-apply-masks auto quick richacl
> > 179-auto-inheritance auto quick richacl
> > ....
> 
> The richacl tests started out in the richacl package, they were not
> written for xfstests form scratch. I want to keep them working there
> as well, and integrate them into xfstests with as little friction on
> either side as necessary.

There is no point in maintaining two test suites - you'll change
stuff in your richacl package test suite, and the xfstests stuff
will be ignored, because *you won't be using xfstests*.

The whole point of getting this stuff into xfstests is so that
there's one place to both run and maintain the tests.

> The symlinks avoid having to rename files on every update of those tests.
> 
> > These tests need to use the common xfstests structure (i.e. the
> > setup code from the "new" script).
> 
> Why does the new script require TEST_DEV and TEST_DIR to be set when
> it doesn't run tests? I'm not running the tests on the same host on
> which I build the test suite.

Because it simply sources common code. Nobody has raised this as a
problem before, so if it bugs you, send patches to fix it.

> > The file that has all the common functionality in it (test-lib.sh)
> > needs to be moved to common/richacl and included along with the
> > necessary common files. At this point, the makefile can also go
> > away.
> 
> What's the benefit? The tests don't need anything from common/, I want
> to keep them well separated so that updating them will remain easy.

What's the benefit? That the tests all follow the same patterns, and
that means any xfstests user can modify and update the tests without
having to learn some new, weird frankenstein test infrastructure.

> >> +
> >> +. ${0%/*}/test-lib.sh
> >> +
> >> +require_richacls
> >> +use_tmpdir
> >
> > No test actually uses $tmpdir, so why does this exist?
> 
> All the tests run inside $tmpdir:
> 
>   use_tmpdir() {
>       tmpdir=$PWD/tmp.$$
>       mkdir "$tmpdir" && cd "$tmpdir" || exit 2
>   }

Which, quite frankly, means they should simply be running on
$SCRATCH_MNT, not some special tempdir on a specially remade
TEST_DIR that is hidden two layers down in the infrastructure and
then removed when the test completes.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-12-03 23:10     ` Andreas Gruenbacher
@ 2015-12-07 21:36       ` Dave Chinner
  2015-12-14 23:40         ` Andreas Gruenbacher
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Chinner @ 2015-12-07 21:36 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: XFS Developers

On Fri, Dec 04, 2015 at 12:10:27AM +0100, Andreas Gruenbacher wrote:
> Dave,
> 
> On Tue, Nov 24, 2015 at 12:08 AM, Dave Chinner <david@fromorbit.com> wrote:
> > On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
> [...]
> >> +ncheck "touch x"
> >> +ncheck "setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x"
> >> +check "getrichacl x" <<EOF
> >> +x:
> >> +    owner@:rwp----------::allow
> >> +    group@:rwp----------::allow
> >> + everyone@:r------------::allow
> >> +EOF
> >
> > Ok, let's break this down, because most of the tests are similar.
> >
> > ncheck is not needed, as golden output matching will catch an
> > unexpected error.
> >
> > check is not needed, because the output of the command should
> > match what is in the golden output file. i.e, this test should be
> > simply:
> >
> > touch x
> > setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x
> > getrichacl x
> >
> > And the golden output file should contain:
> >
> > x:
> >     owner@:rwp----------::allow
> >     group@:rwp----------::allow
> >  everyone@:r------------::allow
> >
> > The fact that you do golden output matching directly in the script
> > to calculate "checks_succeeded" and "checks_failed" and then check
> > those at the end of the test to set the exit status is completely
> > unnecessary. The xfstests tsts harness does all this pattern
> > matching for you via the golden output file. Using output files
> > correctly make patches 3 and 4 in this series go away.
> 
> This is really not where I want to go with those tests. I'm not using
> golden output files on full purpose; I really do want the output and
> exit status of each command under test to be checked individually.

Which you get from golden output matching. If the test succeeds, it
is silent, if a command fails, then it should be outputting an error
message to the user. That will be captured by the test harness.
Silent errors (i.e. error by return code only) indicate a broken
user interface....

> I
> also do want proper logging and error reporting --- Which commands
> from where in the test script were executed with which parameters?

logging goes to $seqres.full, and logging of commands executed to
$seqres.full can be done via the _do() wrapper, though we tend not
to do that because it's easier to debug tests when there aren't
wrappers like this in use. And, funnily enough, _do() also can be
used to check the return value of the command that is run, emit an
error message iand potentially fail the test if that happens.

Essentially you're arguing that you need functionality that xfstests
already provides you with.

> Were they successful and did they produce the expected output? If not,
> what's the difference between the expected and actual output?
> 
> With xfstest output matching, I get none of that reliably. I don't

This is an argument I hear all the time from people who aren't
familiar with xfstests. It's wrong....

> even get to know which exact commands are executed;

see above.

> parameters which
> differ from run to run are masked on purpose (grepping for "sed" in
> xfstests shows some examples).

And, sure, we *filter* the output to mask things that change that
are irrelevant to what we are testing. That means the tests canbe
made generic and independent of filesystem and platform
configurations. That's not something you need to care about, because
all of the richacl tests have the same output regardless of
filesystem/platform configurations.

Yes, the test harness provides capabilities and infrastructure you
don't need, but that's not a valid reason for being unable to
integrate a *set of pattern matching tests* into a test harness
whose error detection architecture is based around *pattern
matching*....

> When a test fails, I have to start
> guessing which command might have caused the failure; the tests are
> peppered with echo "Here I am" statements to make that possible at
> all.

Those statements are good for documentation purposes, not just
debugging. But you don't need to add them - you can use comments
just as well - or you can use other logging infrastructure (as I've
mentioned) to capture everything in the full logging file that is
provided *expressly for debugging purposes*.

> For example, the above test produces the following log:
> 
>     [8] touch x -- ok
>     [9] setrichacl --set 'owner@:rwp::allow group@:rwp::allow
> everyone@:r::allow' x -- ok
>     [10] getrichacl x -- ok
>   [...]
>     46 tests (46 passed, 0 failed)
> 
> A failure would come out as follows (with exit status 1):
> 
>     [8] touch x -- ok
>     [9] setrichacl --set 'owner@:rwp::allow group@:rwp::allow
> everyone@:r::allow' x -- ok
>     [10] getrichacl x -- FAILED
>     --- expected
>     +++ got
>     @@ -1,4 +1,4 @@
>     x:
>     -    owner@:rwp----------::allow
>     -    group@:rwp----------::allow
>     +    owner@:r------------::allow
>     +    group@:r------------::allow
>      everyone@:r------------::allow

I don't understand your problem - that's exactly the output that
xfstests will give you through golden output matching.

> I also do want these tests to remain functional inside the richacl
> package, where they are coming from.

While that may be important to you because that's where you do all
your development, it's irrelevant to all the filesystem developers
using xfstests.

It's the filesystem developers that are going to inadvertantly break
the xattr/richacl code as they make future changes to the filesystem
code - they are also the people that need to find out about such
breakages immediately, and that means having regression test
coverage in xfstests is far more important than having it in the
richacl package where it is only used by one person....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-12-07 21:11       ` Dave Chinner
@ 2015-12-07 23:45         ` Andreas Gruenbacher
  2015-12-08  6:44           ` Dave Chinner
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-12-07 23:45 UTC (permalink / raw)
  To: Dave Chinner; +Cc: XFS Developers

On Mon, Dec 7, 2015 at 10:11 PM, Dave Chinner <david@fromorbit.com> wrote:
> On Sun, Dec 06, 2015 at 06:31:20PM +0100, Andreas Gruenbacher wrote:
>> Dave,
>>
>> On Tue, Nov 24, 2015 at 12:08 AM, Dave Chinner <david@fromorbit.com> wrote:
>> > On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
>> >> Add the Rich Access Control List tests from the richacl package.  The
>> >> new tests require TEST_DEV and TEST_DIR to be set.
>> >>
>> >> When the check script is run, it first makes sure that the test
>> >> filesystem has richacls enabled or disabled as appropriate: with the
>> >> -richacl option, richacls must be enabled; without the -richacl option,
>> >> richacls must be disabled.  If TEST_DEV has incorrect richacl support,
>> >> the TEST_DEV filesystem is recreated.
>> >
>> > No, we don't recreate the testdev like this with the test harness.
>> > The test device is intended to remain unchanged from run to run, so
>> > give us long term aging of the test filesystem over months of
>> > regression test running.
>> >
>> > If you want to test the testdev with richacls enabled, then you need
>> > to manually create the testdev with richacls.  Any test that
>> > specifically needs to enable richacls should use the scratch device
>> > and use a _requires_scratch_richacls() test to check that the
>> > scratch device can be created with richacl support.
>>
>> well, let's leave it to users to create their TEST_DEV with richacl
>> support if they want the richacl tests to be run then. Those tests
>> will already be skipped on unsuitable filesystems anyway.
>
> No, that's not the way xfstests works, or how developers really
> expect it to run. If you have new functionality that requires
> specific on-disk format requirements that are different to the
> defaults that the developers userspace progs are using then you
> should be using the scratch device for those tests after probing that

That should be possible. Those tests would then only be using
SCRATCH_DEV / SCRATCH_MNT and not TEST_DEV / TEST_DIR at all. Any
ideas how xfstests could be made to not always require TEST_DEV /
TEST_DIR to be set?

>> >> The -richacl option currently selects the tests in the richacl group to
>> >> be run.  Additional test groups or tests can be specified on the command
>> >> line, e.g.,
>> >>
>> >>>   ./check -richacl -g quick
>> >> (Eventually, the -richacl option will be changed to only skip tests
>> >> which are incompatible with richacls.)
>> >
>> > No, this is wrong. If you want to check richacls, it should be via a
>> > test group, not a specific command line option
>> >
>> >    ./check -g richacl
>>
>> The richacl tests were in a separate group already ...
>
> No, they aren't - you've set them up as a /filesystem/ group, not a
> test group.

Not true. Both versions of the patches I've posted did add a group
file in tests/rchacl with entries like:

  001-apply-masks [...] richacl

which did define a richacl group. Running "./check -g richacl" did
select the appropriate test cases based on that definition.

There already are directories in tests/ which don't classify test
cases by filesystem (generic/ and shared/), so adding another for
keeping related things together is not a new concept.

>> > That makes the first 2 patches in the series go away.
>> >
>> >> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
>> >> ---
>> >>  .gitignore                          |   1 +
>> >>  check                               |  39 +++++++-
>> >>  common/rc                           |  23 ++++-
>> >>  src/Makefile                        |   2 +-
>> >>  src/require-richacls.c              |  35 +++++++
>> >
>> > That's a red flag.
>>
>> What is, any why?
>
> That you are using C code to detect whether an on-disk feature is
> supported or not. This is done through running the userspace tools
> to check they support the on-disk feature, then creating a
> filesystem with those tools and mounting it to determine whether the
> kernel supports the feature correctly as well.

Someone might run "check -g richacl" on a filesystem that doesn't
support richacls. In that case, I want the richacl test cases to be
skipped, with an explanation why; I don't want the test cases to just
explode. That's the same as what the POSIX ACL related test cases do
in common/attr:_require_acls().

_require_acls() uses the chacl utility for probing for POSIX ACL
support. The require-richacls program serves the same purpose. I could
probe using getfattr instead, but getfattr isn't necessarily
installed, and I won't want to create an unnecessary dependency.

>> > i.e. only the numbered version of the test should exist,
>> > and all the other files be moved into them. They shouldn't be in
>> > tests/richacl, either - these are generic tests and so should
>> > be in tests/generic, using whatever the next unused test numbers
>> > are. And then, in the tests/generic/group file, there will be
>> > entries like:
>> >
>> > 178-apply-masks auto quick richacl
>> > 179-auto-inheritance auto quick richacl
>> > ....
>>
>> The richacl tests started out in the richacl package, they were not
>> written for xfstests form scratch. I want to keep them working there
>> as well, and integrate them into xfstests with as little friction on
>> either side as necessary.
>
> There is no point in maintaining two test suites - you'll change
> stuff in your richacl package test suite, and the xfstests stuff
> will be ignored, because *you won't be using xfstests*.
> The whole point of getting this stuff into xfstests is so that
> there's one place to both run and maintain the tests.

I don't want to maintain two test suites, I want the same tests to
work in both contexts.

>> The symlinks avoid having to rename files on every update of those tests.
>>
>> > These tests need to use the common xfstests structure (i.e. the
>> > setup code from the "new" script).
>>
>> Why does the new script require TEST_DEV and TEST_DIR to be set when
>> it doesn't run tests? I'm not running the tests on the same host on
>> which I build the test suite.
>
> Because it simply sources common code. Nobody has raised this as a
> problem before, so if it bugs you, send patches to fix it.
>
>> > The file that has all the common functionality in it (test-lib.sh)
>> > needs to be moved to common/richacl and included along with the
>> > necessary common files. At this point, the makefile can also go
>> > away.
>>
>> What's the benefit? The tests don't need anything from common/, I want
>> to keep them well separated so that updating them will remain easy.
>
> What's the benefit? That the tests all follow the same patterns, and
> that means any xfstests user can modify and update the tests without
> having to learn some new, weird frankenstein test infrastructure.

>From the point of view of the xfstests infrastructure, all you really
have to know about the richacl tests is that they are scripts that
signal with their exit status whether a test has succeeded, failed, or
has been skipped. (That's actually how simple autoconf tests work as
well.)

Thanks,
Andreas

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-12-07 23:45         ` Andreas Gruenbacher
@ 2015-12-08  6:44           ` Dave Chinner
  2015-12-14 23:32             ` Andreas Gruenbacher
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Chinner @ 2015-12-08  6:44 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: XFS Developers

On Tue, Dec 08, 2015 at 12:45:05AM +0100, Andreas Gruenbacher wrote:
> On Mon, Dec 7, 2015 at 10:11 PM, Dave Chinner <david@fromorbit.com> wrote:
> > On Sun, Dec 06, 2015 at 06:31:20PM +0100, Andreas Gruenbacher wrote:
> >> Dave,
> >>
> >> On Tue, Nov 24, 2015 at 12:08 AM, Dave Chinner <david@fromorbit.com> wrote:
> >> > On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
> >> >> Add the Rich Access Control List tests from the richacl package.  The
> >> >> new tests require TEST_DEV and TEST_DIR to be set.
> >> >>
> >> >> When the check script is run, it first makes sure that the test
> >> >> filesystem has richacls enabled or disabled as appropriate: with the
> >> >> -richacl option, richacls must be enabled; without the -richacl option,
> >> >> richacls must be disabled.  If TEST_DEV has incorrect richacl support,
> >> >> the TEST_DEV filesystem is recreated.
> >> >
> >> > No, we don't recreate the testdev like this with the test harness.
> >> > The test device is intended to remain unchanged from run to run, so
> >> > give us long term aging of the test filesystem over months of
> >> > regression test running.
> >> >
> >> > If you want to test the testdev with richacls enabled, then you need
> >> > to manually create the testdev with richacls.  Any test that
> >> > specifically needs to enable richacls should use the scratch device
> >> > and use a _requires_scratch_richacls() test to check that the
> >> > scratch device can be created with richacl support.
> >>
> >> well, let's leave it to users to create their TEST_DEV with richacl
> >> support if they want the richacl tests to be run then. Those tests
> >> will already be skipped on unsuitable filesystems anyway.
> >
> > No, that's not the way xfstests works, or how developers really
> > expect it to run. If you have new functionality that requires
> > specific on-disk format requirements that are different to the
> > defaults that the developers userspace progs are using then you
> > should be using the scratch device for those tests after probing that
> 
> That should be possible. Those tests would then only be using
> SCRATCH_DEV / SCRATCH_MNT and not TEST_DEV / TEST_DIR at all. Any
> ideas how xfstests could be made to not always require TEST_DEV /
> TEST_DIR to be set?

That's not something I've ever considered - the test harness has
always assumed that you must have a valid test device to run
xfstests. Only recently did we add _require_test() to all the tests
that need the test device to move the mounting of the test device
from the harness to the tests themselves, but the harness itself
still has lots of code in it that assumes a test device must
exist....

Really, though, I fail to understand why this is a problem. It
takes 30s to configure test and scratch devices on loopback, and
then this is a total non-problem....

> > That you are using C code to detect whether an on-disk feature is
> > supported or not. This is done through running the userspace tools
> > to check they support the on-disk feature, then creating a
> > filesystem with those tools and mounting it to determine whether the
> > kernel supports the feature correctly as well.
> 
> Someone might run "check -g richacl" on a filesystem that doesn't
> support richacls. In that case, I want the richacl test cases to be
> skipped, with an explanation why; I don't want the test cases to just
> explode. That's the same as what the POSIX ACL related test cases do
> in common/attr:_require_acls().

Really? have you not noticed the copious use of _notrun() in all the
_require functions. here's a small selection for you:

generic/038      [not run] This test requires at least 10GB free on /mnt/scratch to run
generic/288 2s ... [not run] FITRIM not supported on /mnt/scratch
shared/002 0s ... [not run] This test requires a sane block device flush
xfs/016 9s ... [not run] Cannot mkfs for this test using MKFS_OPTIONS specified
xfs/035  [not run] No dump tape specified
xfs/095  [not run] not suitable for this OS: Linux
xfs/127  [not run] Reflink not supported by scratch filesystem type: xfs
xfs/131  [not run] External volumes not in use, skipped this test
xfs/186 2s ... [not run] attr v1 not supported on /dev/ram1
xfs/191  [not run] no mkfs support for NFS v4 ACLs
xfs/197  [not run] This test is only valid on 32 bit machines

And so on.

(Did you notice the xfs/191? You know, the old richacl test
execution wrapper. It's got all the mkfs/kernel/tool tests in it
that these days we wrap up into a _requires() function...)

> _require_acls() uses the chacl utility for probing for POSIX ACL
> support.

Yes, because posix acls don't have filesystem feature bits that can
be probed, nor do they have need for mkfs or fsck support. Welcome
to the new world - it's different to the old world.

> The require-richacls program serves the same purpose. I could
> probe using getfattr instead, but getfattr isn't necessarily
> installed, and I won't want to create an unnecessary dependency.

So you have to mkfs the filesytem, then mount it, then you can run
getfattr to check if richacls are supported. Yet mkfs can fail, the
mount can fail, and neither of them are going to give you nice
"richacls not supported" errors. See xfs/191, again.

> > There is no point in maintaining two test suites - you'll change
> > stuff in your richacl package test suite, and the xfstests stuff
> > will be ignored, because *you won't be using xfstests*.
> > The whole point of getting this stuff into xfstests is so that
> > there's one place to both run and maintain the tests.
> 
> I don't want to maintain two test suites, I want the same tests to
> work in both contexts.

Sure, xfstests becomes the master copy, because that's the one the
rest of the filesystem developer community needs you to maintain.

> >> What's the benefit? The tests don't need anything from common/, I want
> >> to keep them well separated so that updating them will remain easy.
> >
> > What's the benefit? That the tests all follow the same patterns, and
> > that means any xfstests user can modify and update the tests without
> > having to learn some new, weird frankenstein test infrastructure.
> 
> From the point of view of the xfstests infrastructure,

But from a maintenance perspective, as well as fs developers who
needs to understand the tests quickly, the tests need use the test
harness in the same way as all the other tests in xfstests. The same
logging, the same log files, the same expected results file, the
same method of determining pass or failure, etc.

Embed another test harness within the xfstests harness that does
it's own golden output matching, diffing, results aggregation and
reporting is just adding a whole load of code duplication
abstraction and bloat. It's unnecessary - the xfstests harness
provides all the functionality the richacl tests needs. It's just a
trivial mechanical conversion to change it all over. This isn't
difficult - you're making a mountain out of a molehill here...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-12-08  6:44           ` Dave Chinner
@ 2015-12-14 23:32             ` Andreas Gruenbacher
  2015-12-15 22:32               ` Dave Chinner
  0 siblings, 1 reply; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-12-14 23:32 UTC (permalink / raw)
  To: Dave Chinner; +Cc: XFS Developers

On Tue, Dec 8, 2015 at 7:44 AM, Dave Chinner <david@fromorbit.com> wrote:
> So you have to mkfs the filesytem, then mount it, then you can run
> getfattr to check if richacls are supported. Yet mkfs can fail, the
> mount can fail, and neither of them are going to give you nice
> "richacls not supported" errors. See xfs/191, again.

Okay, if the richacl tests should run on a scratch filesystem, then we
can obviously test if a richacl filesystem can be created and mounted
and we won't have to test if the mounted filesystem supports richacls.
It then also makes sense to run all of the richacl tests at once, on
the same scratch file system, similar to xfs/191.

Thanks,
Andreas

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-12-07 21:36       ` Dave Chinner
@ 2015-12-14 23:40         ` Andreas Gruenbacher
  0 siblings, 0 replies; 18+ messages in thread
From: Andreas Gruenbacher @ 2015-12-14 23:40 UTC (permalink / raw)
  To: Dave Chinner; +Cc: XFS Developers

On Mon, Dec 7, 2015 at 10:36 PM, Dave Chinner <david@fromorbit.com> wrote:
> On Fri, Dec 04, 2015 at 12:10:27AM +0100, Andreas Gruenbacher wrote:
>> Dave,
>>
>> On Tue, Nov 24, 2015 at 12:08 AM, Dave Chinner <david@fromorbit.com> wrote:
>> > On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
>> [...]
>> >> +ncheck "touch x"
>> >> +ncheck "setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x"
>> >> +check "getrichacl x" <<EOF
>> >> +x:
>> >> +    owner@:rwp----------::allow
>> >> +    group@:rwp----------::allow
>> >> + everyone@:r------------::allow
>> >> +EOF
>> >
>> > Ok, let's break this down, because most of the tests are similar.
>> >
>> > ncheck is not needed, as golden output matching will catch an
>> > unexpected error.
>> >
>> > check is not needed, because the output of the command should
>> > match what is in the golden output file. i.e, this test should be
>> > simply:
>> >
>> > touch x
>> > setrichacl --set 'owner@:rwp::allow group@:rwp::allow everyone@:r::allow' x
>> > getrichacl x
>> >
>> > And the golden output file should contain:
>> >
>> > x:
>> >     owner@:rwp----------::allow
>> >     group@:rwp----------::allow
>> >  everyone@:r------------::allow
>> >
>> > The fact that you do golden output matching directly in the script
>> > to calculate "checks_succeeded" and "checks_failed" and then check
>> > those at the end of the test to set the exit status is completely
>> > unnecessary. The xfstests tsts harness does all this pattern
>> > matching for you via the golden output file. Using output files
>> > correctly make patches 3 and 4 in this series go away.
>>
>> This is really not where I want to go with those tests. I'm not using
>> golden output files on full purpose; I really do want the output and
>> exit status of each command under test to be checked individually.
>
> Which you get from golden output matching. If the test succeeds, it
> is silent, if a command fails, then it should be outputting an error
> message to the user. That will be captured by the test harness.
> Silent errors (i.e. error by return code only) indicate a broken
> user interface....
>
>> I
>> also do want proper logging and error reporting --- Which commands
>> from where in the test script were executed with which parameters?
>
> logging goes to $seqres.full, and logging of commands executed to
> $seqres.full can be done via the _do() wrapper, though we tend not
> to do that because it's easier to debug tests when there aren't
> wrappers like this in use. And, funnily enough, _do() also can be
> used to check the return value of the command that is run, emit an
> error message iand potentially fail the test if that happens.
>
> Essentially you're arguing that you need functionality that xfstests
> already provides you with.

No, you're still missing my point; see below.

>> Were they successful and did they produce the expected output? If not,
>> what's the difference between the expected and actual output?
>>
>> With xfstest output matching, I get none of that reliably. I don't
>
> This is an argument I hear all the time from people who aren't
> familiar with xfstests. It's wrong....

If people are complaining all the time, there may be other reasons
than "use too stupid" as well.

>> even get to know which exact commands are executed;
>
> see above.
>
>> parameters which
>> differ from run to run are masked on purpose (grepping for "sed" in
>> xfstests shows some examples).
>
> And, sure, we *filter* the output to mask things that change that
> are irrelevant to what we are testing. That means the tests canbe
> made generic and independent of filesystem and platform
> configurations. That's not something you need to care about, because
> all of the richacl tests have the same output regardless of
> filesystem/platform configurations.
>
> Yes, the test harness provides capabilities and infrastructure you
> don't need, but that's not a valid reason for being unable to
> integrate a *set of pattern matching tests* into a test harness
> whose error detection architecture is based around *pattern
> matching*....
>
>> When a test fails, I have to start
>> guessing which command might have caused the failure; the tests are
>> peppered with echo "Here I am" statements to make that possible at
>> all.
>
> Those statements are good for documentation purposes, not just
> debugging. But you don't need to add them - you can use comments
> just as well - or you can use other logging infrastructure (as I've
> mentioned) to capture everything in the full logging file that is
> provided *expressly for debugging purposes*.
>
>> For example, the above test produces the following log:
>>
>>     [8] touch x -- ok
>>     [9] setrichacl --set 'owner@:rwp::allow group@:rwp::allow
>> everyone@:r::allow' x -- ok
>>     [10] getrichacl x -- ok
>>   [...]
>>     46 tests (46 passed, 0 failed)
>>
>> A failure would come out as follows (with exit status 1):
>>
>>     [8] touch x -- ok
>>     [9] setrichacl --set 'owner@:rwp::allow group@:rwp::allow
>> everyone@:r::allow' x -- ok
>>     [10] getrichacl x -- FAILED
>>     --- expected
>>     +++ got
>>     @@ -1,4 +1,4 @@
>>     x:
>>     -    owner@:rwp----------::allow
>>     -    group@:rwp----------::allow
>>     +    owner@:r------------::allow
>>     +    group@:r------------::allow
>>      everyone@:r------------::allow
>
> I don't understand your problem - that's exactly the output that
> xfstests will give you through golden output matching.

The difference is that the output includes the line number and the
exact command executed. When something fails, I immediately know where
to start looking.

With golden output matching, I may or may not find the command
executed in the log (depending on which additional echo commands have
been inserted to the test case), and the command will contain
placeholders for parameters which may vary from run to run. I may or
may not find the actual commands executed in the full log. I also only
get an overall diff which doesn't tell me where the failure happened
in the test case; I have to study the test case in order to find out,
which can be tricky.

See my recent fsx patch [*] which fixes several problems of that kind.

  [*] http://oss.sgi.com/archives/xfs/2015-12/msg00207.html

The approach I'm using in the richacl tests avoids some of those
problems at least.

>> I also do want these tests to remain functional inside the richacl
>> package, where they are coming from.
>
> While that may be important to you because that's where you do all
> your development, it's irrelevant to all the filesystem developers
> using xfstests.
>
> It's the filesystem developers that are going to inadvertantly break
> the xattr/richacl code as they make future changes to the filesystem
> code - they are also the people that need to find out about such
> breakages immediately, and that means having regression test
> coverage in xfstests is far more important than having it in the
> richacl package where it is only used by one person....

Fair enough, I've not said I don't want richacl test coverage in
xfstests. I'm not willing to sacrifice testability of the richacl
package ("make check") either though, and there, I don't have access
to the xfstests harness so something more lightweight will have to do.

Thanks,
Andreas

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [XFSTESTS 5/6] Add richacl tests
  2015-12-14 23:32             ` Andreas Gruenbacher
@ 2015-12-15 22:32               ` Dave Chinner
  0 siblings, 0 replies; 18+ messages in thread
From: Dave Chinner @ 2015-12-15 22:32 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: XFS Developers

On Tue, Dec 15, 2015 at 12:32:10AM +0100, Andreas Gruenbacher wrote:
> It then also makes sense to run all of the richacl tests at once, on
> the same scratch file system, similar to xfs/191.

No, it doesn't. just because I refered you to how some piece of
infrastructure works via a given test, it doesn't mean that
everythign the test does is correct. xfs/191 is a bad test because
it aggregates lots of little regression tests into a single test via
it's own internal harness - exactly the same issues that I'm telling
you know is not acceptible for the richacl tests.

The rule of thumb is that there should be one xfs test per
individual regression test. You've got at least 10 separate
regression tests there, so there should be at least 10 xfstests.
They should not be aggregated into a single test - if you need to
run them all at once, then that is what the richacl test group is
for....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-12-15 22:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 14:17 [XFSTESTS 0/6] Richacl Tests Andreas Gruenbacher
2015-11-18 14:17 ` [XFSTESTS 1/6] check: Don't complain about missing tests/$FSTYP/group Andreas Gruenbacher
2015-11-18 14:17 ` [XFSTESTS 2/6] check: Enforce xfs filesystem recreation on $TEST_DEV Andreas Gruenbacher
2015-12-01 14:43   ` Carlos Maiolino
2015-11-18 14:17 ` [XFSTESTS 3/6] Rename output file templates to match TEST.out* Andreas Gruenbacher
2015-11-18 14:17 ` [XFSTESTS 4/6] check: Add support for tests without *.out files Andreas Gruenbacher
2015-11-18 14:17 ` [XFSTESTS 5/6] Add richacl tests Andreas Gruenbacher
2015-11-23 23:08   ` Dave Chinner
2015-12-03 23:10     ` Andreas Gruenbacher
2015-12-07 21:36       ` Dave Chinner
2015-12-14 23:40         ` Andreas Gruenbacher
2015-12-06 17:31     ` Andreas Gruenbacher
2015-12-07 21:11       ` Dave Chinner
2015-12-07 23:45         ` Andreas Gruenbacher
2015-12-08  6:44           ` Dave Chinner
2015-12-14 23:32             ` Andreas Gruenbacher
2015-12-15 22:32               ` Dave Chinner
2015-11-18 14:17 ` [XFSTESTS 6/6] Remove the obsolete nfs4acl tests Andreas Gruenbacher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.