linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/clone3: fix number of tests in ksft_set_plan
@ 2023-03-14 11:53 Tobias Klauser
  2023-03-14 12:34 ` [PATCH v2] " Tobias Klauser
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Klauser @ 2023-03-14 11:53 UTC (permalink / raw)
  To: Christian Brauner, Shuah Khan; +Cc: linux-kselftest, linux-kernel

Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
added an additional test, so the number passed to ksft_set_plan needs to
be bumped accordingly.

Also use ksft_finish to print results and exit. This will catch future
mismatches between ksft_set_plan and the number of tests being run.

Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 tools/testing/selftests/clone3/clone3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c
index 4fce46afe6db..7b45c9854202 100644
--- a/tools/testing/selftests/clone3/clone3.c
+++ b/tools/testing/selftests/clone3/clone3.c
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
 	uid_t uid = getuid();
 
 	ksft_print_header();
-	ksft_set_plan(17);
+	ksft_set_plan(18);
 	test_clone3_supported();
 
 	/* Just a simple clone3() should return 0.*/
-- 
2.39.1


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

* [PATCH v2] selftests/clone3: fix number of tests in ksft_set_plan
  2023-03-14 11:53 [PATCH] selftests/clone3: fix number of tests in ksft_set_plan Tobias Klauser
@ 2023-03-14 12:34 ` Tobias Klauser
  2023-03-14 13:09   ` Christian Brauner
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Klauser @ 2023-03-14 12:34 UTC (permalink / raw)
  To: Christian Brauner, Shuah Khan; +Cc: linux-kselftest, linux-kernel

Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
added an additional test, so the number passed to ksft_set_plan needs to
be bumped accordingly.

Also use ksft_finished() to print results and exit. This will catch future
mismatches between ksft_set_plan() and the number of tests being run.

Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
v2:
 - actually added ksft_finished call as mentioned in the commit message

 tools/testing/selftests/clone3/clone3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c
index 4fce46afe6db..e495f895a2cd 100644
--- a/tools/testing/selftests/clone3/clone3.c
+++ b/tools/testing/selftests/clone3/clone3.c
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
 	uid_t uid = getuid();
 
 	ksft_print_header();
-	ksft_set_plan(17);
+	ksft_set_plan(18);
 	test_clone3_supported();
 
 	/* Just a simple clone3() should return 0.*/
@@ -198,5 +198,5 @@ int main(int argc, char *argv[])
 	/* Do a clone3() in a new time namespace */
 	test_clone3(CLONE_NEWTIME, 0, 0, CLONE3_ARGS_NO_TEST);
 
-	return !ksft_get_fail_cnt() ? ksft_exit_pass() : ksft_exit_fail();
+	ksft_finished();
 }
-- 
2.39.1


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

* Re: [PATCH v2] selftests/clone3: fix number of tests in ksft_set_plan
  2023-03-14 12:34 ` [PATCH v2] " Tobias Klauser
@ 2023-03-14 13:09   ` Christian Brauner
  2023-04-03 20:57     ` Tobias Klauser
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Brauner @ 2023-03-14 13:09 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: Shuah Khan, linux-kselftest, linux-kernel

On Tue, Mar 14, 2023 at 01:34:14PM +0100, Tobias Klauser wrote:
> Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> added an additional test, so the number passed to ksft_set_plan needs to
> be bumped accordingly.
> 
> Also use ksft_finished() to print results and exit. This will catch future
> mismatches between ksft_set_plan() and the number of tests being run.
> 
> Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> Cc: Christian Brauner <brauner@kernel.org>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---

Looks good. Thanks for fixing this,
Reviewed-by: Christian Brauner <brauner@kernel.org>

Feel free to take this through the selftests tree, Shuah.

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

* Re: [PATCH v2] selftests/clone3: fix number of tests in ksft_set_plan
  2023-03-14 13:09   ` Christian Brauner
@ 2023-04-03 20:57     ` Tobias Klauser
  2023-04-05  7:46       ` Christian Brauner
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Klauser @ 2023-04-03 20:57 UTC (permalink / raw)
  To: Christian Brauner, Shuah Khan; +Cc: linux-kselftest, linux-kernel

On 2023-03-14 at 14:09:59 +0100, Christian Brauner <brauner@kernel.org> wrote:
> On Tue, Mar 14, 2023 at 01:34:14PM +0100, Tobias Klauser wrote:
> > Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> > added an additional test, so the number passed to ksft_set_plan needs to
> > be bumped accordingly.
> > 
> > Also use ksft_finished() to print results and exit. This will catch future
> > mismatches between ksft_set_plan() and the number of tests being run.
> > 
> > Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> > Cc: Christian Brauner <brauner@kernel.org>
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> > ---
> 
> Looks good. Thanks for fixing this,
> Reviewed-by: Christian Brauner <brauner@kernel.org>
> 
> Feel free to take this through the selftests tree, Shuah.

It looks like this hasn't made it into Linus' tree yet and I also don't
see it in Shuah's tree. Would it be possible to still submit this for
6.3-rc6 given the commit it fixes has made it to Linus' tree already?

Thanks

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

* Re: [PATCH v2] selftests/clone3: fix number of tests in ksft_set_plan
  2023-04-03 20:57     ` Tobias Klauser
