Skip to content

Commit

Permalink
selftests/clone3: fix number of tests in ksft_set_plan
Browse files Browse the repository at this point in the history
[ Upstream commit d95debb ]

Commit 515bddf ("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: 515bddf ("selftests/clone3: test clone3 with CLONE_NEWTIME")
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tklauser authored and gregkh committed May 11, 2023
1 parent 08217fb commit 9e284d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/clone3/clone3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.*/
Expand Down Expand Up @@ -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();
}

0 comments on commit 9e284d3

Please sign in to comment.