Skip to contentSkip to conversation

Refactor mqns testing suite

PATCH Superseded Andrea Cervesato via ltp 2 participants 11 messages Feb 16, 2023 – Mar 1, 2023

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover Refactor mqns testing suite

Refactoring mqns testing suite and removing libclone dependency.

Andrea Cervesato (6):
Refactor mqns_01 using new LTP API
Refactor mqns_02 using new LTP API
Refactor mqns_03 using new LTP API
Refactor mqns_04 using new LTP API
Remove deprecated header files from mqns suite
Remove libclone dependency from mqns suite

 runtest/containers                            |  13 +-
 testcases/kernel/containers/mqns/Makefile     |  27 +-
 testcases/kernel/containers/mqns/mqns.h       |  11 -
 testcases/kernel/containers/mqns/mqns_01.c    | 180 ++++-------
 testcases/kernel/containers/mqns/mqns_02.c    | 241 +++++---------
 testcases/kernel/containers/mqns/mqns_03.c    | 298 +++++++-----------
 testcases/kernel/containers/mqns/mqns_04.c    | 273 +++++++---------
 .../kernel/containers/mqns/mqns_helper.h      |  53 ----
 8 files changed, 392 insertions(+), 704 deletions(-)
 delete mode 100644 testcases/kernel/containers/mqns/mqns.h
 delete mode 100644 testcases/kernel/containers/mqns/mqns_helper.h
Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH v4 1/6 Refactor mqns_01 using new LTP API

---
 runtest/containers                         |   3 +-
 testcases/kernel/containers/mqns/mqns_01.c | 180 +++++++--------------
 2 files changed, 57 insertions(+), 126 deletions(-)
runtest/containers +2 -1
index 23f394579..5e1b53bfa 100644
@@ -16,7 +16,8 @@ pidns31 pidns31
 pidns32 pidns32
 
 mqns_01 mqns_01
-mqns_01_clone mqns_01 -clone
+mqns_01_clone mqns_01 -m clone
+mqns_01_unshare mqns_01 -m unshare
 mqns_02 mqns_02
 mqns_02_clone mqns_02 -clone
 mqns_03 mqns_03
testcases/kernel/containers/mqns/mqns_01.c +55 -125

203 lines not on this page · raw message

Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

PATCH v4 2/6 Refactor mqns_02 using new LTP API

In reply to Andrea Cervesato via ltp
---
 runtest/containers                         |   3 +-
 testcases/kernel/containers/mqns/mqns_02.c | 241 +++++++--------------
 2 files changed, 86 insertions(+), 158 deletions(-)
runtest/containers +2 -1
index 5e1b53bfa..dbb4c5fa6 100644
@@ -19,7 +19,8 @@ mqns_01 mqns_01
 mqns_01_clone mqns_01 -m clone
 mqns_01_unshare mqns_01 -m unshare
 mqns_02 mqns_02
-mqns_02_clone mqns_02 -clone
+mqns_02_clone mqns_02 -m clone
+mqns_02_unshare mqns_02 -m unshare
 mqns_03 mqns_03
 mqns_03_clone mqns_03 -clone
 mqns_04 mqns_04
testcases/kernel/containers/mqns/mqns_02.c +84 -157

264 lines not on this page · raw message

Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

PATCH v4 3/6 Refactor mqns_03 using new LTP API

In reply to Andrea Cervesato via ltp
---
 runtest/containers                         |   3 +-
 testcases/kernel/containers/mqns/mqns_03.c | 298 +++++++++------------
 2 files changed, 122 insertions(+), 179 deletions(-)
runtest/containers +2 -1
index dbb4c5fa6..1cc6c838d 100644
@@ -22,7 +22,8 @@ mqns_02 mqns_02
 mqns_02_clone mqns_02 -m clone
 mqns_02_unshare mqns_02 -m unshare
 mqns_03 mqns_03
-mqns_03_clone mqns_03 -clone
+mqns_03_clone mqns_03 -m clone
+mqns_03_unshare mqns_03 -m unshare
 mqns_04 mqns_04
 mqns_04_clone mqns_04 -clone
 
testcases/kernel/containers/mqns/mqns_03.c +120 -178

327 lines not on this page · raw message

Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw

Re: [LTP] [PATCH v4 3/6] Refactor mqns_03 using new LTP API

Hello,

Quoted 317 lines · Andrea Cervesato via ltp
---
 runtest/containers                         |   3 +-
 testcases/kernel/containers/mqns/mqns_03.c | 298 +++++++++------------
 2 files changed, 122 insertions(+), 179 deletions(-)
runtest/containers +2 -1
index dbb4c5fa6..1cc6c838d 100644
@@ -22,7 +22,8 @@ mqns_02 mqns_02
 mqns_02_clone mqns_02 -m clone
 mqns_02_unshare mqns_02 -m unshare
 mqns_03 mqns_03
-mqns_03_clone mqns_03 -clone
+mqns_03_clone mqns_03 -m clone
+mqns_03_unshare mqns_03 -m unshare
 mqns_04 mqns_04
 mqns_04_clone mqns_04 -clone
 
