Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-16169 test: Skip recovery tests requiring fault injection (#15159) #15169

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion src/tests/suite/daos_cr.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2023 Intel Corporation.
* (C) Copyright 2023-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");

/*
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Loading