selftests/clone3: Reorder reporting output
authorKees Cook <keescook@chromium.org>
Mon, 22 Jun 2020 18:16:44 +0000 (11:16 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 Jul 2020 21:58:49 +0000 (15:58 -0600)
Selftest output reporting was happening before the TAP headers and plan
had been emitted. Move the first test reports later.

Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/clone3/clone3.c
tools/testing/selftests/clone3/clone3_clear_sighand.c
tools/testing/selftests/clone3/clone3_set_tid.c

index f14c269a5a184bc786f66efb6f1fe9ae59b7b1f2..b7e6dec36173d2812b8c4ab017f3565e37eb81b2 100644 (file)
@@ -131,9 +131,9 @@ int main(int argc, char *argv[])
 
        uid_t uid = getuid();
 
-       test_clone3_supported();
        ksft_print_header();
        ksft_set_plan(17);
+       test_clone3_supported();
 
        /* Just a simple clone3() should return 0.*/
        test_clone3(0, 0, 0, CLONE3_ARGS_NO_TEST);
index 9e1af8aa769860242aad4ffc84b7c2fa86dbd242..db5fc9c5edcf370c82bc635f25e5a04d3dbddb69 100644 (file)
@@ -119,9 +119,8 @@ static void test_clone3_clear_sighand(void)
 int main(int argc, char **argv)
 {
        ksft_print_header();
-       test_clone3_supported();
-
        ksft_set_plan(1);
+       test_clone3_supported();
 
        test_clone3_clear_sighand();
 
index 25beb22f35b50d9affe29feed3cb88df1b0fd757..5831c1082d6d0fe025551d1b54f178ef51d62c1b 100644 (file)
@@ -157,8 +157,8 @@ int main(int argc, char *argv[])
        pid_t set_tid[MAX_PID_NS_LEVEL * 2];
 
        ksft_print_header();
-       test_clone3_supported();
        ksft_set_plan(29);
+       test_clone3_supported();
 
        if (pipe(pipe_1) < 0 || pipe(pipe_2) < 0)
                ksft_exit_fail_msg("pipe() failed\n");