testcases/kernel/containers/mqns/mqns_03.c +104 -161
index a7452b970..3c28292c1 100644
@@ -1,207 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
-* Copyright (c) International Business Machines Corp., 2009
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
-* the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*
-* Author: Serge Hallyn <[email protected]>
-*
-* Check ipcns+sb longevity
-*
-* Mount mqueue fs
-* unshare
-* In unshared process:
-*    Create "/mq1" with mq_open()
-*    Mount mqueuefs
-*    Check that /mq1 exists
-*    Create /dev/mqueue/mq2 through vfs (create(2))
-*    Umount /dev/mqueue
-*    Remount /dev/mqueue
-*    Check that both /mq1 and /mq2 exist
-
-***************************************************************************/
-
-#ifndef _GNU_SOURCE
+ * Copyright (c) International Business Machines Corp., 2009
+ * Copyright (c) Serge Hallyn <[email protected]>
+ * Copyright (C) 2023 SUSE LLC Andrea Cervesato <[email protected]>
+ */
+
+/*\
+ * [Description]
+ *
+ * Test mqueuefs from an isolated/forked process namespace.
+ *
+ * [Algorithm]
+ *
+ * - create /MQ1
+ * - mount mqueue inside the temporary folder
+ * - check for /MQ1 existance
+ * - create /MQ2 inside the temporary folder
+ * - umount
+ * - mount mqueue inside the temporary folder
+ * - check /MQ1 existance
+ * - check /MQ2 existance
+ * - umount
+ */
 #define _GNU_SOURCE
-#endif
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include "mqns.h"
-#include "mqns_helper.h"
-
-char *TCID = "posixmq_namespace_03";
-int TST_TOTAL = 1;
-
-int p1[2];
-int p2[2];
-
-#define FNAM1 DEV_MQUEUE2 SLASH_MQ1
-#define FNAM2 DEV_MQUEUE2 SLASH_MQ2
-
-int check_mqueue(void *vtest)
+
+#include "tst_test.h"
+#include "lapi/sched.h"
+#include "tst_safe_posix_ipc.h"
+#include "tst_safe_stdio.h"
+
+#define MQNAME1 "/MQ1"
+#define MQNAME2 "/MQ2"
+
+static char *str_op;
+static char *devdir;
+static char *mqueue1;
+static char *mqueue2;
+static int *mq_freed;
+
+static void check_mqueue(void)
 {
-	char buf[30];
-	mqd_t mqd;
 	int rc;
+	mqd_t mqd;
 	struct stat statbuf;
 
-	(void) vtest;
+	mqd = SAFE_MQ_OPEN(MQNAME1, O_RDWR | O_CREAT | O_EXCL, 0777, NULL);
 
-	close(p1[1]);
-	close(p2[0]);
+	SAFE_MQ_CLOSE(mqd);
 
-	if (read(p1[0], buf, 3) != 3) {	/* go */
-		perror("read failed");
-		exit(1);
-	}
+	SAFE_MOUNT("mqueue", devdir, "mqueue", 0, NULL);
 
-	mqd = tst_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL,
-		0755, NULL);
-	if (mqd == -1) {
-		write(p2[1], "mqfail", 7);
-		exit(1);
-	}
+	SAFE_STAT(mqueue1, &statbuf);
+	tst_res(TPASS, "%s exists at first mount", mqueue1);
 
-	mq_close(mqd);
+	rc = SAFE_CREAT(mqueue2, 0755);
+	SAFE_CLOSE(rc);
 
-	rc = mount("mqueue", DEV_MQUEUE2, "mqueue", 0, NULL);
-	if (rc == -1) {
-		write(p2[1], "mount1", 7);
-		exit(1);
-	}
+	SAFE_UMOUNT(devdir);
 
-	rc = stat(FNAM1, &statbuf);
-	if (rc == -1) {
-		write(p2[1], "stat1", 6);
-		exit(1);
-	}
+	SAFE_MOUNT("mqueue", devdir, "mqueue", 0, NULL);
 
-	rc = creat(FNAM2, 0755);
-	if (rc == -1) {
-		write(p2[1], "creat", 6);
-		exit(1);
-	}
+	SAFE_STAT(mqueue1, &statbuf);
+	tst_res(TPASS, "%s exists at second mount", mqueue1);
 
-	close(rc);
+	SAFE_STAT(mqueue2, &statbuf);
+	tst_res(TPASS, "%s exists at second mount", mqueue2);
 
-	rc = umount(DEV_MQUEUE2);
-	if (rc == -1) {
-		write(p2[1], "umount", 7);
-		exit(1);
-	}
+	SAFE_UMOUNT(devdir);
 
-	rc = mount("mqueue", DEV_MQUEUE2, "mqueue", 0, NULL);
-	if (rc == -1) {
-		write(p2[1], "mount2", 7);
-		exit(1);
-	}
+	SAFE_MQ_UNLINK(MQNAME1);
+	SAFE_MQ_UNLINK(MQNAME2);
 
-	rc = stat(FNAM1, &statbuf);
-	if (rc == -1) {
-		write(p2[1], "stat2", 7);
-		exit(1);
-	}
+	*mq_freed = 1;
+}
 
