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>
"$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
_supported_fs generic
_supported_os Linux
-_require_attrs
+_require_chattr i
_require_scratch
[ -x $timmutable ] || _notrun "t_immutable was not built for this platform"
_supported_fs generic
_supported_os Linux
_require_scratch
-_require_attrs
+_require_chattr A
_scratch_mkfs > /dev/null 2>&1
_scratch_mount