diff options
author | Andrei Vagin <avagin@gmail.com> | 2019-11-17 22:47:49 -0800 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2019-11-18 08:57:54 +0100 |
commit | 28df751539e8e3ba71c5b0d13647d1fdc7c1d287 (patch) | |
tree | 45c8f2a7ffc844dc5a38b3603c8e6e062ea3d642 /tools/testing/selftests/clone3/clone3_set_tid.c | |
parent | 4f5c289ea66a33457d51b305d4d77e1ca4c8ff17 (diff) | |
download | linux-28df751539e8e3ba71c5b0d13647d1fdc7c1d287.tar.bz2 |
selftests/clone3: report a correct number of fails
In clone3_set_tid, a few test cases are running in a child process. And
right now, if one of these test cases fails, the whole test will exit
with the success status.
Fixes: 41585bbeeef9 ("selftests: add tests for clone3() with *set_tid")
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Link: https://lore.kernel.org/r/20191118064750.408003-2-avagin@gmail.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'tools/testing/selftests/clone3/clone3_set_tid.c')
-rw-r--r-- | tools/testing/selftests/clone3/clone3_set_tid.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/testing/selftests/clone3/clone3_set_tid.c b/tools/testing/selftests/clone3/clone3_set_tid.c index e93369dcfe3b..9c19bae03661 100644 --- a/tools/testing/selftests/clone3/clone3_set_tid.c +++ b/tools/testing/selftests/clone3/clone3_set_tid.c @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) */ test_clone3_set_tid(set_tid, 3, CLONE_NEWPID, 0, 42, true); - child_exit(ksft_cnt.ksft_pass); + child_exit(ksft_cnt.ksft_fail); } close(pipe_1[1]); @@ -366,12 +366,8 @@ int main(int argc, char *argv[]) if (!WIFEXITED(status)) ksft_test_result_fail("Child error\n"); - if (WEXITSTATUS(status)) - /* - * Update the number of total tests with the tests from the - * child processes. - */ - ksft_cnt.ksft_pass = WEXITSTATUS(status); + ksft_cnt.ksft_pass += 4 - (ksft_cnt.ksft_fail - WEXITSTATUS(status)); + ksft_cnt.ksft_fail = WEXITSTATUS(status); if (ns3 == pid && ns2 == 42 && ns1 == 1) ksft_test_result_pass( |