public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs
@ 2017-03-20 14:32 maxin.john
  2017-03-20 15:11 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: maxin.john @ 2017-03-20 14:32 UTC (permalink / raw)
  To: ltp

From: "Maxin B. John" <maxin.john@gmail.com>

1. Even though tmpfs supports extended attributes, running these tests
   on other filesystems will be relatively better for testing xattrs.

2. setxattr01 doesn't need root privileges to run

Signed-off-by: Maxin B. John <maxin.john@gmail.com>
---
 testcases/kernel/syscalls/setxattr/setxattr01.c |  7 ++-----
 testcases/kernel/syscalls/setxattr/setxattr02.c | 10 +++++++---
 testcases/kernel/syscalls/setxattr/setxattr03.c |  5 ++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/testcases/kernel/syscalls/setxattr/setxattr01.c b/testcases/kernel/syscalls/setxattr/setxattr01.c
index 478f994..e4f35dd 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr01.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr01.c
@@ -179,10 +179,6 @@ static void setup(void)
 {
 	int fd;
 
-	tst_require_root();
-
-	tst_tmpdir();
-
 	/* Test for xattr support */
 	fd = creat("testfile", 0644);
 	if (fd == -1)
@@ -219,7 +215,8 @@ static void setup(void)
 
 static void cleanup(void)
 {
-	tst_rmdir();
+	unlink("testfile");
+	unlink("setxattr01testfile");
 }
 #else /* HAVE_SYS_XATTR_H */
 int main(int argc, char *argv[])
diff --git a/testcases/kernel/syscalls/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c
index 73c464c..286f483 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr02.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr02.c
@@ -182,8 +182,6 @@ static void setup(void)
 
 	tst_require_root();
 
-	tst_tmpdir();
-
 	/* Test for xattr support */
 	fd = creat("testfile", 0644);
 	if (fd == -1)
@@ -232,7 +230,13 @@ static void setup(void)
 
 static void cleanup(void)
 {
-	tst_rmdir();
+	unlink(FILENAME);
+	unlink(SYMLINK);
+	unlink(FIFO);
+	unlink(CHR);
+	unlink(BLK);
+	unlink(SOCK);
+	rmdir(DIRNAME);
 }
 #else /* HAVE_SYS_XATTR_H */
 int main(int argc, char *argv[])
diff --git a/testcases/kernel/syscalls/setxattr/setxattr03.c b/testcases/kernel/syscalls/setxattr/setxattr03.c
index c09211e..ce71c67 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr03.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr03.c
@@ -164,8 +164,6 @@ static void setup(void)
 
 	tst_require_root();
 
-	tst_tmpdir();
-
 	/* Test for xattr support */
 	fd = creat("testfile", 0644);
 	if (fd == -1)
@@ -208,7 +206,8 @@ static void cleanup(void)
 	close(immu_fd);
 	close(append_fd);
 
-	tst_rmdir();
+	unlink(IMMU_FILE);
+	unlink(APPEND_FILE);
 }
 #else
 int main(void)
-- 
2.4.0


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

* [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs
  2017-03-20 14:32 [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs maxin.john
@ 2017-03-20 15:11 ` Cyril Hrubis
  2017-03-20 15:20   ` Maxin B. John
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2017-03-20 15:11 UTC (permalink / raw)
  To: ltp

Hi!
NACK tests must not create any files outside it's temporary directory.

We can either exit the test with TCONF if /tmp is on tmpfs or format and
mount a device and run these testcases on a file created there in that
case.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs
  2017-03-20 15:11 ` Cyril Hrubis
@ 2017-03-20 15:20   ` Maxin B. John
  2017-03-20 15:30     ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Maxin B. John @ 2017-03-20 15:20 UTC (permalink / raw)
  To: ltp

Hi Cyril,

On Mon, Mar 20, 2017 at 5:11 PM, Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
> NACK tests must not create any files outside it's temporary directory.

Ok.

> We can either exit the test with TCONF if /tmp is on tmpfs or format and
> mount a device and run these testcases on a file created there in that
> case.

Thanks for sharing your thoughts. It is clear now.

However, what about tests which fails by default on tmpfs like "fcntl" tests?
Should we default to the "/tmp" directory rather than mounting another device
and run the tests again ?

> --
> Cyril Hrubis
> chrubis@suse.cz

Best Regards,
Maxin

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

* [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs
  2017-03-20 15:20   ` Maxin B. John
@ 2017-03-20 15:30     ` Cyril Hrubis
  2017-03-20 15:41       ` Maxin B. John
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2017-03-20 15:30 UTC (permalink / raw)
  To: ltp

Hi!
> > We can either exit the test with TCONF if /tmp is on tmpfs or format and
> > mount a device and run these testcases on a file created there in that
> > case.
> 
> Thanks for sharing your thoughts. It is clear now.
> 
> However, what about tests which fails by default on tmpfs like "fcntl" tests?
> Should we default to the "/tmp" directory rather than mounting another device
> and run the tests again ?

Have a look at ftruncate04.c testcase, that falls back to mounting a
device over the directory the test uses if needed.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs
  2017-03-20 15:30     ` Cyril Hrubis
@ 2017-03-20 15:41       ` Maxin B. John
  0 siblings, 0 replies; 5+ messages in thread
From: Maxin B. John @ 2017-03-20 15:41 UTC (permalink / raw)
  To: ltp

Hi,

On Mon, Mar 20, 2017 at 5:30 PM, Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
>> > We can either exit the test with TCONF if /tmp is on tmpfs or format and
>> > mount a device and run these testcases on a file created there in that
>> > case.
>>
>> Thanks for sharing your thoughts. It is clear now.
>>
>> However, what about tests which fails by default on tmpfs like "fcntl" tests?
>> Should we default to the "/tmp" directory rather than mounting another device
>> and run the tests again ?
>
> Have a look at ftruncate04.c testcase, that falls back to mounting a
> device over the directory the test uses if needed.

That helps.  Thank you!

> --
> Cyril Hrubis
> chrubis@suse.cz

Warm Regards,
Maxin

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

end of thread, other threads:[~2017-03-20 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-20 14:32 [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs maxin.john
2017-03-20 15:11 ` Cyril Hrubis
2017-03-20 15:20   ` Maxin B. John
2017-03-20 15:30     ` Cyril Hrubis
2017-03-20 15:41       ` Maxin B. John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox