public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/4] mqns: strip leading / from mq names
@ 2010-04-28 21:09 Serge E. Hallyn
  2010-04-28 21:09 ` [LTP] [PATCH 2/4] pidns30: strip leading / from name passed to mq_open Serge E. Hallyn
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Serge E. Hallyn @ 2010-04-28 21:09 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: LTP list

So the tests can pass

Signed-off-by: Serge Hallyn <serue@us.ibm.com>
---
 testcases/kernel/containers/mqns/mqns.h    |    2 ++
 testcases/kernel/containers/mqns/mqns_01.c |    8 ++++----
 testcases/kernel/containers/mqns/mqns_02.c |    8 ++++----
 testcases/kernel/containers/mqns/mqns_03.c |    2 +-
 testcases/kernel/containers/mqns/mqns_04.c |    2 +-
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/testcases/kernel/containers/mqns/mqns.h b/testcases/kernel/containers/mqns/mqns.h
index e5912d5..1c624c2 100644
--- a/testcases/kernel/containers/mqns/mqns.h
+++ b/testcases/kernel/containers/mqns/mqns.h
@@ -10,6 +10,8 @@
 #define DEV_MQUEUE "/dev/mqueue"
 #define DEV_MQUEUE2 "/dev/mqueue2"
 #define SLASH_MQ1 "/MQ1"
+#define NOSLASH_MQ1 "MQ1"
 #define SLASH_MQ2 "/MQ2"
+#define NOSLASH_MQ2 "MQ2"
 
 #endif /* __MQNS_H */
diff --git a/testcases/kernel/containers/mqns/mqns_01.c b/testcases/kernel/containers/mqns/mqns_01.c
index 7f41b2d..515ed51 100644
--- a/testcases/kernel/containers/mqns/mqns_01.c
+++ b/testcases/kernel/containers/mqns/mqns_01.c
@@ -55,7 +55,7 @@ int check_mqueue(void *vtest)
 
 	if (read(p1[0], buf, strlen("go") + 1) < 0)
 		tst_resm(TBROK | TERRNO, "read(p1[0], ...) failed");
-	mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDONLY);
+	mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY);
 	if (mqd == -1) {
 		if (write(p2[1], "notfnd", strlen("notfnd") + 1) < 0)
 			tst_resm(TBROK | TERRNO, "write(p2[1], ...) failed");
@@ -86,7 +86,7 @@ main(int argc, char *argv[])
 	if (pipe(p1) == -1) { perror("pipe"); exit(EXIT_FAILURE); }
 	if (pipe(p2) == -1) { perror("pipe"); exit(EXIT_FAILURE); }
 
-	mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777,
+	mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777,
 			NULL);
 	if (mqd == -1) {
 		perror("mq_open");
@@ -100,7 +100,7 @@ main(int argc, char *argv[])
 	if (r < 0) {
 		tst_resm(TFAIL, "failed clone/unshare\n");
 		mq_close(mqd);
-		syscall(__NR_mq_unlink, SLASH_MQ1);
+		syscall(__NR_mq_unlink, NOSLASH_MQ1);
 		tst_exit();
 	}
 
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
 
 	/* destroy the mqueue */
 	mq_close(mqd);
-	syscall(__NR_mq_unlink, SLASH_MQ1);
+	syscall(__NR_mq_unlink, NOSLASH_MQ1);
 
 	tst_exit();
 }
diff --git a/testcases/kernel/containers/mqns/mqns_02.c b/testcases/kernel/containers/mqns/mqns_02.c
index aa78f65..8f783ba 100644
--- a/testcases/kernel/containers/mqns/mqns_02.c
+++ b/testcases/kernel/containers/mqns/mqns_02.c
@@ -60,7 +60,7 @@ int check_mqueue(void *vtest)
 		tst_resm(TBROK | TERRNO, "read(p1[0], ..) failed");
 	else {
 
-		mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL,
+		mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL,
 				0777, NULL);
 		if (mqd == -1) {
 			if (write(p2[1], "mqfail", strlen("mqfail") + 1) < 0) {
@@ -86,9 +86,9 @@ int check_mqueue(void *vtest)
 						tst_resm(TBROK | TERRNO,
 							"mq_close(mqd) failed");
 					} else if (syscall(__NR_mq_unlink,
-							SLASH_MQ1) < 0) {
+							NOSLASH_MQ1) < 0) {
 						tst_resm(TBROK | TERRNO,
-							"mq_unlink(" SLASH_MQ1
+							"mq_unlink(" NOSLASH_MQ1
 							") failed");
 					} else if (write(p2[1], "done",
 							strlen("done") + 1)
@@ -153,7 +153,7 @@ int main(int argc, char *argv[])
 		tst_exit();
 	} else {
 
-		mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDONLY);
+		mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY);
 		if (mqd == -1) {
 			tst_resm(TPASS, "Parent process can't see the mqueue\n");
 		} else {
diff --git a/testcases/kernel/containers/mqns/mqns_03.c b/testcases/kernel/containers/mqns/mqns_03.c
index 3c9e83e..83db75c 100644
--- a/testcases/kernel/containers/mqns/mqns_03.c
+++ b/testcases/kernel/containers/mqns/mqns_03.c
@@ -63,7 +63,7 @@ int check_mqueue(void *vtest)
 
 	read(p1[0], buf, 3); /* go */
 
-	mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755,
+	mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755,
 			NULL);
 	if (mqd == -1) {
 		write(p2[1], "mqfail", 7);
diff --git a/testcases/kernel/containers/mqns/mqns_04.c b/testcases/kernel/containers/mqns/mqns_04.c
index 8a4a9c2..98d4e39 100644
--- a/testcases/kernel/containers/mqns/mqns_04.c
+++ b/testcases/kernel/containers/mqns/mqns_04.c
@@ -59,7 +59,7 @@ int check_mqueue(void *vtest)
 
 	read(p1[0], buf, 3); /* go */
 
-	mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755,
+	mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755,
 			NULL);
 	if (mqd == -1) {
 		write(p2[1], "mqfail", 7);
-- 
1.7.0


------------------------------------------------------------------------------
_______________________________________________
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:[~2010-04-29  2:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-28 21:09 [LTP] [PATCH 1/4] mqns: strip leading / from mq names Serge E. Hallyn
2010-04-28 21:09 ` [LTP] [PATCH 2/4] pidns30: strip leading / from name passed to mq_open Serge E. Hallyn
2010-04-28 23:02   ` Garrett Cooper
2010-04-28 21:09 ` [LTP] [PATCH 3/4] mqns2: fix some error checking and reporting Serge E. Hallyn
2010-04-28 23:02   ` Garrett Cooper
2010-04-28 21:10 ` [LTP] [PATCH 4/4] mqns04.c: don't exit strangely in clone case (please read) Serge E. Hallyn
2010-04-28 23:04 ` [LTP] [PATCH 1/4] mqns: strip leading / from mq names Garrett Cooper
2010-04-29  0:29   ` Serge E. Hallyn

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