@ 2023-04-05  7:46       ` Christian Brauner
  2023-04-05  9:43         ` Tobias Klauser
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Brauner @ 2023-04-05  7:46 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: Shuah Khan, linux-kselftest, linux-kernel

On Mon, Apr 03, 2023 at 10:57:37PM +0200, Tobias Klauser wrote:
> On 2023-03-14 at 14:09:59 +0100, Christian Brauner <brauner@kernel.org> wrote:
> > On Tue, Mar 14, 2023 at 01:34:14PM +0100, Tobias Klauser wrote:
> > > Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> > > added an additional test, so the number passed to ksft_set_plan needs to
> > > be bumped accordingly.
> > > 
> > > Also use ksft_finished() to print results and exit. This will catch future
> > > mismatches between ksft_set_plan() and the number of tests being run.
> > > 
> > > Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> > > Cc: Christian Brauner <brauner@kernel.org>
> > > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> > > ---
> > 
> > Looks good. Thanks for fixing this,
> > Reviewed-by: Christian Brauner <brauner@kernel.org>
> > 
> > Feel free to take this through the selftests tree, Shuah.
> 
> It looks like this hasn't made it into Linus' tree yet and I also don't
> see it in Shuah's tree. Would it be possible to still submit this for
> 6.3-rc6 given the commit it fixes has made it to Linus' tree already?

Is it in linux-next?

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

* Re: [PATCH v2] selftests/clone3: fix number of tests in ksft_set_plan
  2023-04-05  7:46       ` Christian Brauner
@ 2023-04-05  9:43         ` Tobias Klauser
  2023-04-06 10:02           ` Christian Brauner
  0 siblings, 1 reply; 7+ messages in thread
From: Tobias Klauser @ 2023-04-05  9:43 UTC (permalink / raw)
  To: Christian Brauner; +Cc: Shuah Khan, linux-kselftest, linux-kernel

On 2023-04-05 at 09:46:11 +0200, Christian Brauner <brauner@kernel.org> wrote:
> On Mon, Apr 03, 2023 at 10:57:37PM +0200, Tobias Klauser wrote:
> > On 2023-03-14 at 14:09:59 +0100, Christian Brauner <brauner@kernel.org> wrote:
> > > On Tue, Mar 14, 2023 at 01:34:14PM +0100, Tobias Klauser wrote:
> > > > Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> > > > added an additional test, so the number passed to ksft_set_plan needs to
> > > > be bumped accordingly.
> > > > 
> > > > Also use ksft_finished() to print results and exit. This will catch future
> > > > mismatches between ksft_set_plan() and the number of tests being run.
> > > > 
> > > > Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> > > > Cc: Christian Brauner <brauner@kernel.org>
> > > > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> > > > ---
> > > 
> > > Looks good. Thanks for fixing this,
> > > Reviewed-by: Christian Brauner <brauner@kernel.org>
> > > 
> > > Feel free to take this through the selftests tree, Shuah.
> > 
> > It looks like this hasn't made it into Linus' tree yet and I also don't
> > see it in Shuah's tree. Would it be possible to still submit this for
> > 6.3-rc6 given the commit it fixes has made it to Linus' tree already?
> 
> Is it in linux-next?

No, doesn't look like it (I checked on tags/next-20230405).

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

* Re: [PATCH v2] selftests/clone3: fix number of tests in ksft_set_plan
  2023-04-05  9:43         ` Tobias Klauser
@ 2023-04-06 10:02           ` Christian Brauner
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2023-04-06 10:02 UTC (permalink / raw)
  To: Tobias Klauser
  Cc: Christian Brauner, linux-kselftest, linux-kernel, Shuah Khan


On Tue, 14 Mar 2023 13:34:14 +0100, Tobias Klauser wrote:
> Commit 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME")
> added an additional test, so the number passed to ksft_set_plan needs to
> be bumped accordingly.
> 
> Also use ksft_finished() to print results and exit. This will catch future
> mismatches between ksft_set_plan() and the number of tests being run.
> 
> [...]

Applied, thanks!

tree: git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
branch: kernel.fork
[1/1] selftests/clone3: fix number of tests in ksft_set_plan
      commit: d95debbdc528d50042807754d6085c15abc21768

I'm happy to drop it in case this is later picked up by the selftest tree.

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

end of thread, other threads:[~2023-04-06 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 11:53 [PATCH] selftests/clone3: fix number of tests in ksft_set_plan Tobias Klauser
2023-03-14 12:34 ` [PATCH v2] " Tobias Klauser
2023-03-14 13:09   ` Christian Brauner
2023-04-03 20:57     ` Tobias Klauser
2023-04-05  7:46       ` Christian Brauner
2023-04-05  9:43         ` Tobias Klauser
2023-04-06 10:02           ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).