From a92bd1a28b5dab2899b9f51dd2780b2d9e52e324 Mon Sep 17 00:00:00 2001 From: Tomas Glozar Date: Tue, 26 May 2026 12:25:21 +0200 Subject: [PATCH] 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 --- tools/tracing/rtla/tests/unit/actions.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/tracing/rtla/tests/unit/actions.c b/tools/tracing/rtla/tests/unit/actions.c index a5808ab71a4d..94ad5ad42774 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;