Richacl Tests
cover Richacl Tests
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
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 1/6 check: Don't complain about missing tests/$FSTYP/group
When filesystems don't have filesystem specific tests, those nonexistent tests also won't have a group file.
--- check | 2 ++ 1 file changed, 2 insertions(+)
check +2 -0
@@ -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/$/ /' \
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/6 check: Enforce xfs filesystem recreation on $TEST_DEV
In reply to Andreas GruenbacherWhen 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.
--- common/rc | 3 +++ 1 file changed, 3 insertions(+)
common/rc +3 -0
@@ -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 ;;
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 2/6] check: Enforce xfs filesystem recreation on $TEST_DEV
Quoted 4 lines · 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.
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
Quoted 26 lines
Signed-off-by Andreas Gruenbacher <[email protected]>--- common/rc | 3 +++ 1 file changed, 3 insertions(+)common/rc +3
-0@@ -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 ;;Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Signature · 6 lines
Carlos _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/6 Rename output file templates to match TEST.out*
In reply to Andreas GruenbacherRename 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.
--- .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
.gitignore +16 -0
@@ -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
tests/xfs/033 +1 -1
@@ -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
tests/xfs/033.crc.out.linux deleted +0 -197
197 lines not on this page · raw message
tests/xfs/033.out.crc.linux new file +197 -0
197 lines not on this page · raw message
tests/xfs/096 +2 -2
@@ -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
tests/xfs/096.external deleted +0 -50
50 lines not on this page · raw message
tests/xfs/096.internal deleted +0 -51
51 lines not on this page · raw message
tests/xfs/096.out.external new file +50 -0
50 lines not on this page · raw message
tests/xfs/096.out.internal new file +51 -0
51 lines not on this page · raw message
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 4/6 check: Add support for tests without *.out files
In reply to Andreas GruenbacherAdd 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.
--- check | 77 +++++++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 27 deletions(-)
check +50 -27
@@ -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
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 5/6 Add richacl tests
In reply to Andreas GruenbacherAdd 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.)
--- .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
.gitignore +1 -0
@@ -116,6 +116,7 @@ /src/cloner /src/renameat2 /src/t_rename_overwrite +/src/require-richacls # dmapi/ binaries /dmapi/src/common/cmd/read_invis
check +37 -2
@@ -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
common/rc +18 -5
@@ -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 }
src/Makefile +1 -1
@@ -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 =
src/require-richacls.c new file +35 -0
@@ -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 ; +}
tests/richacl/001-apply-masks new file +1 -0
@@ -0,0 +1 @@ +apply-masks
tests/richacl/002-auto-inheritance new file +1 -0
@@ -0,0 +1 @@ +auto-inheritance
tests/richacl/003-basic new file +1 -0
@@ -0,0 +1 @@ +basic
tests/richacl/004-chmod new file +1 -0
@@ -0,0 +1 @@ +chmod
tests/richacl/005-chown new file +1 -0
@@ -0,0 +1 @@ +chown
tests/richacl/006-create new file +1 -0
@@ -0,0 +1 @@ +create
tests/richacl/007-ctime new file +1 -0
@@ -0,0 +1 @@ +ctime
tests/richacl/008-delete new file +1 -0
@@ -0,0 +1 @@ +delete
tests/richacl/009-setrichacl-modify new file +1 -0
@@ -0,0 +1 @@ +setrichacl-modify
tests/richacl/010-write-vs-append new file +1 -0
@@ -0,0 +1 @@ +write-vs-append
tests/richacl/Makefile new file +44 -0
44 lines not on this page · raw message
tests/richacl/apply-masks new file +163 -0
163 lines not on this page · raw message
tests/richacl/auto-inheritance new file +191 -0
191 lines not on this page · raw message
tests/richacl/basic new file +97 -0
97 lines not on this page · raw message
tests/richacl/chmod new file +40 -0
@@ -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
tests/richacl/chown new file +42 -0
42 lines not on this page · raw message
tests/richacl/create new file +36 -0
@@ -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"
tests/richacl/ctime new file +35 -0
@@ -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"
tests/richacl/delete new file +89 -0
89 lines not on this page · raw message
tests/richacl/group new file +15 -0
@@ -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
tests/richacl/setrichacl-modify new file +57 -0
57 lines not on this page · raw message
tests/richacl/test-lib.sh new file +149 -0
149 lines not on this page · raw message
tests/richacl/write-vs-append new file +54 -0
54 lines not on this page · raw message
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 8 lines · Andreas Gruenbacher
Add the Rich Access Control List tests from the richacl package. The new tests require
TEST_DEVandTEST_DIRto 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_DEVhas incorrect richacl support, theTEST_DEVfilesystem 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.
Quoted 7 lines
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.,
Quoted 1 line
./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.
Quoted 7 lines
Signed-off-by Andreas Gruenbacher <[email protected]>--- .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
}Quoted 10 lines
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:
Quoted 5 lines
tests/richacl/Makefile | 44 +++++++++ tests/richacl/apply-masks | 163 ++++++++++++++++++++++++++++++ tests/richacl/auto-inheritance | 191 ++++++++++++++++++++++++++++++++++++ tests/richacl/basic | 97 ++++++++++++++++++ tests/richacl/chmod | 40 ++++++++
Quoted 8 lines
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.
tests/richacl/apply-masks line 1
Quoted 7 lines
tests/richacl/apply-masks new file +1
-0@@ -0,0 +1,163 @@ +#! /bin/sh
We use /bin/bash in xfstests.
tests/richacl/apply-masks line 6
Quoted 5 lines
tests/richacl/apply-masks new file +5
-0+ +. ${0%/*}/test-lib.sh + +require_richacls +use_tmpdir
No test actually uses $tmpdir, so why does this exist?
tests/richacl/apply-masks line 15
Quoted 9 lines
tests/richacl/apply-masks new file +9
-0+ +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----------::alloweveryone@: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.
tests/richacl/apply-masks line 21
Quoted 6 lines
tests/richacl/apply-masks new file +6
-0+# 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 $
Quoted 8 lines
tests/richacl/apply-masks new file +8
-0+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
tests/richacl/apply-masks line 39
Quoted 10 lines
tests/richacl/apply-masks new file +10
-0+ 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.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Dave,
Quoted 1 line · Dave Chinner
On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
[...]
Quoted 27 lines
tests/richacl/apply-masks line 15
Quoted 8 lines
tests/richacl/apply-masks new file +8
-0+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 +EOFOk, 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 xAnd the golden output file should contain:
x:
owner@:rwp----------::allow group@:rwp----------::allow
Quoted 8 lines
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::alloweveryone@: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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 41 lines · Andreas Gruenbacher
Dave,
Quoted 1 line · Dave Chinner
On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
[...]
Quoted 27 lines
tests/richacl/apply-masks line 15
Quoted 8 lines
tests/richacl/apply-masks new file +8
-0+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 +EOFOk, 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 xAnd the golden output file should contain:
x:
owner@:rwp----------::allow group@:rwp----------::allowQuoted 8 lines
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.
Quoted 3 lines
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....
Quoted 3 lines
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.
Quoted 4 lines
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....
Quoted 1 line
even get to know which exact commands are executed;
see above.
Quoted 3 lines
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*....
Quoted 4 lines
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*.
Quoted 13 lines
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
Quoted 11 lines
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.
Quoted 2 lines
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.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 63 lines · Dave Chinner
Quoted 41 lines · Andreas Gruenbacher
Dave,
Quoted 1 line · Dave Chinner
On Wed, Nov 18, 2015 at 03:17:48PM +0100, Andreas Gruenbacher wrote:
[...]
Quoted 27 lines
tests/richacl/apply-masks line 15
Quoted 8 lines
tests/richacl/apply-masks new file +8
-0+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 +EOFOk, 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 xAnd the golden output file should contain:
x:
owner@:rwp----------::allow group@:rwp----------::allowQuoted 8 lines
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.Quoted 3 lines
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....
Quoted 3 lines
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.
Quoted 2 lines
Essentially you're arguing that you need functionality that xfstests already provides you with.
No, you're still missing my point; see below.
Quoted 7 lines
Quoted 4 lines
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.
Quoted 57 lines
Quoted 1 line
even get to know which exact commands are executed;
see above.
Quoted 3 lines
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*....
Quoted 4 lines
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*.
Quoted 13 lines
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::allowQuoted 11 lines
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
Quoted 2 lines
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.
Quoted 7 lines
Quoted 2 lines
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.
Quoted 6 lines
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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
In reply to Dave ChinnerDave,
Quoted 15 lines · Dave Chinner
Quoted 8 lines · Andreas Gruenbacher
Add the Rich Access Control List tests from the richacl package. The new tests require
TEST_DEVandTEST_DIRto 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_DEVhas incorrect richacl support, theTEST_DEVfilesystem 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.
Quoted 5 lines
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.
Quoted 4 lines
Quoted 4 lines
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.,
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
./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 ...
Quoted 11 lines
That makes the first 2 patches in the series go away.
Quoted 7 lines
Signed-off-by Andreas Gruenbacher <[email protected]>--- .gitignore | 1 + check | 39 +++++++- common/rc | 23 ++++- src/Makefile | 2 +- src/require-richacls.c | 35 +++++++That's a red flag.
What is, any why?
Quoted 28 lines
Quoted 10 lines
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:
Quoted 5 lines
tests/richacl/Makefile | 44 +++++++++ tests/richacl/apply-masks | 163 ++++++++++++++++++++++++++++++ tests/richacl/auto-inheritance | 191 ++++++++++++++++++++++++++++++++++++ tests/richacl/basic | 97 ++++++++++++++++++ tests/richacl/chmod | 40 ++++++++Quoted 8 lines
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 ++++++++++
Quoted 5 lines
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.
Quoted 10 lines
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.
Quoted 2 lines
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.
Quoted 4 lines
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.
Quoted 9 lines
tests/richacl/apply-masks line 1
Quoted 7 lines
tests/richacl/apply-masks new file +1
-0@@ -0,0 +1,163 @@ +#! /bin/shWe use
/bin/bashin 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.
Quoted 7 lines
tests/richacl/apply-masks line 6
Quoted 5 lines
tests/richacl/apply-masks new file +5
-0+ +. ${0%/*}/test-lib.sh + +require_richacls +use_tmpdirNo 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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 24 lines · Andreas Gruenbacher
Dave,
Quoted 15 lines · Dave Chinner
Quoted 8 lines · Andreas Gruenbacher
Add the Rich Access Control List tests from the richacl package. The new tests require
TEST_DEVandTEST_DIRto 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_DEVhas incorrect richacl support, theTEST_DEVfilesystem 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.
Quoted 5 lines
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.
Quoted 3 lines
well, let's leave it to users to create their
TEST_DEVwith 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.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
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.,
Quoted 1 line
./check -richacl -g quick
(Eventually, the -richacl option will be changed to only skip tests which are incompatible with richacls.)
Quoted 6 lines
Quoted 4 lines
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.
Quoted 10 lines
Quoted 10 lines
That makes the first 2 patches in the series go away.
Quoted 7 lines
Signed-off-by Andreas Gruenbacher <[email protected]>--- .gitignore | 1 + check | 39 +++++++- common/rc | 23 ++++- src/Makefile | 2 +- src/require-richacls.c | 35 +++++++
Quoted 3 lines
Quoted 1 line
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.
Quoted 7 lines
Quoted 7 lines
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:
Quoted 8 lines
Quoted 3 lines
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.
Quoted 8 lines
The symlinks avoid having to rename files on every update of those tests.
Quoted 2 lines
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_DEVandTEST_DIRto 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.
Quoted 7 lines
Quoted 4 lines
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.
Quoted 8 lines
Quoted 7 lines
tests/richacl/apply-masks line 6
Quoted 5 lines
tests/richacl/apply-masks new file +5
-0+ +. ${0%/*}/test-lib.sh + +require_richacls +use_tmpdirNo test actually uses $tmpdir, so why does this exist?
Quoted 6 lines
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.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 29 lines · Dave Chinner
Quoted 24 lines · Andreas Gruenbacher
Dave,
Quoted 15 lines · Dave Chinner
Quoted 8 lines · Andreas Gruenbacher
Add the Rich Access Control List tests from the richacl package. The new tests require
TEST_DEVandTEST_DIRto 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_DEVhas incorrect richacl support, theTEST_DEVfilesystem 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.
Quoted 5 lines
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.Quoted 3 lines
well, let's leave it to users to create their
TEST_DEVwith richacl support if they want the richacl tests to be run then. Those tests will already be skipped on unsuitable filesystems anyway.
Quoted 5 lines
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?
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
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.,
Quoted 1 line
./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
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
./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.
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
That makes the first 2 patches in the series go away.
Quoted 7 lines
Signed-off-by Andreas Gruenbacher <[email protected]>--- .gitignore | 1 + check | 39 +++++++- common/rc | 23 ++++- src/Makefile | 2 +- src/require-richacls.c | 35 +++++++That's a red flag.
Quoted 7 lines
Quoted 1 line
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.
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
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:
Quoted 8 lines
Quoted 3 lines
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.
Quoted 5 lines
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.
Quoted 17 lines
Quoted 8 lines
The symlinks avoid having to rename files on every update of those tests.
Quoted 2 lines
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_DEVandTEST_DIRto 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.
Quoted 5 lines
Quoted 4 lines
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.
Quoted 8 lines
Quoted 2 lines
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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 36 lines · Andreas Gruenbacher
Quoted 29 lines · Dave Chinner
Quoted 24 lines · Andreas Gruenbacher
Dave,
Quoted 15 lines · Dave Chinner
Quoted 8 lines · Andreas Gruenbacher
Add the Rich Access Control List tests from the richacl package. The new tests require
TEST_DEVandTEST_DIRto 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_DEVhas incorrect richacl support, theTEST_DEVfilesystem 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.
Quoted 5 lines
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.Quoted 3 lines
well, let's leave it to users to create their
TEST_DEVwith richacl support if they want the richacl tests to be run then. Those tests will already be skipped on unsuitable filesystems anyway.Quoted 5 lines
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
Quoted 4 lines
That should be possible. Those tests would then only be using
SCRATCH_DEV/SCRATCH_MNTand notTEST_DEV/TEST_DIRat all. Any ideas how xfstests could be made to not always requireTEST_DEV/TEST_DIRto 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....
Quoted 11 lines
Quoted 5 lines
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...)
Quoted 2 lines
_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.
Quoted 3 lines
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.
Quoted 8 lines
Quoted 5 lines
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.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
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.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 4 lines · Dave Chinner
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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [XFSTESTS 5/6] Add richacl tests
Quoted 2 lines · Andreas Gruenbacher
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.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 6/6 Remove the obsolete nfs4acl tests
In reply to Andreas GruenbacherThe nfs4acl tests don't make sense anymore as they have been obsoleted by richacls.
--- 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
nfs4acl/Makefile deleted +0 -29
@@ -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:
nfs4acl/apply-mask.test deleted +0 -143
143 lines not on this page · raw message
nfs4acl/basic.test deleted +0 -70
70 lines not on this page · raw message
nfs4acl/chmod.test deleted +0 -31
@@ -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
nfs4acl/chown.test deleted +0 -63
63 lines not on this page · raw message
nfs4acl/computed-mode.test deleted +0 -62
62 lines not on this page · raw message
nfs4acl/create.test deleted +0 -35
@@ -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
nfs4acl/ctime.test deleted +0 -36
@@ -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
nfs4acl/delete.test deleted +0 -77
77 lines not on this page · raw message
nfs4acl/run deleted +0 -298
298 lines not on this page · raw message
nfs4acl/unrepresentable.test deleted +0 -20
@@ -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
nfs4acl/write-vs-append.test deleted +0 -46
46 lines not on this page · raw message
tests/xfs/191 deleted +0 -75
75 lines not on this page · raw message
tests/xfs/191.out deleted +0 -324
324 lines not on this page · raw message
tests/xfs/group +0 -1
@@ -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
Signature · 6 lines
2.5.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs