]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic: test xattr operations only
authorDarrick J. Wong <djwong@kernel.org>
Wed, 28 Jul 2021 00:10:24 +0000 (17:10 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 15 Aug 2021 15:51:28 +0000 (23:51 +0800)
Exercise extended attribute operations.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/642 [new file with mode: 0755]
tests/generic/642.out [new file with mode: 0644]

diff --git a/tests/generic/642 b/tests/generic/642
new file mode 100755 (executable)
index 0000000..c0e274d
--- /dev/null
@@ -0,0 +1,57 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2021 Oracle, Inc.  All Rights Reserved.
+#
+# FS QA Test No. 642
+#
+# Run an extended attributes fsstress run with multiple threads to shake out
+# bugs in the xattr code.
+#
+. ./common/preamble
+_begin_fstest auto soak attr long_rw stress
+
+_cleanup()
+{
+       $KILLALL_PROG -9 fsstress > /dev/null 2>&1
+       cd /
+       rm -f $tmp.*
+}
+
+# Modify as appropriate.
+_supported_fs generic
+
+_require_scratch
+_require_command "$KILLALL_PROG" "killall"
+
+echo "Silence is golden."
+
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
+
+nr_cpus=$((LOAD_FACTOR * 4))
+nr_ops=$((70000 * nr_cpus * TIME_FACTOR))
+
+args=('-z' '-S' 'c')
+
+# Do some directory tree modifications, but the bulk of this is geared towards
+# exercising the xattr code, especially attr_set which can do up to 10k values.
+for verb in unlink rmdir; do
+       args+=('-f' "${verb}=1")
+done
+for verb in creat mkdir; do
+       args+=('-f' "${verb}=2")
+done
+for verb in getfattr listfattr; do
+       args+=('-f' "${verb}=3")
+done
+for verb in attr_remove removefattr; do
+       args+=('-f' "${verb}=4")
+done
+args+=('-f' "setfattr=20")
+args+=('-f' "attr_set=60")     # sets larger xattrs
+
+$FSSTRESS_PROG "${args[@]}" $FSSTRESS_AVOID -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus >> $seqres.full
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/642.out b/tests/generic/642.out
new file mode 100644 (file)
index 0000000..7ab3fbd
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 642
+Silence is golden.