All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP]  [PATCH] syscalls/utimensat01: "chattr" command error
@ 2015-03-31  3:16 cuibixuan
  2015-04-01 14:33 ` Cyril Hrubis
  0 siblings, 1 reply; 8+ messages in thread
From: cuibixuan @ 2015-03-31  3:16 UTC (permalink / raw)
  To: ltp-list

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:

incrementing stop
test sudo for -n option, non-interactive
sudo supports -n
chattr: Inappropriate ioctl for device while reading flags on /tmp/ltp-IiAnqhwQST/utimensat_tests/tmp_file
utimensat01    1  TBROK  :  ltpapicmd.c:190: the chattr command is not supported in test dir

Signed-off-by: Cui Bixuan <cuibixuan@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..972c81f 100755
--- a/ltp-master/testcases/kernel/syscalls/utimensat/utimensat_tests.sh
+++ b/ltp-master/testcases/kernel/syscalls/utimensat/utimensat_tests.sh
@@ -300,6 +300,15 @@ 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_resm TBROK "the chattr command is not supported in test dir"
+        exit 1
+fi
+
 cd $TEST_DIR
 chown root $LTPROOT/testcases/bin/$TEST_PROG
 chmod ugo+x,u+s $LTPROOT/testcases/bin/$TEST_PROG
-- 
1.8.2.2


------------------------------------------------------------------------------
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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-04 11:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31  3:16 [LTP] [PATCH] syscalls/utimensat01: "chattr" command error cuibixuan
2015-04-01 14:33 ` Cyril Hrubis
     [not found]   ` <551CB5CD.5030903@huawei.com>
2015-04-02  8:33     ` [LTP] [PATCH v2] " Cyril Hrubis
     [not found]       ` <552D1041.9010103@huawei.com>
2015-04-22 14:04         ` [LTP] [PATCH v4 1/2] syscalls/utimensat01: Use test.sh library for test case Cyril Hrubis
     [not found]           ` <55399C3A.70800@huawei.com>
2015-04-28 12:39             ` [LTP] [PATCH v5 " Cyril Hrubis
     [not found]       ` <552D112E.4040104@huawei.com>
2015-04-22 14:06         ` [LTP] [PATCH v4 2/2] syscalls/utimensat01: "chattr" command error Cyril Hrubis
     [not found]           ` <55399C8E.40608@huawei.com>
2015-04-28 12:39             ` [LTP] [PATCH v5 " Cyril Hrubis
     [not found]               ` <55402B94.9010407@huawei.com>
2015-05-04 11:35                 ` [LTP] [PATCH v6 " Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.