mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: _require_chattr() must get an input arg
_require_chattr() was never intended to be called without an input argument (specifiying the required attribute to set). However, calling it without input arguments did work and error was silently discarded into full test output. Fix the function to abort on missing input argument and fix the only test that called _require_chattr() with no input argument. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
committed by
Eryu Guan
parent
073b2def71
commit
e1a49994e5
@@ -3134,18 +3134,21 @@ _require_test_lsattr()
|
||||
|
||||
_require_chattr()
|
||||
{
|
||||
attribute=$1
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: _require_chattr <attr>"
|
||||
exit 1
|
||||
fi
|
||||
local 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
|
||||
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()
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ rm -f $seqres.full
|
||||
_supported_fs overlay
|
||||
_supported_os Linux
|
||||
_require_scratch
|
||||
_require_chattr
|
||||
_require_chattr i
|
||||
|
||||
# Remove all files from previous tests
|
||||
_scratch_mkfs
|
||||
|
||||
Reference in New Issue
Block a user