public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: maxin.john@gmail.com <maxin.john@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs
Date: Mon, 20 Mar 2017 16:32:37 +0200	[thread overview]
Message-ID: <1490020357-8073-1-git-send-email-maxin.john@gmail.com> (raw)

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


             reply	other threads:[~2017-03-20 14:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 14:32 maxin.john [this message]
2017-03-20 15:11 ` [LTP] [PATCH] setxattr: prefer not to run tests in tmpfs 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490020357-8073-1-git-send-email-maxin.john@gmail.com \
    --to=maxin.john@gmail.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox