未验证 提交 28df7515 编写于 作者: A Andrei Vagin 提交者: Christian Brauner

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: 41585bbe ("selftests: add tests for clone3() with *set_tid")
Signed-off-by: NAndrei Vagin <avagin@gmail.com>
Link: https://lore.kernel.org/r/20191118064750.408003-2-avagin@gmail.comSigned-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
上级 4f5c289e
......@@ -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(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册