]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: exit from test child processes
authorLuca Boccassi <luca.boccassi@gmail.com>
Tue, 9 Sep 2025 22:14:22 +0000 (23:14 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 9 Sep 2025 23:27:14 +0000 (00:27 +0100)
Otherwise the child processes will continue, return to the test
main function, and try to run other test cases themselves:

<...>
/* test_namespace_get_leader */
PID hierarchy: 553438 ← 553459 ← 553460
/* test_detach_mount_namespace_harder */
/* test_detach_mount_namespace_harder */
/* test_detach_mount_namespace_harder */

Follow-up for 0b8b13324e652cfc3b9f25dec0cf834705bbb8d0

src/test/test-namespace.c

index b301f3ea4bf9d57a456b81b1c439ed27b69e28b4..4b12e020e285306c3833906fe60ea3af09247e29 100644 (file)
@@ -416,7 +416,11 @@ TEST(namespace_get_leader) {
                         ASSERT_TRUE(!pidref_equal(&pid2, &leader));
                         ASSERT_TRUE(!pidref_equal(&original, &leader));
                         ASSERT_TRUE(!pidref_equal(&grandparent, &leader));
+
+                        _exit(EXIT_SUCCESS);
                 }
+
+                _exit(EXIT_SUCCESS);
         }
 }