-	rc = stat(FNAM2, &statbuf);
-	if (rc == -1) {
-		write(p2[1], "stat3", 7);
-		exit(1);
+static void run(void)
+{
+	const struct tst_clone_args clone_args = { CLONE_NEWIPC, SIGCHLD };
+
+	tst_res(TINFO, "Checking correct umount+remount of mqueuefs");
+
+	if (str_op && !strcmp(str_op, "clone")) {
+		tst_res(TINFO, "Spawning isolated process");
+
+		if (!SAFE_CLONE(&clone_args)) {
+			check_mqueue();
+			return;
+		}
+	} else if (str_op && !strcmp(str_op, "unshare")) {
+		tst_res(TINFO, "Spawning unshared process");
+
+		if (!SAFE_FORK()) {
+			SAFE_UNSHARE(CLONE_NEWIPC);
+			check_mqueue();
+			return;
+		}
+	} else {
+		tst_res(TINFO, "Spawning plain process");
+
+		if (!SAFE_FORK()) {
+			check_mqueue();
+			return;
+		}
 	}
-
-	write(p2[1], "done", 5);
-
-	exit(0);
 }
 
 static void setup(void)
 {
-	tst_require_root();
-	check_mqns();
+	char *tmpdir;
+
+	tmpdir = tst_get_tmpdir();
+
+	SAFE_ASPRINTF(&devdir, "%s/mqueue", tmpdir);
+	SAFE_MKDIR(devdir, 0755);
+
+	SAFE_ASPRINTF(&mqueue1, "%s" MQNAME1, devdir);
+	SAFE_ASPRINTF(&mqueue2, "%s" MQNAME2, devdir);
+
+	mq_freed = SAFE_MMAP(NULL,
+		sizeof(int),
+		PROT_READ | PROT_WRITE,
+		MAP_SHARED | MAP_ANONYMOUS,
+		-1, 0);
 }
 
-int main(int argc, char *argv[])
+static void cleanup(void)
 {
-	int r;
-	char buf[30];
-	int use_clone = T_UNSHARE;
-
-	setup();
-
-	if (argc == 2 && strcmp(argv[1], "-clone") == 0) {
-		tst_resm(TINFO, "Testing posix mq namespaces through clone(2)");
-		use_clone = T_CLONE;
-	} else
-		tst_resm(TINFO,
-			 "Testing posix mq namespaces through unshare(2)");
-
-	if (pipe(p1) == -1 || pipe(p2) == -1)
-		tst_brkm(TBROK | TERRNO, NULL, "pipe failed");
-
-	/* fire off the test */
-	r = do_clone_unshare_test(use_clone, CLONE_NEWIPC, check_mqueue, NULL);
-	if (r < 0) {
-		tst_brkm(TBROK | TERRNO, NULL, "failed clone/unshare");
-	}
+	if (tst_is_mounted(devdir))
+		SAFE_UMOUNT(devdir);
 
-	tst_resm(TINFO, "Checking correct umount+remount of mqueuefs");
-
-	mkdir(DEV_MQUEUE2, 0755);
-
-	close(p1[0]);
-	close(p2[1]);
-	write(p1[1], "go", 3);
-
-	read(p2[0], buf, 7);
-	r = TFAIL;
-	if (!strcmp(buf, "mqfail")) {
-		tst_resm(TFAIL, "child process could not create mqueue");
-		goto fail;
-	} else if (!strcmp(buf, "mount1")) {
-		tst_resm(TFAIL, "child process could not mount mqueue");
-		goto fail;
-	} else if (!strcmp(buf, "stat1x")) {
-		tst_resm(TFAIL, "mq created by child is not in mqueuefs");
-		goto fail;
-	} else if (!strcmp(buf, "creat")) {
-		tst_resm(TFAIL, "child couldn't creat mq through mqueuefs");
-		goto fail;
-	} else if (!strcmp(buf, "umount")) {
-		tst_resm(TFAIL, "child couldn't umount mqueuefs");
-		goto fail;
-	} else if (!strcmp(buf, "mount2")) {
-		tst_resm(TFAIL, "child couldn't remount mqueuefs");

testcases/kernel/containers/mqns/mqns_03.c line 132

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_03.c +1 -9
-		goto fail;
-	} else if (!strcmp(buf, "stat2")) {
-		tst_resm(TFAIL,
-			 "mq_open()d file gone after remount of mqueuefs");
-		goto fail;
-	} else if (!strcmp(buf, "stat3")) {
-		tst_resm(TFAIL,
-			 "creat(2)'d file gone after remount of mqueuefs");
-		goto fail;
+	if (!*mq_freed) {

You should probably access mq_freed with tst_atomic. It's not marked as volatile so the compiler may optimise it out.

That's maybe moot though because wouldn't it make more sense to check if the file exists and delete it?

Quoted 27 lines
testcases/kernel/containers/mqns/mqns_03.c +15 -8
+		SAFE_MQ_UNLINK(MQNAME1);
+		SAFE_MQ_UNLINK(MQNAME2);
 	}
-
-	tst_resm(TPASS, "umount+remount of mqueuefs remounted the right fs");
-
-	r = 0;
-fail:
-	umount(DEV_MQUEUE2);
-	rmdir(DEV_MQUEUE2);
-	tst_exit();
 }
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_root = 1,
+	.forks_child = 1,
+	.needs_tmpdir = 1,
+	.options = (struct tst_option[]) {
+		{ "m:", &str_op, "Test execution mode <clone|unshare>" },
+		{},
+	},
+};
Signature · 1 line
2.35.3
Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

PATCH v4 4/6 Refactor mqns_04 using new LTP API

In reply to Andrea Cervesato via ltp
---
 runtest/containers                         |   4 +-
 testcases/kernel/containers/mqns/mqns_04.c | 273 +++++++++------------
 2 files changed, 122 insertions(+), 155 deletions(-)
runtest/containers +2 -2
index 1cc6c838d..318113e19 100644
@@ -24,8 +24,8 @@ mqns_02_unshare mqns_02 -m unshare
 mqns_03 mqns_03
 mqns_03_clone mqns_03 -m clone
 mqns_03_unshare mqns_03 -m unshare
-mqns_04 mqns_04
-mqns_04_clone mqns_04 -clone
+mqns_04_clone mqns_04 -m clone
+mqns_04_unshare mqns_04 -m unshare
 
 netns_netlink netns_netlink
 netns_breakns_ip_ipv4_netlink netns_breakns.sh
testcases/kernel/containers/mqns/mqns_04.c +120 -153

307 lines not on this page · raw message

Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#6 lore raw

Re: [LTP] [PATCH v4 4/6] Refactor mqns_04 using new LTP API

Hello,

Quoted 95 lines · Andrea Cervesato via ltp
---
 runtest/containers                         |   4 +-
 testcases/kernel/containers/mqns/mqns_04.c | 273 +++++++++------------
 2 files changed, 122 insertions(+), 155 deletions(-)
runtest/containers +2 -2
index 1cc6c838d..318113e19 100644
@@ -24,8 +24,8 @@ mqns_02_unshare mqns_02 -m unshare
 mqns_03 mqns_03
 mqns_03_clone mqns_03 -m clone
 mqns_03_unshare mqns_03 -m unshare
-mqns_04 mqns_04
-mqns_04_clone mqns_04 -clone
+mqns_04_clone mqns_04 -m clone
+mqns_04_unshare mqns_04 -m unshare
 
 netns_netlink netns_netlink
 netns_breakns_ip_ipv4_netlink netns_breakns.sh
testcases/kernel/containers/mqns/mqns_04.c +26 -40
index d07a85c04..93df61ec4 100644
@@ -1,187 +1,154 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
-* Copyright (c) International Business Machines Corp., 2009
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
-* the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*
-* Author: Serge Hallyn <[email protected]>
-*
-* Check mqueuefs lifetime
-* . parent creates /dev/mqueue2
-* . child mounts mqueue there
-* . child does mq_open("/ab")
-* . parent checks for /dev/mqueue2
-* . child exits
-* . parent checks for /dev/mqueue2
-* . parent tries 'touch /dev/mqueue2/dd' -> should fail
-* . parent umounts /dev/mqueue2
-
-***************************************************************************/
-
-#ifndef _GNU_SOURCE
+ * Copyright (c) International Business Machines Corp., 2009
+ * Copyright (c) Serge Hallyn <[email protected]>
+ * Copyright (C) 2023 SUSE LLC Andrea Cervesato <[email protected]>
+ */
+
+/*\
+ * [Description]
+ *
+ * Test mqueuefs manipulation from child/parent namespaces.
+ *
+ * [Algorithm]
+ *
+ * - parent creates mqueue folder in <tmpdir>
+ * - child mounts mqueue there
+ * - child creates /MQ1 mqueue
+ * - parent checks for <tmpdir>/mqueue/MQ1 existence
+ * - child exits
+ * - parent checks for <tmpdir>/mqueue/MQ1 existence
+ * - parent tries 'touch <tmpdir>/mqueue/MQ2' -> should fail
+ * - parent umount mqueuefs
+ */
 #define _GNU_SOURCE
-#endif
-#include <sys/types.h>
-#include <sys/stat.h>
+
 #include <sys/wait.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include "mqns.h"
-#include "mqns_helper.h"
+#include "tst_test.h"
+#include "lapi/sched.h"
+#include "tst_safe_posix_ipc.h"

testcases/kernel/containers/mqns/mqns_04.c line 35

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +4 -4
+#include "tst_safe_stdio.h"
 
-char *TCID = "posixmq_namespace_04";
-int TST_TOTAL = 1;
+#define CHECK_MQ_OPEN_RET(x) ((x) >= 0 || ((x) == -1 && errno != EMFILE))
 
-int p1[2];
-int p2[2];
+#define MQNAME1 "/MQ1"
+#define MQNAME2 "/MQ2"

/MQ2 is never created

Quoted 49 lines
testcases/kernel/containers/mqns/mqns_04.c +26 -15
-#define FNAM1 DEV_MQUEUE2 SLASH_MQ1
-#define FNAM2 DEV_MQUEUE2 SLASH_MQ2
+static char *str_op;
+static char *devdir;
+static char *mqueue1;
+static char *mqueue2;
+static int *mq_freed;
 
-int check_mqueue(void *vtest)
+static void check_mqueue(void)
 {
-	char buf[30];
 	mqd_t mqd;
-	int rc;
 
-	(void) vtest;
+	mqd = TST_RETRY_FUNC(
+		mq_open(MQNAME1, O_RDWR | O_CREAT | O_EXCL, 0755, NULL),
+		CHECK_MQ_OPEN_RET);
+	if (mqd == -1)
+		tst_brk(TBROK | TERRNO, "mq_open failed");
 
-	close(p1[1]);
-	close(p2[0]);
+	SAFE_MQ_CLOSE(mqd);
 
-	read(p1[0], buf, 3);	/* go */
+	SAFE_MOUNT("mqueue", devdir, "mqueue", 0, NULL);
 
-	mqd = tst_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL,
-		0755, NULL);
-	if (mqd == -1) {
-		write(p2[1], "mqfail", 7);
-		tst_exit();
-	}
+	TST_CHECKPOINT_WAKE_AND_WAIT(0);
+}
+
+static void run(void)
+{
+	const struct tst_clone_args clone_args = { CLONE_NEWIPC, SIGCHLD };
+	int status;
+	struct stat statbuf;
+
+	tst_res(TINFO, "Checking mqueue filesystem lifetime");
+
+	if (str_op && !strcmp(str_op, "clone")) {
+		tst_res(TINFO, "Spawning isolated process");

testcases/kernel/containers/mqns/mqns_04.c line 76

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +6 -2
 
-	mq_close(mqd);
+		if (!SAFE_CLONE(&clone_args)) {
+			check_mqueue();
+			return;
+		}
+	} else if (str_op && !strcmp(str_op, "unshare")) {
+		tst_res(TINFO, "Spawning unshared process");
 
-	rc = mount("mqueue", DEV_MQUEUE2, "mqueue", 0, NULL);

Possibly this is a mistake in the original test. Do we really need to remount mqueuefs? Isn't it just the same FS in a different location?

This thing that really makes a difference is that the child is in a new namespace, so the parent and child should not see each others queues?

Quoted 28 lines
testcases/kernel/containers/mqns/mqns_04.c +9 -14
-	if (rc == -1) {
-		perror("mount");
-		write(p2[1], "mount", 6);
-		tst_exit();
+		if (!SAFE_FORK()) {
+			SAFE_UNSHARE(CLONE_NEWIPC);
+			check_mqueue();
+			return;
+		}
 	}
 
-	write(p2[1], "go", 3);
-	read(p1[0], buf, 3);
+	TST_CHECKPOINT_WAIT(0);
 
-	tst_exit();
-}
+	SAFE_STAT(mqueue1, &statbuf);
+	tst_res(TPASS, "%s child's mqueue can be accessed from parent", mqueue1);
 
-static void setup(void)
-{
-	tst_require_root();
-	check_mqns();
-}
+	TST_CHECKPOINT_WAKE(0);
 
-int main(int argc, char *argv[])

testcases/kernel/containers/mqns/mqns_04.c line 94

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +2 -7
-{
-	int rc;
-	int status;
-	char buf[30];
-	struct stat statbuf;
-	int use_clone = T_UNSHARE;
+	tst_res(TINFO, "Waiting child to exit");
 
-	setup();
+	SAFE_WAIT(&status);

Again we can just use tst_reap_children() which does a thorough check of the child status.

Quoted 25 lines
testcases/kernel/containers/mqns/mqns_04.c +5 -16
-	if (argc == 2 && strcmp(argv[1], "-clone") == 0) {
-		tst_resm(TINFO,
-			 "Testing posix mq namespaces through clone(2).");
-		use_clone = T_CLONE;
-	} else
-		tst_resm(TINFO,
-			 "Testing posix mq namespaces through unshare(2).");
+	if (!WIFEXITED(status))
+		tst_brk(TBROK, "Child did not exit normally: %s", tst_strstatus(status));
 
-	if (pipe(p1) == -1) {
-		perror("pipe");
-		exit(EXIT_FAILURE);
-	}
-	if (pipe(p2) == -1) {
-		perror("pipe");
-		exit(EXIT_FAILURE);
-	}
+	SAFE_STAT(mqueue1, &statbuf);
+	tst_res(TPASS, "%s child's mqueue can be accessed from parent after child's dead", mqueue1);
 
-	mkdir(DEV_MQUEUE2, 0755);
+	TST_EXP_FAIL(creat(mqueue2, 0755), EACCES);
 

testcases/kernel/containers/mqns/mqns_04.c line 106

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +2 -7
-	tst_resm(TINFO, "Checking mqueue filesystem lifetime");
+	SAFE_UMOUNT(devdir);
 
-	/* fire off the test */
-	rc = do_clone_unshare_test(use_clone, CLONE_NEWIPC, check_mqueue, NULL);
-	if (rc < 0) {
-		tst_resm(TFAIL, "failed clone/unshare");
-		goto fail;
-	}
+	*mq_freed = 1;

This doesn't appear to be near the point that the MQ is unlinked.

Quoted 19 lines
testcases/kernel/containers/mqns/mqns_04.c +4 -13
+}
 
-	close(p1[0]);
-	close(p2[1]);
-	write(p1[1], "go", 3);
-
-	read(p2[0], buf, 7);
-	if (!strcmp(buf, "mqfail")) {
-		tst_resm(TFAIL, "child process could not create mqueue");
-		goto fail;
-	} else if (!strcmp(buf, "mount")) {
-		tst_resm(TFAIL, "child process could not mount mqueue");
-		goto fail;
-	}
+static void setup(void)
+{
+	char *tmpdir;
 
-	rc = stat(FNAM1, &statbuf);

testcases/kernel/containers/mqns/mqns_04.c

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +2 -7
-	if (rc == -1) {
-		perror("stat");
-		write(p1[1], "go", 3);
-		tst_resm(TFAIL, "parent could not see child's created mq");
-		goto fail;
-	}
-	write(p1[1], "go", 3);
+	if (!str_op)
+		tst_brk(TCONF, "Please use clone|unshare execution
 mode");

When this happens the test segfaults because devdir and mq_freed have not been allocated.

This is also a problem in previous tests as well.

Quoted 28 lines
testcases/kernel/containers/mqns/mqns_04.c +3 -23
-	rc = wait(&status);
-	if (rc == -1) {
-		perror("wait");
-		tst_resm(TFAIL, "error while parent waited on child to exit");
-		goto fail;
-	}
-	if (!WIFEXITED(status)) {
-		tst_resm(TFAIL, "Child did not exit normally (status %d)",
-			 status);
-		goto fail;
-	}
-	rc = stat(FNAM1, &statbuf);
-	if (rc == -1) {
-		tst_resm(TFAIL,
-			 "parent's view of child's mq died with child");
-		goto fail;
-	}
+	tmpdir = tst_get_tmpdir();
 
-	rc = creat(FNAM2, 0755);
-	if (rc != -1) {
-		tst_resm(TFAIL,
-			 "parent was able to create a file in dead child's mqfs");
-		goto fail;
-	}
+	SAFE_ASPRINTF(&devdir, "%s/mqueue", tmpdir);
+	SAFE_MKDIR(devdir, 0755);

testcases/kernel/containers/mqns/mqns_04.c line 128

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +8 -1
+
+	SAFE_ASPRINTF(&mqueue1, "%s" MQNAME1, devdir);
+	SAFE_ASPRINTF(&mqueue2, "%s" MQNAME2, devdir);
 
-	tst_resm(TPASS, "Child mqueue fs still visible for parent");
+	mq_freed = SAFE_MMAP(NULL,
+		sizeof(int),
+		PROT_READ | PROT_WRITE,
+		MAP_SHARED | MAP_ANONYMOUS,
+		-1, 0);

This starts as 0, but we have not created any MQs yet so we could not free them in cleanup (also in mqns03).

Try running with -i0

Quoted 32 lines
testcases/kernel/containers/mqns/mqns_04.c +23 -4
+}
 
-fail:
-	umount(DEV_MQUEUE2);
-	rmdir(DEV_MQUEUE2);
+static void cleanup(void)
+{
+	if (tst_is_mounted(devdir))
+		SAFE_UMOUNT(devdir);
 
-	tst_exit();
+	if (!*mq_freed) {
+		SAFE_MQ_UNLINK(MQNAME1);
+		SAFE_MQ_UNLINK(MQNAME2);
+	}
 }
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_root = 1,
+	.forks_child = 1,
+	.needs_tmpdir = 1,
+	.needs_checkpoints = 1,
+	.options = (struct tst_option[]) {
+		{ "m:", &str_op, "Test execution mode <clone|unshare>" },
+		{},
+	},
+};
Signature · 1 line
2.35.3
Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#7 lore raw

Re: [LTP] [PATCH v4 4/6] Refactor mqns_04 using new LTP API

Hi,

Quoted 105 lines · Richard Palethorpe

Hello,

Quoted 101 lines · Andrea Cervesato via ltp
---
  runtest/containers                         |   4 +-
  testcases/kernel/containers/mqns/mqns_04.c | 273 +++++++++------------
  2 files changed, 122 insertions(+), 155 deletions(-)
runtest/containers +2 -2
index 1cc6c838d..318113e19 100644
@@ -24,8 +24,8 @@ mqns_02_unshare mqns_02 -m unshare
  mqns_03 mqns_03
  mqns_03_clone mqns_03 -m clone
  mqns_03_unshare mqns_03 -m unshare
-mqns_04 mqns_04
-mqns_04_clone mqns_04 -clone
+mqns_04_clone mqns_04 -m clone
+mqns_04_unshare mqns_04 -m unshare
 
  netns_netlink netns_netlink
  netns_breakns_ip_ipv4_netlink netns_breakns.sh
testcases/kernel/containers/mqns/mqns_04.c +28 -42
index d07a85c04..93df61ec4 100644
@@ -1,187 +1,154 @@
+// SPDX-License-Identifier: GPL-2.0
  /*
-* Copyright (c) International Business Machines Corp., 2009
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
-* the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*
-* Author: Serge Hallyn <[email protected]>
-*
-* Check mqueuefs lifetime
-* . parent creates /dev/mqueue2
-* . child mounts mqueue there
-* . child does mq_open("/ab")
-* . parent checks for /dev/mqueue2
-* . child exits
-* . parent checks for /dev/mqueue2
-* . parent tries 'touch /dev/mqueue2/dd' -> should fail
-* . parent umounts /dev/mqueue2
-
-***************************************************************************/
-
-#ifndef _GNU_SOURCE
+ * Copyright (c) International Business Machines Corp., 2009
+ * Copyright (c) Serge Hallyn <[email protected]>
+ * Copyright (C) 2023 SUSE LLC Andrea Cervesato <[email protected]>
+ */
+
+/*\
+ * [Description]
+ *
+ * Test mqueuefs manipulation from child/parent namespaces.
+ *
+ * [Algorithm]
+ *
+ * - parent creates mqueue folder in <tmpdir>
+ * - child mounts mqueue there
+ * - child creates /MQ1 mqueue
+ * - parent checks for <tmpdir>/mqueue/MQ1 existence
+ * - child exits
+ * - parent checks for <tmpdir>/mqueue/MQ1 existence
+ * - parent tries 'touch <tmpdir>/mqueue/MQ2' -> should fail
+ * - parent umount mqueuefs
+ */
  #define _GNU_SOURCE
-#endif
-#include <sys/types.h>
-#include <sys/stat.h>
+
  #include <sys/wait.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include "mqns.h"
-#include "mqns_helper.h"
+#include "tst_test.h"
+#include "lapi/sched.h"
+#include "tst_safe_posix_ipc.h"
+#include "tst_safe_stdio.h"
 
-char *TCID = "posixmq_namespace_04";
-int TST_TOTAL = 1;
+#define CHECK_MQ_OPEN_RET(x) ((x) >= 0 || ((x) == -1 && errno != EMFILE))
 
Quoted 5 lines

testcases/kernel/containers/mqns/mqns_04.c line 35

Quoted 4 lines
testcases/kernel/containers/mqns/mqns_04.c +2 -2
-int p1[2];
-int p2[2];
+#define MQNAME1 "/MQ1"
+#define MQNAME2 "/MQ2"

/MQ2 is never created

We try to create it by hand from parent, touching a queue file after mounting mqueue folder, but since it's a unshared container, we obtain error. Check:

    TST_EXP_FAIL(creat(mqueue2, 0755), EACCES);

Quoted 209 lines
Quoted 49 lines
testcases/kernel/containers/mqns/mqns_04.c +26 -15
-#define FNAM1 DEV_MQUEUE2 SLASH_MQ1
-#define FNAM2 DEV_MQUEUE2 SLASH_MQ2
+static char *str_op;
+static char *devdir;
+static char *mqueue1;
+static char *mqueue2;
+static int *mq_freed;
 
-int check_mqueue(void *vtest)
+static void check_mqueue(void)
  {
-	char buf[30];
  	mqd_t mqd;
-	int rc;
 
-	(void) vtest;
+	mqd = TST_RETRY_FUNC(
+		mq_open(MQNAME1, O_RDWR | O_CREAT | O_EXCL, 0755, NULL),
+		CHECK_MQ_OPEN_RET);
+	if (mqd == -1)
+		tst_brk(TBROK | TERRNO, "mq_open failed");
 
-	close(p1[1]);
-	close(p2[0]);
+	SAFE_MQ_CLOSE(mqd);
 
-	read(p1[0], buf, 3);	/* go */
+	SAFE_MOUNT("mqueue", devdir, "mqueue", 0, NULL);
 
-	mqd = tst_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL,
-		0755, NULL);
-	if (mqd == -1) {
-		write(p2[1], "mqfail", 7);
-		tst_exit();
-	}
+	TST_CHECKPOINT_WAKE_AND_WAIT(0);
+}
+
+static void run(void)
+{
+	const struct tst_clone_args clone_args = { CLONE_NEWIPC, SIGCHLD };
+	int status;
+	struct stat statbuf;
+
+	tst_res(TINFO, "Checking mqueue filesystem lifetime");
+
+	if (str_op && !strcmp(str_op, "clone")) {
+		tst_res(TINFO, "Spawning isolated process");

testcases/kernel/containers/mqns/mqns_04.c line 76

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +6 -2
 
-	mq_close(mqd);
+		if (!SAFE_CLONE(&clone_args)) {
+			check_mqueue();
+			return;
+		}
+	} else if (str_op && !strcmp(str_op, "unshare")) {
+		tst_res(TINFO, "Spawning unshared process");
 
-	rc = mount("mqueue", DEV_MQUEUE2, "mqueue", 0, NULL);

Possibly this is a mistake in the original test. Do we really need to remount mqueuefs? Isn't it just the same FS in a different location?

This thing that really makes a difference is that the child is in a new namespace, so the parent and child should not see each others queues?

Quoted 28 lines
testcases/kernel/containers/mqns/mqns_04.c +9 -14
-	if (rc == -1) {
-		perror("mount");
-		write(p2[1], "mount", 6);
-		tst_exit();
+		if (!SAFE_FORK()) {
+			SAFE_UNSHARE(CLONE_NEWIPC);
+			check_mqueue();
+			return;
+		}
  	}
 
-	write(p2[1], "go", 3);
-	read(p1[0], buf, 3);
+	TST_CHECKPOINT_WAIT(0);
 
-	tst_exit();
-}
+	SAFE_STAT(mqueue1, &statbuf);
+	tst_res(TPASS, "%s child's mqueue can be accessed from parent", mqueue1);
 
-static void setup(void)
-{
-	tst_require_root();
-	check_mqns();
-}
+	TST_CHECKPOINT_WAKE(0);
 
-int main(int argc, char *argv[])

testcases/kernel/containers/mqns/mqns_04.c line 94

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +2 -7
-{
-	int rc;
-	int status;
-	char buf[30];
-	struct stat statbuf;
-	int use_clone = T_UNSHARE;
+	tst_res(TINFO, "Waiting child to exit");
 
-	setup();
+	SAFE_WAIT(&status);

Again we can just use tst_reap_children() which does a thorough check of the child status.

Quoted 25 lines
testcases/kernel/containers/mqns/mqns_04.c +5 -16
-	if (argc == 2 && strcmp(argv[1], "-clone") == 0) {
-		tst_resm(TINFO,
-			 "Testing posix mq namespaces through clone(2).");
-		use_clone = T_CLONE;
-	} else
-		tst_resm(TINFO,
-			 "Testing posix mq namespaces through unshare(2).");
+	if (!WIFEXITED(status))
+		tst_brk(TBROK, "Child did not exit normally: %s", tst_strstatus(status));
 
-	if (pipe(p1) == -1) {
-		perror("pipe");
-		exit(EXIT_FAILURE);
-	}
-	if (pipe(p2) == -1) {
-		perror("pipe");
-		exit(EXIT_FAILURE);
-	}
+	SAFE_STAT(mqueue1, &statbuf);
+	tst_res(TPASS, "%s child's mqueue can be accessed from parent after child's dead", mqueue1);
 
-	mkdir(DEV_MQUEUE2, 0755);
+	TST_EXP_FAIL(creat(mqueue2, 0755), EACCES);
 

testcases/kernel/containers/mqns/mqns_04.c line 106

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +2 -7
-	tst_resm(TINFO, "Checking mqueue filesystem lifetime");
+	SAFE_UMOUNT(devdir);
 
-	/* fire off the test */
-	rc = do_clone_unshare_test(use_clone, CLONE_NEWIPC, check_mqueue, NULL);
-	if (rc < 0) {
-		tst_resm(TFAIL, "failed clone/unshare");
-		goto fail;
-	}
+	*mq_freed = 1;

This doesn't appear to be near the point that the MQ is unlinked.

Quoted 19 lines
testcases/kernel/containers/mqns/mqns_04.c +4 -13
+}
 
-	close(p1[0]);
-	close(p2[1]);
-	write(p1[1], "go", 3);
-
-	read(p2[0], buf, 7);
-	if (!strcmp(buf, "mqfail")) {
-		tst_resm(TFAIL, "child process could not create mqueue");
-		goto fail;
-	} else if (!strcmp(buf, "mount")) {
-		tst_resm(TFAIL, "child process could not mount mqueue");
-		goto fail;
-	}
+static void setup(void)
+{
+	char *tmpdir;
 
-	rc = stat(FNAM1, &statbuf);

testcases/kernel/containers/mqns/mqns_04.c

Quoted 10 lines
testcases/kernel/containers/mqns/mqns_04.c +2 -7
-	if (rc == -1) {
-		perror("stat");
-		write(p1[1], "go", 3);
-		tst_resm(TFAIL, "parent could not see child's created mq");
-		goto fail;
-	}
-	write(p1[1], "go", 3);
+	if (!str_op)
+		tst_brk(TCONF, "Please use clone|unshare execution
 mode");

When this happens the test segfaults because devdir and mq_freed have not been allocated.

This is also a problem in previous tests as well.

Quoted 32 lines
testcases/kernel/containers/mqns/mqns_04.c +6 -23
-	rc = wait(&status);
-	if (rc == -1) {
-		perror("wait");
-		tst_resm(TFAIL, "error while parent waited on child to exit");
-		goto fail;
-	}
-	if (!WIFEXITED(status)) {
-		tst_resm(TFAIL, "Child did not exit normally (status %d)",
-			 status);
-		goto fail;
-	}
-	rc = stat(FNAM1, &statbuf);
-	if (rc == -1) {
-		tst_resm(TFAIL,
-			 "parent's view of child's mq died with child");
-		goto fail;
-	}
+	tmpdir = tst_get_tmpdir();
 
-	rc = creat(FNAM2, 0755);
-	if (rc != -1) {
-		tst_resm(TFAIL,
-			 "parent was able to create a file in dead child's mqfs");
-		goto fail;
-	}
+	SAFE_ASPRINTF(&devdir, "%s/mqueue", tmpdir);
+	SAFE_MKDIR(devdir, 0755);
+
+	SAFE_ASPRINTF(&mqueue1, "%s" MQNAME1, devdir);
+	SAFE_ASPRINTF(&mqueue2, "%s" MQNAME2, devdir);
 
Quoted 8 lines

testcases/kernel/containers/mqns/mqns_04.c line 128

Quoted 6 lines
testcases/kernel/containers/mqns/mqns_04.c +5 -1
-	tst_resm(TPASS, "Child mqueue fs still visible for parent");
+	mq_freed = SAFE_MMAP(NULL,
+		sizeof(int),
+		PROT_READ | PROT_WRITE,
+		MAP_SHARED | MAP_ANONYMOUS,
+		-1, 0);

This starts as 0, but we have not created any MQs yet so we could not free them in cleanup (also in mqns03).

I think in both mqns0[34] files I will access() mqueue files and remove them, instead of handling mq_freed variable.

Quoted 26 lines

Try running with -i0

Quoted 24 lines
testcases/kernel/containers/mqns/mqns_04.c +17 -4
+}
 
-fail:
-	umount(DEV_MQUEUE2);
-	rmdir(DEV_MQUEUE2);
+static void cleanup(void)
+{
+	if (tst_is_mounted(devdir))
+		SAFE_UMOUNT(devdir);
 
-	tst_exit();
+	if (!*mq_freed) {
+		SAFE_MQ_UNLINK(MQNAME1);
+		SAFE_MQ_UNLINK(MQNAME2);
+	}
  }
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_root = 1,
+	.forks_child = 1,
+	.needs_tmpdir = 1,
Quoted 9 lines
Quoted 8 lines
testcases/kernel/containers/mqns/mqns_04.c +6 -0
+	.needs_checkpoints = 1,
+	.options = (struct tst_option[]) {
+		{ "m:", &str_op, "Test execution mode <clone|unshare>" },
+		{},
+	},
+};
Signature · 1 line
2.35.3

Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#8 lore raw

PATCH v4 5/6 Remove deprecated header files from mqns suite

In reply to Andrea Cervesato via ltp
---
 testcases/kernel/containers/mqns/mqns.h       | 11 ----
 .../kernel/containers/mqns/mqns_helper.h      | 53 -------------------
 2 files changed, 64 deletions(-)
 delete mode 100644 testcases/kernel/containers/mqns/mqns.h
 delete mode 100644 testcases/kernel/containers/mqns/mqns_helper.h
testcases/kernel/containers/mqns/mqns.h deleted +0 -11
deleted file mode 100644
index 5a9056838..000000000
@@ -1,11 +0,0 @@
-#ifndef __MQNS_H
-#define __MQNS_H
-
-#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 */
testcases/kernel/containers/mqns/mqns_helper.h deleted +0 -53

53 lines not on this page · raw message

Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#9 lore raw

PATCH v4 6/6 Remove libclone dependency from mqns suite

In reply to Andrea Cervesato via ltp
---
 testcases/kernel/containers/mqns/Makefile | 27 +++++------------------
 1 file changed, 5 insertions(+), 22 deletions(-)
testcases/kernel/containers/mqns/Makefile +5 -22
index 64c3763ee..eb0f97c2b 100644
@@ -1,29 +1,12 @@
-################################################################################
-##                                                                            ##
-## Copyright (c) International Business Machines  Corp., 2009                 ##
-## Copyright (c) Nadia Derbey, 2009                                           ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-################################################################################
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) International Business Machines  Corp., 2009
+# Copyright (c) Nadia Derbey, 2009 
+# Copyright (C) 2021 SUSE LLC Andrea Cervesato <[email protected]>
 
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-include $(abs_srcdir)/../Makefile.inc
 
