Skip to content

Commit

Permalink
syscalls/utimensat01: "chattr" command error
Browse files Browse the repository at this point in the history
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 <cuibixuan@huawei.com>
  • Loading branch information
Cui Bixuan authored and metan-ucw committed May 4, 2015
1 parent 497564c commit 9af831c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions testcases/kernel/syscalls/utimensat/utimensat_tests.sh
Expand Up @@ -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
Expand Down

0 comments on commit 9af831c

Please sign in to comment.