Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 0/5] syscalls/pause: Refactor tests
@ 2025-02-24 18:53 Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 1/5] syscalls/pause01: Clean up Ricardo B. Marlière via ltp
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-24 18:53 UTC (permalink / raw)
  To: Linux Test Project; +Cc: Ricardo B. Marlière

Signed-off-by: Ricardo B. Marlière <ricardo@marliere.net>
---
Changes in v3 (suggestions by Cyril):
- Removed pause02.
- Extended pause01 to cover other signals.
- Fixed the checkpoints usage.
- Used tst_strstatus in pause03.
- Renamed pause03 to pause02.
- Link to v2: https://lore.kernel.org/r/20250218-conversions-pause-v2-0-8c72960fe1ec@suse.com

Changes in v2:
- Added a cleanup commit for pause01
- Made use of LTP_ATTRIBUTE_UNUSED, TST_EXP_FAIL, TST_EXP_EXPR, SAFE_KILL
  as suggested by Andrea.
- Fixed test descriptions
- Added 2025 copyright
- Link to v1: https://lore.kernel.org/r/20250217-conversions-pause-v1-0-be8be41cb154@marliere.net

---
Ricardo B. Marlière (5):
      syscalls/pause01: Clean up
      syscalls/pause01: Extend test to other signals
      syscalls/pause02: Delete duplicated test
      syscalls/pause03: Refactor into new API
      syscalls/pause03: Rename to pause02

 runtest/syscalls                          |   1 -
 testcases/kernel/syscalls/pause/pause01.c |  64 ++++++------
 testcases/kernel/syscalls/pause/pause02.c | 159 ++++++------------------------
 testcases/kernel/syscalls/pause/pause03.c | 104 -------------------
 4 files changed, 63 insertions(+), 265 deletions(-)
---
base-commit: af4da3e436f891df500c552a1396925acf204457
change-id: 20250217-conversions-pause-4b9d4be3f876

Best regards,
-- 
Ricardo B. Marlière <rbm@suse.com>


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

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

* [LTP] [PATCH v3 1/5] syscalls/pause01: Clean up
  2025-02-24 18:53 [LTP] [PATCH v3 0/5] syscalls/pause: Refactor tests Ricardo B. Marlière via ltp