-LDLIBS			:= -lpthread -lrt -lclone $(LDLIBS)
+LDLIBS			:= -lpthread -lrt $(LDLIBS)
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#10 lore raw
In reply to Andrea Cervesato via ltp

Hello,

I have too many questions to merge this with fixups, please see coments on 03 and 04, but also check the other tests for similar issues.

Quoted 24 lines · Andrea Cervesato via ltp

Refactoring mqns testing suite and removing libclone dependency.

Andrea Cervesato (6):
Refactor mqns_01 using new LTP API
Refactor mqns_02 using new LTP API
Refactor mqns_03 using new LTP API
Refactor mqns_04 using new LTP API
Remove deprecated header files from mqns suite
Remove libclone dependency from mqns suite

 runtest/containers                            |  13 +-
 testcases/kernel/containers/mqns/Makefile     |  27 +-
 testcases/kernel/containers/mqns/mqns.h       |  11 -
 testcases/kernel/containers/mqns/mqns_01.c    | 180 ++++-------
 testcases/kernel/containers/mqns/mqns_02.c    | 241 +++++---------
 testcases/kernel/containers/mqns/mqns_03.c    | 298 +++++++-----------
 testcases/kernel/containers/mqns/mqns_04.c    | 273 +++++++---------
 .../kernel/containers/mqns/mqns_helper.h      |  53 ----
 8 files changed, 392 insertions(+), 704 deletions(-)
 delete mode 100644 testcases/kernel/containers/mqns/mqns.h
 delete mode 100644 testcases/kernel/containers/mqns/mqns_helper.h
Signature · 1 line
2.35.3
Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp