Run testcase "utimensat01":

Pathname test
chattr: Inappropriate ioctl for device while reading flags on 
/tmp/ltp-FAAVCPyWnz/utimensat_tests/utimensat.test_file
./utimensat01 -q /tmp/ltp-FAAVCPyWnz/utimensat_tests/utimensat.test_file 0 n 0 o
EXPECTED: EPERM
RESULT:   SUCCESS 1421205831 0
FAILED test 46

Readable file descriptor (futimens(3)) test
chattr: Inappropriate ioctl for device while reading flags on 
/tmp/ltp-FAAVCPyWnz/utimensat_tests/utimensat.test_file
./utimensat01 -q -d /tmp/ltp-FAAVCPyWnz/utimensat_tests/utimensat.test_file 
NULL 0 n 0 o
EXPECTED: EPERM
RESULT:   SUCCESS 1421205834 0
FAILED test 47
...
Failed tests:  46 47 48 49 50 51 52 53 54 55 56 57 58 61 62 63 64 65 66 67 68 
69 70 73 74 75 76 77 78

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 and test log on no-ext2 file system:

<<<test_output>>>
incrementing stop
test sudo for -n option, non-interactive
sudo supports -n
chattr: Inappropriate ioctl for device while reading flags on 
/tmp/ltp-eOFHLGLbuz/utimensat_tests/tmp_file
utimensat01 1 TCONF : the chattr command is not supported in test dir

results/log:
-----------------------------------------
Testcase                       Result     Exit Value
--------                       ------     ----------
utimensat01                    CONF       32

Signed-off-by: Cui Bixuan <cuibix...@huawei.com>
---
 .../testcases/kernel/syscalls/utimensat/utimensat_tests.sh       | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ltp-master/testcases/kernel/syscalls/utimensat/utimensat_tests.sh 
b/ltp-master/testcases/kernel/syscalls/utimensat/utimensat_tests.sh
index b8eba51..f6a4247 100755
--- a/ltp-master/testcases/kernel/syscalls/utimensat/utimensat_tests.sh
+++ b/ltp-master/testcases/kernel/syscalls/utimensat/utimensat_tests.sh
@@ -24,6 +24,7 @@
 export TCID=utimensat01
 export TST_TOTAL=99
 export TST_COUNT=0
+. test.sh

 if tst_kvercmp 2 6 22 ; then
        tst_resm TCONF "System kernel version is less than 2.6.22"
@@ -300,6 +301,14 @@ nuke_sudoers()
 }

 sudo $s_arg -u $test_user mkdir -p $TEST_DIR
+
+# Make sure chattr command is supported in test dir
+touch $TEST_DIR/tmp_file
+chattr +a $TEST_DIR/tmp_file
+if [ $? -ne 0 ] ; then
+        tst_brkm TCONF "the chattr command is not supported in test dir"
+fi
+
 cd $TEST_DIR
 chown root $LTPROOT/testcases/bin/$TEST_PROG
 chmod ugo+x,u+s $LTPROOT/testcases/bin/$TEST_PROG

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to