]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs: fix tests for persistent qflags
authorDarrick J. Wong <djwong@kernel.org>
Thu, 22 Aug 2024 00:30:21 +0000 (17:30 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 17 Oct 2024 17:28:23 +0000 (10:28 -0700)
Fix the tests that now break with persistent quota flags.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
15 files changed:
common/quota
common/rc
common/xfs
tests/xfs/007
tests/xfs/096
tests/xfs/096.out
tests/xfs/106
tests/xfs/116
tests/xfs/116.cfg [new file with mode: 0644]
tests/xfs/116.out.default [moved from tests/xfs/116.out with 100% similarity]
tests/xfs/116.out.metadir [new file with mode: 0644]
tests/xfs/152
tests/xfs/1856
tests/xfs/263
tests/xfs/263.out

index 3bf7d552eecc0700e026de9ae963781a95c6e407..c16634d8d2fbf424eeaa52f575420a98bfc5baae 100644 (file)
@@ -312,6 +312,7 @@ _qmount_option()
                -e 's/grpjquota=[^, ]*/QUOTA/g' \
                -e 's/\bpquota/QUOTA/g'    \
                -e 's/prjquota/QUOTA/g'    \
+               -e 's/noquota/QUOTA/g'     \
                -e 's/quota/QUOTA/g'       \
                -e 's/uqnoenforce/QUOTA/g' \
                -e 's/gqnoenforce/QUOTA/g' \
index 2af26f23f9b60bb7fe61677e8df9da9a712d35d7..cca4f97aebbd9ae952ce2955a8fdbe4138931c44 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3532,6 +3532,7 @@ _get_os_name()
 _link_out_file_named()
 {
        test -n "$seqfull" || _fail "need to set seqfull"
+       test -r "$seqfull.cfg" || _fail "need $seqfull.cfg"
 
        local features=$2
        local suffix=$(FEATURES="$features" perl -e '
index d91fc151877a68d2e1611d9bece741e1ef94bccf..22e0e2a7c9118cc6cd488372fdd340387c578dd1 100644 (file)
@@ -1694,6 +1694,9 @@ _xfs_filter_mkfs()
                print STDERR "ldev=\"$1\"\nlbsize=$2\nlblocks=$3\nlversion=$4\n";
                print STDOUT "log      =LDEV bsize=XXX blocks=XXX\n";
        }
+       if (/^\s+=\s+exchange=(\d+)\s+metadir=(\d+)/) {
+               print STDERR "exchange=$1\nmetadir=$2\n\n";
+       }
        if (/^\s+=\s+sectsz=(\d+)\s+sunit=(\d+) blks/) {
                print STDERR "logsectsz=$1\nlogsunit=$2\n\n";
        }
index e35a069f9bd5c57f51823efe35f6aeda39a1aa46..4721bc832b3fe4451496a4904df4b568019c68e6 100755 (executable)
@@ -47,7 +47,7 @@ do_test()
        # This takes care of newer kernels where quotaoff clears the superblock
        # quota enforcement flags but doesn't shut down accounting.
        _scratch_unmount
-       _qmount_option ""
+       _qmount_option "noquota"
        _scratch_mount
 
        rm_commands=(-x -c "remove -$off_opts")
index 57a05a8ffefbd195485113a5710bc90111c92850..f1f5d562d4fa18802ffda36cd3db5187e372244e 100755 (executable)
@@ -28,6 +28,7 @@ function option_string()
        if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi;
        if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi;
        if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi;
+       if [ "$VAL" = "0" ]; then OPT=noquota; fi;
        echo $OPT
 }
 
index 1deb7a8c3023749963a4ec23dd9d7487c444eba2..20f68d3870c4a0348200b892b8bbd053ccb84fa8 100644 (file)
@@ -1,5 +1,5 @@
 QA output created by 096
-== Options: rw ==
+== Options: noquota ==
 == Options: usrquota,rw ==
 User quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON
index 066efef1181b8a1b45f1f7b644ab5ccac3ed2474..10cbd1052bbc899bdeb99efebbd3c5c18206fede 100755 (executable)
@@ -155,7 +155,7 @@ test_off()
 {
        echo "turning quota off by remounting"
        _scratch_unmount
-       _qmount_option ""
+       _qmount_option "noquota"
        _qmount
 }
 
index c5e7508f8862edc43019402313cae5d799bc7bef..3ef6f5ddfdb2d6bf647970a4ba6bacbc6f374b7f 100755 (executable)
@@ -23,7 +23,18 @@ _require_xfs_quota
 # Only mount with the quota options we specify below
 _qmount_option "defaults"
 
-_scratch_mkfs >/dev/null 2>&1
+_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs >/dev/null
+. $tmp.mkfs
+cat $tmp.mkfs >> $seqres.full
+
+# link correct .out file, see $seqfull.cfg
+seqfull=$0
+if [ "$metadir" = 1 ]; then
+       _link_out_file_named $seqfull.out "metadir"
+else
+       _link_out_file_named $seqfull.out
+fi
+
 _scratch_mount "-o uquota"
 _scratch_unmount
 _scratch_xfs_db -r -c sb -c print  | grep qflags
diff --git a/tests/xfs/116.cfg b/tests/xfs/116.cfg
new file mode 100644 (file)
index 0000000..571f542
--- /dev/null
@@ -0,0 +1 @@
+metadir: metadir
similarity index 100%
rename from tests/xfs/116.out
rename to tests/xfs/116.out.default
diff --git a/tests/xfs/116.out.metadir b/tests/xfs/116.out.metadir
new file mode 100644 (file)
index 0000000..3a58fb9
--- /dev/null
@@ -0,0 +1,3 @@
+QA output created by 116
+qflags = 0x7
+qflags = 0x7
index 6c052cbc9b31f56010191b6bf141e44c58b6d77b..94428b35d22a875552d0215c5c25d4f65582abfa 100755 (executable)
@@ -194,7 +194,7 @@ test_off()
 {
        echo "checking off command (type=$type)"
        _scratch_unmount
-       _qmount_option ""
+       _qmount_option "noquota"
        _qmount
 }
 
index 74f982af65070f27e7fd7944c39a96f2bcb5181f..9f43aa32f6f42f141768246a59b517a0153378d5 100755 (executable)
@@ -158,6 +158,19 @@ post_exercise()
        return 0
 }
 
+qerase_mkfs_options() {
+       echo "$MKFS_OPTIONS" | sed \
+               -e 's/uquota//g' \
+               -e 's/gquota//g' \
+               -e 's/pquota//g' \
+               -e 's/uqnoenforce//g' \
+               -e 's/gqnoenforce//g' \
+               -e 's/pqnoenforce//g' \
+               -e 's/,,*/,/g'
+}
+
+MKFS_OPTIONS="$(qerase_mkfs_options)"
+
 # Create a list of fs features in the order that support for them was added
 # to the kernel driver.  For each feature upgrade test, we enable all the
 # features that came before it and none of the ones after, which means we're
index aedbc4795296d363096df2bddfb6568dc6432254..83ec8b959fa9de0082f026aab2a8e589fdd3da1b 100755 (executable)
@@ -27,6 +27,7 @@ function option_string()
        if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi;
        if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi;
        if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi;
+       if [ "$VAL" = "0" ]; then OPT=noquota; fi;
        echo $OPT
 }
 
index 64c1a5876cfa24853b8aea7899b8464e1de81c82..8682eee2680728530ba7ceb3f009cb6134a05570 100644 (file)
@@ -1,5 +1,5 @@
 QA output created by 263
-== Options: rw ==
+== Options: noquota ==
 == Options: usrquota,rw ==
 User quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON