From: Cui B. <cui...@hu...> - 2015-04-29 00:54:16
|
The "chattr" command in case failed in some file system(such as memory fs): 'chattr: Inappropriate ioctl for device while reading flags on' I learn that chattr command only can be used in ext2 or ext3 (ext4 is ok now). So we check it before running. Signed-off-by: Cui Bixuan <cui...@hu...> --- v6: remove the TEST_DIR before tst_brkm TCONF .../kernel/syscalls/utimensat/utimensat_tests.sh | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh index 6bc2030..6adc042 100755 --- a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh +++ b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh @@ -295,6 +295,15 @@ nuke_sudoers() } sudo $s_arg -u $test_user mkdir -p $TEST_DIR + +# Make sure chattr command is supported +touch $TEST_DIR/tmp_file +chattr +a $TEST_DIR/tmp_file +if [ $? -ne 0 ] ; then + rm -rf $TEST_DIR + tst_brkm TCONF "chattr not supported" +fi + cd $TEST_DIR chown root $LTPROOT/testcases/bin/$TEST_PROG chmod ugo+x,u+s $LTPROOT/testcases/bin/$TEST_PROG -- 1.6.0.2 |