Skip to contentSkip to conversation

selftests/clone3: fix number of tests in ksft_set_plan

PATCH Superseded Tobias Klauser 2 participants 7 messages Mar 14, 2023 – Apr 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/clone3: fix number of tests in ksft_set_plan

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 <[email protected]>
---
 tools/testing/selftests/clone3/clone3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/clone3/clone3.c +1 -1
index 4fce46afe6db..7b45c9854202 100644
@@ -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.*/
Signature · 1 line
2.39.1
#1 lore raw

PATCH v2 1/1 selftests/clone3: fix number of tests in ksft_set_plan

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 <[email protected]>

---
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(-)
tools/testing/selftests/clone3/clone3.c +2 -2
index 4fce46afe6db..e495f895a2cd 100644
@@ -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();
 }
Signature · 1 line
2.39.1
Reviewed-by on v2 1/1
#2 lore raw
Quoted 11 lines · Tobias Klauser

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 <[email protected]>

---

Looks good. Thanks for fixing this,

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

#3 lore raw
Quoted 13 lines · Christian Brauner
Quoted 11 lines · Tobias Klauser

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 <[email protected]>

---

Quoted 4 lines

Looks good. Thanks for fixing this,

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

#4 lore raw
Quoted 14 lines · Tobias Klauser
Quoted 13 lines · Christian Brauner
Quoted 11 lines · Tobias Klauser

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 <[email protected]>

---

Quoted 8 lines
Quoted 4 lines

Looks good. Thanks for fixing this,

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?

#5 lore raw
Quoted 18 lines · Christian Brauner
Quoted 17 lines · Tobias Klauser
Quoted 16 lines · Christian Brauner
Quoted 11 lines · Tobias Klauser

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 <[email protected]>

---

Looks good. Thanks for fixing this,

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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).

#6 lore raw
In reply to Tobias Klauser
Quoted 8 lines · Tobias Klauser

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.