@ 2025-02-24 18:53 ` Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 2/5] syscalls/pause01: Extend test to other signals Ricardo B. Marlière via ltp
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-24 18:53 UTC (permalink / raw)
  To: Linux Test Project; +Cc: Ricardo B. Marlière

From: Ricardo B. Marlière <rbm@suse.com>

Tidy up and add a description.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
 testcases/kernel/syscalls/pause/pause01.c | 41 +++++++++++--------------------
 1 file changed, 15 insertions(+), 26 deletions(-)

diff --git a/testcases/kernel/syscalls/pause/pause01.c b/testcases/kernel/syscalls/pause/pause01.c
index c88248da0d9961c5414a694a91cf1aef40ff263a..d830016a68b77daad4851d7f7d6436c0922de002 100644
--- a/testcases/kernel/syscalls/pause/pause01.c
+++ b/testcases/kernel/syscalls/pause/pause01.c
@@ -1,10 +1,14 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2016 Linux Test Project
+ * Copyright (c) 2025 Ricardo B. Marlière <rbm@suse.com>
  */
-#include <errno.h>
-#include <signal.h>
-#include <stdlib.h>
+
+/*\
+ * Verify that, pause() returns -1 and sets errno to EINTR after receipt of a
+ * signal which is caught by the calling process.
+ */
+
 #include "tst_test.h"
 
 static void sig_handler(int sig LTP_ATTRIBUTE_UNUSED)
@@ -14,43 +18,28 @@ static void sig_handler(int sig LTP_ATTRIBUTE_UNUSED)
 static void do_child(void)
 {
 	SAFE_SIGNAL(SIGINT, sig_handler);
-
 	TST_CHECKPOINT_WAKE(0);
-
-	TEST(pause());
-	if (TST_RET != -1)
-		tst_res(TFAIL, "pause() succeeded unexpectedly");
-	else if (TST_ERR == EINTR)
-		tst_res(TPASS, "pause() interrupted with EINTR");
-	else
-		tst_res(TFAIL | TTERRNO, "pause() unexpected errno");
-
-	TST_CHECKPOINT_WAKE(0);
-	exit(0);
+	TST_EXP_FAIL(pause(), EINTR);
+	tst_res(TPASS, "Process resumed from pause()");
 }
 
-static void do_test(void)
+static void run(void)
 {
 	int pid, status;
 
 	pid = SAFE_FORK();
-	if (pid == 0)
+	if (!pid) {
 		do_child();
+		exit(0);
+	}
 
 	TST_CHECKPOINT_WAIT(0);
 	TST_PROCESS_STATE_WAIT(pid, 'S', 0);
-	kill(pid, SIGINT);
-
-	/*
-	 * TST_CHECKPOINT_WAIT has built-in timeout, if pause() doesn't return,
-	 * this checkpoint call will reliably end the test.
-	 */
-	TST_CHECKPOINT_WAIT(0);
-	SAFE_WAIT(&status);
+	SAFE_KILL(pid, SIGINT);
 }
 
 static struct tst_test test = {
 	.forks_child = 1,
 	.needs_checkpoints = 1,
-	.test_all = do_test,
+	.test_all = run,
 };

-- 
2.48.1


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

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

* [LTP] [PATCH v3 2/5] syscalls/pause01: Extend test to other signals
  2025-02-24 18:53 [LTP] [PATCH v3 0/5] syscalls/pause: Refactor tests Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 1/5] syscalls/pause01: Clean up Ricardo B. Marlière via ltp
@ 2025-02-24 18:53 ` Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test Ricardo B. Marlière via ltp
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-24 18:53 UTC (permalink / raw)
  To: Linux Test Project; +Cc: Ricardo B. Marlière

From: Ricardo B. Marlière <rbm@suse.com>

Currently, the test only covers SIGINT. Add more to the mix by
parametrizing the main test function.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
 testcases/kernel/syscalls/pause/pause01.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/testcases/kernel/syscalls/pause/pause01.c b/testcases/kernel/syscalls/pause/pause01.c
index d830016a68b77daad4851d7f7d6436c0922de002..1c1b04038de11dc52deb841ad59d5a482345262a 100644
--- a/testcases/kernel/syscalls/pause/pause01.c
+++ b/testcases/kernel/syscalls/pause/pause01.c
@@ -11,35 +11,50 @@
 
 #include "tst_test.h"
 
-static void sig_handler(int sig LTP_ATTRIBUTE_UNUSED)
+static void sig_handler(int signal LTP_ATTRIBUTE_UNUSED)
 {
 }
 
-static void do_child(void)
+static void do_child(int signal)
 {
-	SAFE_SIGNAL(SIGINT, sig_handler);
+	SAFE_SIGNAL(signal, sig_handler);
 	TST_CHECKPOINT_WAKE(0);
 	TST_EXP_FAIL(pause(), EINTR);
 	tst_res(TPASS, "Process resumed from pause()");
 }
 
-static void run(void)
+static void run(int signal)
 {
-	int pid, status;
+	int pid;
 
 	pid = SAFE_FORK();
 	if (!pid) {
-		do_child();
+		do_child(signal);
 		exit(0);
 	}
 
 	TST_CHECKPOINT_WAIT(0);
 	TST_PROCESS_STATE_WAIT(pid, 'S', 0);
-	SAFE_KILL(pid, SIGINT);
+	SAFE_KILL(pid, signal);
+}
+
+static void run_all(void)
+{
+	run(SIGHUP);
+	run(SIGINT);
+	run(SIGQUIT);
+	run(SIGILL);
+	run(SIGTRAP);
+	run(SIGABRT);
+	run(SIGFPE);
+	run(SIGSEGV);
+	run(SIGPIPE);
+	run(SIGALRM);
+	run(SIGTERM);
 }
 
 static struct tst_test test = {
 	.forks_child = 1,
 	.needs_checkpoints = 1,
-	.test_all = run,
+	.test_all = run_all,
 };

