From a6d2773fa0bc0797de620a45e9542c35d44e0fcb Mon Sep 17 00:00:00 2001 From: Phil Henderson Date: Fri, 20 Sep 2024 11:57:57 -0400 Subject: [PATCH] DAOS-16169 test: Skip recovery tests requiring fault injection (#15159) When running the recovery/cat_recov_core.py in release builds the tests should be skipped as they require fault injection. Signed-off-by: Phil Henderson --- src/tests/suite/daos_cr.c | 58 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/src/tests/suite/daos_cr.c b/src/tests/suite/daos_cr.c index 2390d668e31..3827a0eda6a 100644 --- a/src/tests/suite/daos_cr.c +++ b/src/tests/suite/daos_cr.c @@ -1,5 +1,5 @@ /** - * (C) Copyright 2023 Intel Corporation. + * (C) Copyright 2023-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -1001,6 +1001,8 @@ cr_start_specified(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR1: start checker for specified pools\n"); for (i = 0; i < 3; i++) { @@ -1092,6 +1094,8 @@ cr_leader_interaction(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR2: check leader side interaction\n"); rc = cr_pool_create(state, &pool, false, class); @@ -1178,6 +1182,8 @@ cr_engine_interaction(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR3: check engine side interaction\n"); rc = cr_pool_create(state, &pool, true, TCC_NONE); @@ -1268,6 +1274,8 @@ cr_repair_forall_leader(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR4: check repair option - for-all, on leader\n"); for (i = 0; i < 2; i++) { @@ -1372,6 +1380,8 @@ cr_repair_forall_engine(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR5: check repair option - for-all, on engine\n"); for (i = 0; i < 2; i++) { @@ -1471,6 +1481,8 @@ cr_stop_leader_interaction(void **state) uint32_t action = TCA_INTERACT; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR6: stop checker with pending check leader interaction\n"); rc = cr_pool_create(state, &pool, false, class); @@ -1546,6 +1558,8 @@ cr_stop_engine_interaction(void **state) uint32_t action = TCA_INTERACT; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR7: stop checker with pending check engine interaction\n"); rc = cr_pool_create(state, &pool, true, TCC_NONE); @@ -1628,6 +1642,8 @@ cr_stop_specified(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR8: stop checker for specified pools\n"); for (i = 0; i < 3; i++) { @@ -1756,6 +1772,8 @@ cr_auto_reset(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR9: reset checker automatically if former instance completed\n"); rc = cr_pool_create(state, &pool, false, class); @@ -1853,6 +1871,8 @@ cr_pause(void **state, bool force) int rc; int i; + FAULT_INJECTION_REQUIRED(); + rc = cr_pool_create(state, &pool, false, class); assert_rc_equal(rc, 0); @@ -1920,6 +1940,8 @@ cr_pause(void **state, bool force) static void cr_shutdown(void **state) { + FAULT_INJECTION_REQUIRED(); + print_message("CR10: checker shutdown\n"); cr_pause(state, false); @@ -1937,6 +1959,8 @@ cr_shutdown(void **state) static void cr_crash(void **state) { + FAULT_INJECTION_REQUIRED(); + print_message("CR11: checker crash\n"); cr_pause(state, true); @@ -1970,6 +1994,8 @@ cr_leader_resume(void **state) daos_size_t pool_nr = 1; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR12: check leader resume from former stop/paused phase\n"); rc = cr_pool_create(state, &pool, false, class); @@ -2093,6 +2119,8 @@ cr_engine_resume(void **state) uint32_t action = TCA_TRUST_PS; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR13: check engine resume from former stop/paused phase\n"); rc = cr_pool_create(state, &pool, false, class); @@ -2197,6 +2225,8 @@ cr_reset_specified(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR14: reset checker for specified pools\n"); /* @@ -2317,6 +2347,8 @@ cr_failout(void **state) int result = -DER_IO; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR15: check start option - failout\n"); rc = cr_pool_create(state, &pool, false, class); @@ -2398,6 +2430,8 @@ cr_auto_repair(void **state) uint32_t action; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR16: check start option - auto repair\n"); rc = cr_pool_create(state, &pool, true, TCC_NONE); @@ -2468,6 +2502,8 @@ cr_orphan_pool(void **state) daos_size_t pool_nr = 2; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR17: check start option - scan orphan pools by force\n"); rc = cr_pool_create(state, &pools[0], false, TCC_NONE); @@ -2641,6 +2677,8 @@ cr_fail_ps_sync(void **state, bool leader) static void cr_fail_sync_leader(void **state) { + FAULT_INJECTION_REQUIRED(); + print_message("CR18: PS leader fails to sync pool status with check leader\n"); cr_fail_ps_sync(state, true); @@ -2664,6 +2702,8 @@ cr_fail_sync_leader(void **state) static void cr_fail_sync_engine(void **state) { + FAULT_INJECTION_REQUIRED(); + print_message("CR19: PS leader fails to sync pool status with check engines\n"); cr_fail_ps_sync(state, false); @@ -2694,6 +2734,8 @@ cr_engine_death(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR20: check engine death during check\n"); rc = cr_pool_create_with_svc(state, &pool, true, class); @@ -2796,6 +2838,8 @@ cr_engine_rejoin_succ(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR21: check engine rejoins check instance successfully\n"); rc = cr_pool_create_with_svc(state, &pool, true, class); @@ -2911,6 +2955,8 @@ cr_engine_rejoin_fail(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR22: check engine fails to rejoin check instance\n"); rc = cr_pool_create_with_svc(state, &pool, true, class); @@ -3046,6 +3092,8 @@ cr_multiple_pools(void **state) int i; int j; + FAULT_INJECTION_REQUIRED(); + print_message("CR23: control multiple pools check start/stop sequence\n"); classes[0] = TCC_POOL_BAD_LABEL; @@ -3230,6 +3278,8 @@ cr_fail_sync_orphan(void **state) struct daos_check_info dci = { 0 }; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR24: check leader failed to notify check engine about orphan process\n"); rc = cr_pool_create(state, &pool, false, TCC_NONE); @@ -3299,6 +3349,8 @@ cr_inherit_policy(void **state) int rc; int i; + FAULT_INJECTION_REQUIRED(); + print_message("CR25: inherit check policy from former check repair\n"); for (i = 0; i < 2; i++) { @@ -3395,6 +3447,8 @@ cr_handle_fail_pool1(void **state) struct daos_check_info dci = { 0 }; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR26: skip the pool if some engine failed to report some pool shard\n"); rc = cr_pool_create(state, &pool, false, TCC_NONE); @@ -3453,6 +3507,8 @@ cr_handle_fail_pool2(void **state) uint32_t count; int rc; + FAULT_INJECTION_REQUIRED(); + print_message("CR27: handle the pool if some engine failed to report some pool service\n"); rc = cr_pool_create(state, &pool, false, TCC_NONE);