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 <cuibix...@huawei.com>
---
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

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to