-- 
2.48.1


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

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

* [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test
  2025-02-24 18:53 [LTP] [PATCH v3 0/5] syscalls/pause: Refactor tests Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 1/5] syscalls/pause01: Clean up Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 2/5] syscalls/pause01: Extend test to other signals Ricardo B. Marlière via ltp
@ 2025-02-24 18:53 ` Ricardo B. Marlière via ltp
  2025-02-24 19:24   ` Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 4/5] syscalls/pause03: Refactor into new API Ricardo B. Marlière via ltp
  2025-02-24 18:53 ` [LTP] [PATCH v3 5/5] syscalls/pause03: Rename to pause02 Ricardo B. Marlière via ltp
  4 siblings, 1 reply; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-24 18:53 UTC (permalink / raw)
  To: Linux Test Project; +Cc: Ricardo B. Marlière

From: Ricardo B. Marlière <rbm@suse.com>

This test is very similar to pause01, therefore delete it.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
 runtest/syscalls                          |   1 -
 testcases/kernel/syscalls/pause/pause02.c | 147 ------------------------------
 2 files changed, 148 deletions(-)

diff --git a/runtest/syscalls b/runtest/syscalls
index 4ab8436d30ca5ffee52d9777729ec1ec09d0bf1d..66ebf20d2aa9dfa36ca9bc5e55536f5a9dc0e83f 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -1010,7 +1010,6 @@ pathconf01 pathconf01
 pathconf02 pathconf02
 
 pause01 pause01
-pause02 pause02
 pause03 pause03
 
 personality01 personality01
diff --git a/testcases/kernel/syscalls/pause/pause02.c b/testcases/kernel/syscalls/pause/pause02.c
deleted file mode 100644
index 0853232fd07b2c6278049dd4472a1ee8e7ab7646..0000000000000000000000000000000000000000
--- a/testcases/kernel/syscalls/pause/pause02.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2001
- * Copyright (c) 2012 Cyril Hrubis <chrubis@suse.cz>
- *
- * 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
- */
-
-/*
- * Verify that, pause() returns -1 and sets errno to EINTR after receipt of a
- * signal which is caught by the calling process. Also, verify that the calling
- * process will resume execution from the point of suspension.
- */
-
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-
-#include "test.h"
-
-char *TCID = "pause02";
-int TST_TOTAL = 1;
-static pid_t cpid;
-
-static void do_child(void);
-static void setup(void);
-static void cleanup(void);
-
-int main(int ac, char **av)
-{
-	int lc;
-	int status;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		cpid = tst_fork();
-		switch (cpid) {
-		case -1:
-			tst_brkm(TBROK, cleanup, "fork() failed");
-		break;
-		case 0:
-			do_child();
-		break;
-		default:
-		break;
-		}
-
-		/*
-		 * Wait for child to enter pause().
-		 */
-		TST_PROCESS_STATE_WAIT(cleanup, cpid, 'S');
-
-		/*
-		 * Send the SIGINT signal now, so that child
-		 * returns from pause and resumes execution.
-		 */
-		kill(cpid, SIGINT);
-
-		wait(&status);
-
-		if (WIFEXITED(status)) {
-			if (WEXITSTATUS(status) == 0)
-				tst_resm(TPASS, "pause was interrupted correctly");
-			else
-				tst_resm(TFAIL, "pause was interrupted but the "
-				                "retval and/or errno was wrong");
-			continue;
-		}
-
-		if (WIFSIGNALED(status)) {
-			switch (WTERMSIG(status)) {
-			case SIGALRM:
-				tst_resm(TFAIL, "Timeout: SIGINT wasn't received by child");
-			break;
-			default:
-				tst_resm(TFAIL, "Child killed by signal");
-			}
-
-			continue;
-		}
-
-		tst_resm(TFAIL, "Pause was not interrupted");
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-static void sig_handle(int sig)
-{
-}
-
-static void do_child(void)
-{
-	/* avoid LTP framework to do whatever it likes */
-	signal(SIGALRM, SIG_DFL);
-
-	if (signal(SIGINT, sig_handle) == SIG_ERR) {
-		fprintf(stderr, "Child: Failed to setup signal handler\n");
-		exit(1);
-	}
-
-	/* Commit suicide after 10 seconds */
-	alarm(10);
-
-	TEST(pause());
-
-	if (TEST_RETURN == -1) {
-		if (TEST_ERRNO == EINTR)
-			exit(0);
-
-		fprintf(stderr, "Child: Pause returned -1 but errno is %d (%s)\n",
-		        TEST_ERRNO, strerror(TEST_ERRNO));
-		exit(1);
-	}
-
-	fprintf(stderr, "Child: Pause returned %ld\n", TEST_RETURN);
-	exit(1);
-}
-
-static void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-}

-- 
2.48.1


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

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

* [LTP] [PATCH v3 4/5] syscalls/pause03: Refactor into new API
  2025-02-24 18:53 [LTP] [PATCH v3 0/5] syscalls/pause: Refactor tests Ricardo B. Marlière via ltp
                   ` (2 preceding siblings ...)
  2025-02-24 18:53 ` [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test Ricardo B. Marlière via ltp
@ 2025-02-24 18:53 ` Ricardo B. Marlière via ltp
  2025-02-26 16:00   ` Cyril Hrubis
  2025-02-24 18:53 ` [LTP] [PATCH v3 5/5] syscalls/pause03: Rename to pause02 Ricardo B. Marlière via ltp
  4 siblings, 1 reply; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-24 18:53 UTC (permalink / raw)
  To: Linux Test Project; +Cc: Ricardo B. Marlière

From: Ricardo B. Marlière <rbm@suse.com>

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
 testcases/kernel/syscalls/pause/pause03.c | 120 ++++++++----------------------
 1 file changed, 31 insertions(+), 89 deletions(-)

diff --git a/testcases/kernel/syscalls/pause/pause03.c b/testcases/kernel/syscalls/pause/pause03.c
index 459222045c08dc1fc4804efd2ece02316fe55a0e..9d7fee1e89bbb7f3df52e91b9040e3fb2d8d916a 100644
--- a/testcases/kernel/syscalls/pause/pause03.c
+++ b/testcases/kernel/syscalls/pause/pause03.c
@@ -1,104 +1,46 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) International Business Machines  Corp., 2001
- *  07/2001 Ported by Wayne Boyer
- *
- * 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
+ * 07/2001 Ported by Wayne Boyer
+ * Copyright (c) 2025 Ricardo B. Marlière <rbm@suse.com>
  */
-/*
- * Test Description:
- *  pause() does not return due to receipt of SIGKILL signal and specified
- *  process should be terminated.
- */
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-
-#include "test.h"
-#include "safe_macros.h"
-
-static pid_t cpid;
-
-char *TCID = "pause03";
-int TST_TOTAL = 1;
-
-static void do_child(void);
-static void setup(void);
-static void cleanup(void);
-
-int main(int ac, char **av)
-{
-	int lc;
-	int status;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		if ((cpid = tst_fork()) == -1)
-			tst_brkm(TBROK | TERRNO, NULL, "fork() failed");
-
-		if (cpid == 0)
-			do_child();
-
-		TST_PROCESS_STATE_WAIT(cleanup, cpid, 'S');
 
-		kill(cpid, SIGKILL);
-
-		SAFE_WAIT(NULL, &status);
-
-		if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL) {
-			tst_resm(TPASS, "pause() did not return after SIGKILL");
-			continue;
-		}
-
-		if (WIFSIGNALED(status)) {
-			tst_resm(TFAIL, "child killed by %s unexpectedly",
-			         tst_strsig(WTERMSIG(status)));
-			continue;
-		}
-
-		tst_resm(TFAIL, "child exited with %i", WEXITSTATUS(status));
-	}
-
-	cleanup();
-	tst_exit();
+/*\
+ * Verifies that pause() does not return after proccess receives a SIGKILL signal.
+ */
 
-}
+#include "tst_test.h"
 
 void do_child(void)
 {
-	TEST(pause());
-
-	tst_resm(TFAIL, "Unexpected return from pause()");
-
-	exit(0);
+	TST_CHECKPOINT_WAKE(0);
+	TST_EXP_PASS(pause());
 }
 
-void setup(void)
+void run(void)
 {
-	tst_sig(FORK, DEF_HANDLER, cleanup);
+	int status;
+	pid_t pid;
 
-	TEST_PAUSE;
-}
+	pid = SAFE_FORK();
+	if (!pid) {
+		do_child();
+		exit(0);
+	}
 
+	TST_CHECKPOINT_WAIT(0);
+	TST_PROCESS_STATE_WAIT(pid, 'S', 10000);
+	SAFE_KILL(pid, SIGKILL);
+	SAFE_WAITPID(pid, &status, 0);
 
-void cleanup(void)
-{
-	kill(cpid, SIGKILL);
+	if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL)
+		tst_res(TPASS, "pause() did not return after SIGKILL");
+	else
+		tst_res(TFAIL, "Child %s", tst_strstatus(status));
 }
+
+static struct tst_test test = {
+	.test_all = run,
+	.needs_checkpoints = 1,
+	.forks_child = 1,
+};

-- 
2.48.1


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

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

* [LTP] [PATCH v3 5/5] syscalls/pause03: Rename to pause02
  2025-02-24 18:53 [LTP] [PATCH v3 0/5] syscalls/pause: Refactor tests Ricardo B. Marlière via ltp
                   ` (3 preceding siblings ...)
  2025-02-24 18:53 ` [LTP] [PATCH v3 4/5] syscalls/pause03: Refactor into new API Ricardo B. Marlière via ltp
