]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/079,277: require chattr, not xattrs
authorHugh Dickins <hughd@google.com>
Thu, 18 Feb 2016 23:47:55 +0000 (10:47 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 18 Feb 2016 23:47:55 +0000 (10:47 +1100)
Add a new helper, _require_chattr, which allows the test to explicitly
check to see if the file system supports a specific chattr flag, as
not all file systems support chattr +A or chattr +i, and the presence
of extended attribute support is has nothing to do with a specific
chattr flag being supported.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc
tests/generic/079
tests/generic/277

index c0ec905e8db4e876ee4c83718b23f0e91687a14f..7a51f4f34bb454a8d4c8b05f1511470ac3fe7155 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3128,6 +3128,22 @@ _xfs_bmapx_find() {
        "$XFS_IO_PROG" -c "bmap -${param}lpv" "$file" | grep -c "$@"
 }
 
+_require_chattr()
+{
+    attribute=$1
+
+    touch $TEST_DIR/syscalltest
+    chattr "+$attribute" $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
+    status=$?
+    chattr "-$attribute" $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
+    if [ "$status" -ne 0 ]; then
+      _notrun "file system doesn't support chattr +$attribute"
+    fi
+    cat $TEST_DIR/syscalltest.out >> $seqres.full
+
+    rm -f $TEST_DIR/syscalltest.out
+}
+
 _get_total_inode()
 {
        if [ -z "$1" ]; then
index 041d9c0e913fd02f0cf700c3f7e6bb081be6916d..5cceeba0bfcd5324a366e9cf9b86a3a92301c087 100755 (executable)
@@ -48,7 +48,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_require_attrs
+_require_chattr i
 _require_scratch
 
 [ -x $timmutable ] || _notrun "t_immutable was not built for this platform"
index f92235bc5b434eb19c885eb19ef04b6a94126f1c..8e2a32fb0c20fb08d422c8bec792f7ca0810fa8d 100755 (executable)
@@ -44,7 +44,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _require_scratch
-_require_attrs
+_require_chattr A
 
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount