selftests/clone3: test clone3 with exit signal in flags
authorTobias Klauser <tklauser@distanz.ch>
Thu, 4 May 2023 08:59:30 +0000 (10:59 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 12 Jun 2023 22:39:11 +0000 (16:39 -0600)
Verify that calling clone3 with an exit signal (SIGCHLD) in flags will
fail.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/clone3/clone3.c

index e495f895a2cdd0bc5bfe77bb8cfdfdf20c0584ed..e60cf4da8fb07ead4adfe1af6c2cb2c9a3f39805 100644 (file)
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
        uid_t uid = getuid();
 
        ksft_print_header();
-       ksft_set_plan(18);
+       ksft_set_plan(19);
        test_clone3_supported();
 
        /* Just a simple clone3() should return 0.*/
@@ -198,5 +198,8 @@ int main(int argc, char *argv[])
        /* Do a clone3() in a new time namespace */
        test_clone3(CLONE_NEWTIME, 0, 0, CLONE3_ARGS_NO_TEST);
 
+       /* Do a clone3() with exit signal (SIGCHLD) in flags */
+       test_clone3(SIGCHLD, 0, -EINVAL, CLONE3_ARGS_NO_TEST);
+
        ksft_finished();
 }