@ 2025-02-24 18:53 ` Ricardo B. Marlière via ltp
  4 siblings, 0 replies; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-24 18:53 UTC (permalink / raw)
  To: Linux Test Project; +Cc: Ricardo B. Marlière

From: Ricardo B. Marlière <rbm@suse.com>

Now that pause02 has been removed, rename pause03.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
 runtest/syscalls                                         | 2 +-
 testcases/kernel/syscalls/pause/{pause03.c => pause02.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtest/syscalls b/runtest/syscalls
index 66ebf20d2aa9dfa36ca9bc5e55536f5a9dc0e83f..d3e8d16d2ffb1b3e1c9ec5c8b7c36f1e886bdda6 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -1010,7 +1010,7 @@ pathconf01 pathconf01
 pathconf02 pathconf02
 
 pause01 pause01
-pause03 pause03
+pause02 pause02
 
 personality01 personality01
 personality02 personality02
diff --git a/testcases/kernel/syscalls/pause/pause03.c b/testcases/kernel/syscalls/pause/pause02.c
similarity index 100%
rename from testcases/kernel/syscalls/pause/pause03.c
rename to testcases/kernel/syscalls/pause/pause02.c

-- 
2.48.1


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

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

* Re: [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test
  2025-02-24 18:53 ` [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test Ricardo B. Marlière via ltp
@ 2025-02-24 19:24   ` Ricardo B. Marlière via ltp
  2025-02-26 16:07     ` Cyril Hrubis
  0 siblings, 1 reply; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-24 19:24 UTC (permalink / raw)
  To: Ricardo B. Marlière, Linux Test Project

On Mon Feb 24, 2025 at 3:53 PM -03, Ricardo B. Marlière wrote:
> From: Ricardo B. Marlière <rbm@suse.com>
>
> This test is very similar to pause01, therefore delete it.
>
> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
> ---
>  runtest/syscalls                          |   1 -
>  testcases/kernel/syscalls/pause/pause02.c | 147 ------------------------------
>  2 files changed, 148 deletions(-)
>
> diff --git a/runtest/syscalls b/runtest/syscalls
> index 4ab8436d30ca5ffee52d9777729ec1ec09d0bf1d..66ebf20d2aa9dfa36ca9bc5e55536f5a9dc0e83f 100644
> --- a/runtest/syscalls
> +++ b/runtest/syscalls
> @@ -1010,7 +1010,6 @@ pathconf01 pathconf01
>  pathconf02 pathconf02
>  
>  pause01 pause01
> -pause02 pause02
>  pause03 pause03

Should also have removed it in testcases/kernel/syscalls/pause/.gitignore 


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

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

* Re: [LTP] [PATCH v3 4/5] syscalls/pause03: Refactor into new API
  2025-02-24 18:53 ` [LTP] [PATCH v3 4/5] syscalls/pause03: Refactor into new API Ricardo B. Marlière via ltp
@ 2025-02-26 16:00   ` Cyril Hrubis
  0 siblings, 0 replies; 13+ messages in thread
From: Cyril Hrubis @ 2025-02-26 16:00 UTC (permalink / raw)
  To: Ricardo B. Marlière; +Cc: Linux Test Project

Hi!
Applied with minor change, thanks:

diff --git a/testcases/kernel/syscalls/pause/pause03.c b/testcases/kernel/syscalls/pause/pause03.c
index 9d7fee1e8..612209935 100644
--- a/testcases/kernel/syscalls/pause/pause03.c
+++ b/testcases/kernel/syscalls/pause/pause03.c
@@ -14,7 +14,8 @@
 void do_child(void)
 {
        TST_CHECKPOINT_WAKE(0);
-       TST_EXP_PASS(pause());
+       pause();
+       tst_res(TFAIL, "pause() returned after SIGKILL");
 }

 void run(void)
@@ -34,7 +35,7 @@ void run(void)
        SAFE_WAITPID(pid, &status, 0);

        if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL)
-               tst_res(TPASS, "pause() did not return after SIGKILL");
+               tst_res(TPASS, "pause() killed by SIGKILL");
        else
                tst_res(TFAIL, "Child %s", tst_strstatus(status));
 }

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

