From: Tomas Glozar Date: Tue, 26 May 2026 10:25:21 +0000 (+0200) Subject: rtla/tests: Add unit test for restoring continue flag X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a92bd1a28b5dab2899b9f51dd2780b2d9e52e324;p=thirdparty%2Fkernel%2Flinux.git rtla/tests: Add unit test for restoring continue flag In case an action preceding the continue action fails, not only the continue flag should not be set, it should be unset if it was set from a previous run of actions_perform(). Add a unit test to check if this is implemented correctly. Link: https://lore.kernel.org/r/20260526102523.2662391-2-tglozar@redhat.com Signed-off-by: Tomas Glozar --- diff --git a/tools/tracing/rtla/tests/unit/actions.c b/tools/tracing/rtla/tests/unit/actions.c index a5808ab71a4d7..94ad5ad42774b 100644 --- a/tools/tracing/rtla/tests/unit/actions.c +++ b/tools/tracing/rtla/tests/unit/actions.c @@ -328,6 +328,18 @@ START_TEST(test_actions_perform_continue_after_failed_shell_command) } END_TEST +START_TEST(test_actions_perform_continue_unset_flag) +{ + actions_fixture.continue_flag = true; + + actions_add_shell(&actions_fixture, "exit 1"); + actions_add_continue(&actions_fixture); + ck_assert_int_eq(actions_perform(&actions_fixture), 1 << 8); + + ck_assert(!actions_fixture.continue_flag); +} +END_TEST + Suite *actions_suite(void) { Suite *s = suite_create("actions"); @@ -374,6 +386,7 @@ Suite *actions_suite(void) tcase_add_test(tc, test_actions_perform_continue); tcase_add_test(tc, test_actions_perform_continue_after_successful_shell_command); tcase_add_test(tc, test_actions_perform_continue_after_failed_shell_command); + tcase_add_test(tc, test_actions_perform_continue_unset_flag); suite_add_tcase(s, tc); return s;