* Re: [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test
  2025-02-24 19:24   ` Ricardo B. Marlière via ltp
@ 2025-02-26 16:07     ` Cyril Hrubis
  2025-02-26 16:27       ` Ricardo B. Marlière via ltp
  0 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2025-02-26 16:07 UTC (permalink / raw)
  To: Ricardo B. Marlière; +Cc: Linux Test Project

Hi!
I've fixed the .gitignore changes and pushed the patchset, thanks.

Will you also look into increasing the coverage for pause01.c as I
described (make it loop over different signals)?

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

* Re: [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test
  2025-02-26 16:07     ` Cyril Hrubis
@ 2025-02-26 16:27       ` Ricardo B. Marlière via ltp
  2025-02-26 16:35         ` Cyril Hrubis
  0 siblings, 1 reply; 13+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-02-26 16:27 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: Linux Test Project

Hi Cyril,

On Wed Feb 26, 2025 at 1:07 PM -03, Cyril Hrubis wrote:
> Hi!
> I've fixed the .gitignore changes and pushed the patchset, thanks.

Thanks for reviewing and merging!

>
> Will you also look into increasing the coverage for pause01.c as I
> described (make it loop over different signals)?

I gave it a shot here https://lore.kernel.org/all/20250224-conversions-pause-v3-2-5e3989d37f1d@suse.com/

Is that similar to what you had in mind?

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

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

* Re: [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test
  2025-02-26 16:27       ` Ricardo B. Marlière via ltp
@ 2025-02-26 16:35         ` Cyril Hrubis
  2025-02-26 16:40           ` Ricardo B. Marlière
  0 siblings, 1 reply; 13+ messages in thread
From: Cyril Hrubis @ 2025-02-26 16:35 UTC (permalink / raw)
  To: Ricardo B. Marlière; +Cc: Linux Test Project

Hi!
> > Will you also look into increasing the coverage for pause01.c as I
> > described (make it loop over different signals)?
> 
> I gave it a shot here https://lore.kernel.org/all/20250224-conversions-pause-v3-2-5e3989d37f1d@suse.com/
> 
> Is that similar to what you had in mind?

Looks like I missed that one, sorry, merged now, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

* Re: [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test
  2025-02-26 16:35         ` Cyril Hrubis
@ 2025-02-26 16:40           ` Ricardo B. Marlière
  2025-02-27  9:28             ` Cyril Hrubis
  0 siblings, 1 reply; 13+ messages in thread
From: Ricardo B. Marlière @ 2025-02-26 16:40 UTC (permalink / raw)
  To: Cyril Hrubis, Ricardo B. Marlière; +Cc: Linux Test Project

On Wed Feb 26, 2025 at 1:35 PM -03, Cyril Hrubis wrote:
> Hi!
>> > Will you also look into increasing the coverage for pause01.c as I
>> > described (make it loop over different signals)?
>> 
>> I gave it a shot here https://lore.kernel.org/all/20250224-conversions-pause-v3-2-5e3989d37f1d@suse.com/
>> 
>> Is that similar to what you had in mind?
>
> Looks like I missed that one, sorry, merged now, thanks.

BTW, there's one final modification needed, below.

Thank you,
-	Ricardo.


diff --git a/testcases/kernel/syscalls/pause/.gitignore b/testcases/kernel/syscalls/pause/.gitignore
index 8ea85563ca69..4923553440f1 100644
--- a/testcases/kernel/syscalls/pause/.gitignore
+++ b/testcases/kernel/syscalls/pause/.gitignore
@@ -1,2 +1,2 @@
 /pause01
-/pause03
+/pause02


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

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

* Re: [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test
  2025-02-26 16:40           ` Ricardo B. Marlière
@ 2025-02-27  9:28             ` Cyril Hrubis
  0 siblings, 0 replies; 13+ messages in thread
From: Cyril Hrubis @ 2025-02-27  9:28 UTC (permalink / raw)
  To: Ricardo B. Marlière; +Cc: Linux Test Project, Ricardo B. Marlière

Hi!
> BTW, there's one final modification needed, below.

I did the change locally, but failed to --amend properly, that's what I
get for applying patches at the end of the day... I will push a fix.

-- 
Cyril Hrubis
chrubis@suse.cz

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

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

end of thread, other threads:[~2025-02-27  9:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 18:53 [LTP] [PATCH v3 0/5] syscalls/pause: Refactor tests Ricardo B. Marlière via ltp
2025-02-24 18:53 ` [LTP] [PATCH v3 1/5] syscalls/pause01: Clean up Ricardo B. Marlière via ltp
2025-02-24 18:53 ` [LTP] [PATCH v3 2/5] syscalls/pause01: Extend test to other signals Ricardo B. Marlière via ltp
2025-02-24 18:53 ` [LTP] [PATCH v3 3/5] syscalls/pause02: Delete duplicated test Ricardo B. Marlière via ltp
2025-02-24 19:24   ` Ricardo B. Marlière via ltp
2025-02-26 16:07     ` Cyril Hrubis
2025-02-26 16:27       ` Ricardo B. Marlière via ltp
2025-02-26 16:35         ` Cyril Hrubis
2025-02-26 16:40           ` Ricardo B. Marlière
2025-02-27  9:28             ` Cyril Hrubis
2025-02-24 18:53 ` [LTP] [PATCH v3 4/5] syscalls/pause03: Refactor into new API Ricardo B. Marlière via ltp
2025-02-26 16:00   ` Cyril Hrubis
2025-02-24 18:53 ` [LTP] [PATCH v3 5/5] syscalls/pause03: Rename to pause02 Ricardo B. Marlière via ltp

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