From 2da0d5bba10aa606b125eafc88a905fba9ae0f26 Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Fri, 30 Oct 2026 15:56:23 +0000 Subject: [PATCH 1/6] DAOS-19836 dlck: add faults unit tests Test procedure: - create a pool and populate it with standard data with dlck_test_helper - read faults from fault_injection_dlck.yaml - for each fault: - generate a YAML fault injection file - run DLCK against the pre-prepared pool with the fault injected - collect stdout and DLCK logs - compare collected data with templates e.g. - fault_templates/DAOS_FAULT_CONT_INV_PAD/output.txt and - fault_templates/DAOS_FAULT_CONT_INV_PAD/{{UUID}}_vos-0 - add DLCK_NO_NVME env variable to disable unnecessary NVMe-submodules initialization - the UT environment does not allow to allocate necessary DMA buffers. Note: Please do not pay too much attention to quirks in the templates. Most of them are planned to be fixed in a separate pull request. e.g. DAOS-19846 skip-unit-test-with-memcheck: true skip-test-rpms: true Skip-func-vm: true Skip-fault-injection-test: true Skip-test-el-9.6-rpms: true Skip-test-leap-15-rpms: true Skip-func-hw-test: true Signed-off-by: Jan Michalski --- ci/test_files_to_stash.txt | 8 +- src/utils/dlck/dlck_engine.c | 4 + .../DAOS_FAULT_CONT_INV_PAD/output.txt | 17 + .../DAOS_FAULT_CONT_INV_PAD/{{UUID}}_vos-0 | 79 ++++ .../output.txt | 17 + .../{{UUID}}_vos-0 | 79 ++++ .../DAOS_FAULT_CONT_INV_USED/output.txt | 17 + .../DAOS_FAULT_CONT_INV_USED/{{UUID}}_vos-0 | 79 ++++ .../DAOS_FAULT_CONT_OPEN_UUID/output.txt | 17 + .../DAOS_FAULT_CONT_OPEN_UUID/{{UUID}}_vos-0 | 26 ++ .../DAOS_FAULT_CONT_TREE_FEATURES/output.txt | 16 + .../{{UUID}}_vos-0 | 14 + .../DAOS_FAULT_CONT_TREE_INV_CLASS/output.txt | 16 + .../{{UUID}}_vos-0 | 13 + .../output.txt | 16 + .../{{UUID}}_vos-0 | 13 + .../DAOS_FAULT_DAE_ALLOC/output.txt | 17 + .../DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 | 48 +++ .../DAOS_FAULT_DAE_INV_FLAGS/output.txt | 17 + .../DAOS_FAULT_DAE_INV_FLAGS/{{UUID}}_vos-0 | 47 +++ .../DAOS_FAULT_DBD_COUNT/output.txt | 17 + .../DAOS_FAULT_DBD_COUNT/{{UUID}}_vos-0 | 64 +++ .../DAOS_FAULT_DBD_MAGIC/output.txt | 17 + .../DAOS_FAULT_DBD_MAGIC/{{UUID}}_vos-0 | 45 ++ .../DAOS_FAULT_GC_TREE_FEATURES/output.txt | 16 + .../{{UUID}}_vos-0 | 20 + .../DAOS_FAULT_GC_TREE_INV_CLASS/output.txt | 16 + .../{{UUID}}_vos-0 | 19 + .../DAOS_FAULT_GC_TREE_UNREG_CLASS/output.txt | 16 + .../{{UUID}}_vos-0 | 19 + .../DAOS_FAULT_OBJ_ILOG_MAGIC/output.txt | 17 + .../DAOS_FAULT_OBJ_ILOG_MAGIC/{{UUID}}_vos-0 | 37 ++ .../DAOS_FAULT_POOL_EXT_PADDING/output.txt | 17 + .../{{UUID}}_vos-0 | 130 ++++++ .../DAOS_FAULT_POOL_EXT_RESERVED/output.txt | 17 + .../{{UUID}}_vos-0 | 79 ++++ .../DLCK_FAULT_CONT_DOES_NOT_EXIST/output.txt | 16 + .../{{UUID}}_vos-0 | 8 + .../DLCK_FAULT_CREATE_LOG_DIR/output.txt | 2 + .../DLCK_FAULT_CREATE_POOL_DIR/output.txt | 5 + .../DLCK_FAULT_ENGINE_EXEC/output.txt | 5 + .../DLCK_FAULT_ENGINE_JOIN/output.txt | 9 + .../DLCK_FAULT_ENGINE_JOIN/{{UUID}}_vos-0 | 78 ++++ .../DLCK_FAULT_ENGINE_START/output.txt | 3 + .../DLCK_FAULT_POOL_NVME_HEALTH/output.txt | 7 + .../{{UUID}}_vos-0 | 5 + .../DLCK_FAULT_POOL_OPEN_BIO/output.txt | 8 + .../DLCK_FAULT_POOL_OPEN_BIO/{{UUID}}_vos-0 | 21 + .../DLCK_FAULT_POOL_OPEN_MAGIC/output.txt | 16 + .../DLCK_FAULT_POOL_OPEN_MAGIC/{{UUID}}_vos-0 | 7 + .../DLCK_FAULT_POOL_OPEN_UMEM/output.txt | 16 + .../DLCK_FAULT_POOL_OPEN_UMEM/{{UUID}}_vos-0 | 6 + .../DLCK_FAULT_POOL_OPEN_UUID/output.txt | 16 + .../DLCK_FAULT_POOL_OPEN_UUID/{{UUID}}_vos-0 | 9 + .../DLCK_FAULT_POOL_OPEN_VERSION/output.txt | 16 + .../{{UUID}}_vos-0 | 8 + .../DLCK_FAULT_POOL_PATH_ALLOC/output.txt | 16 + .../DLCK_FAULT_POOL_PATH_ALLOC/{{UUID}}_vos-0 | 2 + .../DLCK_FAULT_POOL_PREALLOCATE/output.txt | 16 + .../{{UUID}}_vos-0 | 1 + src/utils/dlck/tests/run_fault_injection.py | 390 ++++++++++++++++++ utils/utest.yaml | 4 + 62 files changed, 1793 insertions(+), 3 deletions(-) create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_LOG_DIR/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_POOL_DIR/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_EXEC/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_START/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/{{UUID}}_vos-0 create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/output.txt create mode 100644 src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/{{UUID}}_vos-0 create mode 100755 src/utils/dlck/tests/run_fault_injection.py diff --git a/ci/test_files_to_stash.txt b/ci/test_files_to_stash.txt index 29f8a91805a..5245f23472e 100755 --- a/ci/test_files_to_stash.txt +++ b/ci/test_files_to_stash.txt @@ -51,9 +51,11 @@ build/*/*/src/utils/dlck/tests/dlck_checker_common_ut, build/*/*/src/utils/dlck/tests/dlck_checker_macros_ut, build/*/*/src/utils/dlck/tests/dlck_checker_main_ut, build/*/*/src/utils/dlck/tests/dlck_checker_worker_ut, +build/*/*/src/utils/dlck/tests/dlck_test_helper, src/common/tests/btree.sh, src/control/run_go_tests.sh, src/rdb/raft_tests/raft_tests.py, -src/vos/tests/evt_ctl.sh -src/control/lib/netdetect/netdetect.go -src/include/** +src/vos/tests/evt_ctl.sh, +src/control/lib/netdetect/netdetect.go, +src/include/**, +src/utils/dlck/test/fault_templates/** diff --git a/src/utils/dlck/dlck_engine.c b/src/utils/dlck/dlck_engine.c index f3ae969fd39..4540b60d27b 100644 --- a/src/utils/dlck/dlck_engine.c +++ b/src/utils/dlck/dlck_engine.c @@ -106,6 +106,10 @@ dlck_engine_xstream_is_sys(int tgt_id) static inline bool dlck_engine_xstream_has_nvme(int tgt_id) { + if (getenv("DLCK_NO_NVME") != NULL) { + return false; + } + /** * Since there are no helper execution streams (XS) right now. All non-sys XSes are main * XSes as defined for daos_engine. diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/output.txt new file mode 100644 index 00000000000..dc140ddcb8f --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +[0] container {{UUID}} check resultok (1 warning(s)). +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 0 error(s), 1 warning(s). +=============================== +Total: 0 error(s), 1 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/{{UUID}}_vos-0 new file mode 100644 index 00000000000..03ab6f861a7 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_PAD/{{UUID}}_vos-0 @@ -0,0 +1,79 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... warning: non-zero (0) +ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... ok. +---- [0] Append to active DTX tree... ok. +---- [1] ID (dae_xid)... ok. +---- [1] LID (dae_lid)... ok. +---- [1] Append to active DTX tree... ok. +---- [2] flagged invalid. +---- [3] ID (dae_xid)... ok. +---- [3] LID (dae_lid)... ok. +---- [3] Append to active DTX tree... ok. +---- [4] flagged invalid. +---- [5] ID (dae_xid)... ok. +---- [5] LID (dae_lid)... ok. +---- [5] Append to active DTX tree... ok. +---- [6] ID (dae_xid)... ok. +---- [6] LID (dae_lid)... ok. +---- [6] Append to active DTX tree... ok. +-- DTX blob (off=0x514650)... ok. +- Active DTX blob list: ok. +Check container: ok. +Check oid: 1185667690.2136093645.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb01880)... ok. +- Dkey tree: ok. +Check oid: 1185667690.2136093645.0.0: ok. +Check oid: 471378945.1581695481.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb016a0)... ok. +- Dkey tree: ok. +Check oid: 471378945.1581695481.0.0: ok. diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/output.txt new file mode 100644 index 00000000000..dc140ddcb8f --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +[0] container {{UUID}} check resultok (1 warning(s)). +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 0 error(s), 1 warning(s). +=============================== +Total: 0 error(s), 1 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/{{UUID}}_vos-0 new file mode 100644 index 00000000000..f7bf5f5abad --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_RESERV_UPGRADE/{{UUID}}_vos-0 @@ -0,0 +1,79 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... warning: non-zero (0) +ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... ok. +---- [0] Append to active DTX tree... ok. +---- [1] ID (dae_xid)... ok. +---- [1] LID (dae_lid)... ok. +---- [1] Append to active DTX tree... ok. +---- [2] flagged invalid. +---- [3] ID (dae_xid)... ok. +---- [3] LID (dae_lid)... ok. +---- [3] Append to active DTX tree... ok. +---- [4] flagged invalid. +---- [5] ID (dae_xid)... ok. +---- [5] LID (dae_lid)... ok. +---- [5] Append to active DTX tree... ok. +---- [6] ID (dae_xid)... ok. +---- [6] LID (dae_lid)... ok. +---- [6] Append to active DTX tree... ok. +-- DTX blob (off=0x514650)... ok. +- Active DTX blob list: ok. +Check container: ok. +Check oid: 1185667690.2136093645.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb01880)... ok. +- Dkey tree: ok. +Check oid: 1185667690.2136093645.0.0: ok. +Check oid: 471378945.1581695481.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb016a0)... ok. +- Dkey tree: ok. +Check oid: 471378945.1581695481.0.0: ok. diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/output.txt new file mode 100644 index 00000000000..dc140ddcb8f --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +[0] container {{UUID}} check resultok (1 warning(s)). +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 0 error(s), 1 warning(s). +=============================== +Total: 0 error(s), 1 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/{{UUID}}_vos-0 new file mode 100644 index 00000000000..68365bcf655 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_INV_USED/{{UUID}}_vos-0 @@ -0,0 +1,79 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... warning: non-zero (0) +ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... ok. +---- [0] Append to active DTX tree... ok. +---- [1] ID (dae_xid)... ok. +---- [1] LID (dae_lid)... ok. +---- [1] Append to active DTX tree... ok. +---- [2] flagged invalid. +---- [3] ID (dae_xid)... ok. +---- [3] LID (dae_lid)... ok. +---- [3] Append to active DTX tree... ok. +---- [4] flagged invalid. +---- [5] ID (dae_xid)... ok. +---- [5] LID (dae_lid)... ok. +---- [5] Append to active DTX tree... ok. +---- [6] ID (dae_xid)... ok. +---- [6] LID (dae_lid)... ok. +---- [6] Append to active DTX tree... ok. +-- DTX blob (off=0x514650)... ok. +- Active DTX blob list: ok. +Check container: ok. +Check oid: 1185667690.2136093645.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb01880)... ok. +- Dkey tree: ok. +Check oid: 1185667690.2136093645.0.0: ok. +Check oid: 471378945.1581695481.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb016a0)... ok. +- Dkey tree: ok. +Check oid: 471378945.1581695481.0.0: ok. diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/output.txt new file mode 100644 index 00000000000..c2a435619a1 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +error: [0] container {{UUID}} check result: DER_ID_MISMATCH(-2035): 'ID mismatch' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/{{UUID}}_vos-0 new file mode 100644 index 00000000000..27efafd7bf8 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_OPEN_UUID/{{UUID}}_vos-0 @@ -0,0 +1,26 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... error: mismatch ({{UUID}} != {{UUID}}) + +error: Check container: DER_ID_MISMATCH(-2035): 'ID mismatch' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/output.txt new file mode 100644 index 00000000000..2c5cb63ef20 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_PROTO(-1014): 'Incompatible protocol' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/{{UUID}}_vos-0 new file mode 100644 index 00000000000..c0ce1f87e14 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_FEATURES/{{UUID}}_vos-0 @@ -0,0 +1,14 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... error: Unsupported features 0/0 + +- error: Containers tree: DER_PROTO(-1014): 'Incompatible protocol' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/output.txt new file mode 100644 index 00000000000..af001f0abf5 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_INVAL(-1003): 'Invalid parameters' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/{{UUID}}_vos-0 new file mode 100644 index 00000000000..c4ad851a4b9 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_INV_CLASS/{{UUID}}_vos-0 @@ -0,0 +1,13 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... error: Invalid class id: 14 + +- error: Containers tree: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/output.txt new file mode 100644 index 00000000000..0ecf6a2e8e0 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_NONEXIST(-1005): 'The specified entity does not exist' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/{{UUID}}_vos-0 new file mode 100644 index 00000000000..eb7ca62b479 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_CONT_TREE_UNREG_CLASS/{{UUID}}_vos-0 @@ -0,0 +1,13 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... error: Unregistered class id 14 + +- error: Containers tree: DER_NONEXIST(-1005): 'The specified entity does not exist' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt new file mode 100644 index 00000000000..f2199647aa3 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +error: [0] container {{UUID}} check result: DER_IO(-2001): 'I / O error' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: ok. +=============================== +Total: 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 new file mode 100644 index 00000000000..ab6f94b73a4 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 @@ -0,0 +1,48 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... error: cannot append to the active DTX table (dae_lid=2, dae_epoch=0x28e6104968380001) +- error: Active DTX blob list: DER_IO(-2001): 'I / O error' +error: Check container: DER_IO(-2001): 'I / O error' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/output.txt new file mode 100644 index 00000000000..4f715474f45 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +error: [0] container {{UUID}} check result: DER_IO(-2001): 'I / O error' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/{{UUID}}_vos-0 new file mode 100644 index 00000000000..4a67427d3d6 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_INV_FLAGS/{{UUID}}_vos-0 @@ -0,0 +1,47 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] invalid flags (0x20) +- error: Active DTX blob list: DER_IO(-2001): 'I / O error' +error: Check container: DER_IO(-2001): 'I / O error' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/output.txt new file mode 100644 index 00000000000..4f715474f45 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +error: [0] container {{UUID}} check result: DER_IO(-2001): 'I / O error' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/{{UUID}}_vos-0 new file mode 100644 index 00000000000..185e88945dc --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_COUNT/{{UUID}}_vos-0 @@ -0,0 +1,64 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... ok. +---- [0] Append to active DTX tree... ok. +---- [1] ID (dae_xid)... ok. +---- [1] LID (dae_lid)... ok. +---- [1] Append to active DTX tree... ok. +---- [2] flagged invalid. +---- [3] ID (dae_xid)... ok. +---- [3] LID (dae_lid)... ok. +---- [3] Append to active DTX tree... ok. +---- [4] flagged invalid. +---- [5] ID (dae_xid)... ok. +---- [5] LID (dae_lid)... ok. +---- [5] Append to active DTX tree... ok. +---- [6] ID (dae_xid)... ok. +---- [6] LID (dae_lid)... ok. +---- [6] Append to active DTX tree... ok. +--- DTX blob (off=0x514650)... expected 5 active entries, but found 5. +- error: Active DTX blob list: DER_IO(-2001): 'I / O error' +error: Check container: DER_IO(-2001): 'I / O error' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/output.txt new file mode 100644 index 00000000000..2ea2812b935 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +error: [0] container {{UUID}} check result: DER_DF_INVAL(-2022): 'Unsupported durable format' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/{{UUID}}_vos-0 new file mode 100644 index 00000000000..2d0bc7a6147 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DBD_MAGIC/{{UUID}}_vos-0 @@ -0,0 +1,45 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... error: invalid (0x14130a2b) +- error: Active DTX blob list: DER_DF_INVAL(-2022): 'Unsupported durable format' +error: Check container: DER_DF_INVAL(-2022): 'Unsupported durable format' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/output.txt new file mode 100644 index 00000000000..2c5cb63ef20 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_PROTO(-1014): 'Incompatible protocol' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/{{UUID}}_vos-0 new file mode 100644 index 00000000000..f202c75b872 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_FEATURES/{{UUID}}_vos-0 @@ -0,0 +1,20 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... error: Unsupported features 1/3 + +- error: Garbage collector's tree: DER_PROTO(-1014): 'Incompatible protocol' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/output.txt new file mode 100644 index 00000000000..af001f0abf5 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_INVAL(-1003): 'Invalid parameters' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/{{UUID}}_vos-0 new file mode 100644 index 00000000000..e4c444e4703 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_INV_CLASS/{{UUID}}_vos-0 @@ -0,0 +1,19 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... error: Invalid class id: 28 + +- error: Garbage collector's tree: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/output.txt new file mode 100644 index 00000000000..0ecf6a2e8e0 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_NONEXIST(-1005): 'The specified entity does not exist' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/{{UUID}}_vos-0 new file mode 100644 index 00000000000..a2488fb6747 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_GC_TREE_UNREG_CLASS/{{UUID}}_vos-0 @@ -0,0 +1,19 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... error: Unregistered class id 28 + +- error: Garbage collector's tree: DER_NONEXIST(-1005): 'The specified entity does not exist' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/output.txt new file mode 100644 index 00000000000..2ea2812b935 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +error: [0] container {{UUID}} check result: DER_DF_INVAL(-2022): 'Unsupported durable format' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/{{UUID}}_vos-0 new file mode 100644 index 00000000000..f53c1130461 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_OBJ_ILOG_MAGIC/{{UUID}}_vos-0 @@ -0,0 +1,37 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... error: invalid magic (0x46). +---- Object (oid=1185667690.2136093645.0.0)... error: DER_DF_INVAL(-2022): 'Unsupported durable format' +- error: Object index tree: DER_DF_INVAL(-2022): 'Unsupported durable format' +error: Check container: DER_DF_INVAL(-2022): 'Unsupported durable format' diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/output.txt new file mode 100644 index 00000000000..b693212d852 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +[0] container {{UUID}} check result: ok. +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 0 error(s), 52 warning(s). +=============================== +Total: 0 error(s), 52 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/{{UUID}}_vos-0 new file mode 100644 index 00000000000..5d55be4366c --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_PADDING/{{UUID}}_vos-0 @@ -0,0 +1,130 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... warning: non-zero padding[0] (0) +warning: non-zero padding[1] (0) +warning: non-zero padding[2] (0) +warning: non-zero padding[3] (0) +warning: non-zero padding[4] (0) +warning: non-zero padding[5] (0) +warning: non-zero padding[6] (0) +warning: non-zero padding[7] (0) +warning: non-zero padding[8] (0) +warning: non-zero padding[9] (0) +warning: non-zero padding[10] (0) +warning: non-zero padding[11] (0) +warning: non-zero padding[12] (0) +warning: non-zero padding[13] (0) +warning: non-zero padding[14] (0) +warning: non-zero padding[15] (0) +warning: non-zero padding[16] (0) +warning: non-zero padding[17] (0) +warning: non-zero padding[18] (0) +warning: non-zero padding[19] (0) +warning: non-zero padding[20] (0) +warning: non-zero padding[21] (0) +warning: non-zero padding[22] (0) +warning: non-zero padding[23] (0) +warning: non-zero padding[24] (0) +warning: non-zero padding[25] (0) +warning: non-zero padding[26] (0) +warning: non-zero padding[27] (0) +warning: non-zero padding[28] (0) +warning: non-zero padding[29] (0) +warning: non-zero padding[30] (0) +warning: non-zero padding[31] (0) +warning: non-zero padding[32] (0) +warning: non-zero padding[33] (0) +warning: non-zero padding[34] (0) +warning: non-zero padding[35] (0) +warning: non-zero padding[36] (0) +warning: non-zero padding[37] (0) +warning: non-zero padding[38] (0) +warning: non-zero padding[39] (0) +warning: non-zero padding[40] (0) +warning: non-zero padding[41] (0) +warning: non-zero padding[42] (0) +warning: non-zero padding[43] (0) +warning: non-zero padding[44] (0) +warning: non-zero padding[45] (0) +warning: non-zero padding[46] (0) +warning: non-zero padding[47] (0) +warning: non-zero padding[48] (0) +warning: non-zero padding[49] (0) +warning: non-zero padding[50] (0) +warning: non-zero padding[51] (0) +ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... ok. +---- [0] Append to active DTX tree... ok. +---- [1] ID (dae_xid)... ok. +---- [1] LID (dae_lid)... ok. +---- [1] Append to active DTX tree... ok. +---- [2] flagged invalid. +---- [3] ID (dae_xid)... ok. +---- [3] LID (dae_lid)... ok. +---- [3] Append to active DTX tree... ok. +---- [4] flagged invalid. +---- [5] ID (dae_xid)... ok. +---- [5] LID (dae_lid)... ok. +---- [5] Append to active DTX tree... ok. +---- [6] ID (dae_xid)... ok. +---- [6] LID (dae_lid)... ok. +---- [6] Append to active DTX tree... ok. +-- DTX blob (off=0x514650)... ok. +- Active DTX blob list: ok. +Check container: ok. +Check oid: 1185667690.2136093645.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb01880)... ok. +- Dkey tree: ok. +Check oid: 1185667690.2136093645.0.0: ok. +Check oid: 471378945.1581695481.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb016a0)... ok. +- Dkey tree: ok. +Check oid: 471378945.1581695481.0.0: ok. diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/output.txt new file mode 100644 index 00000000000..3fd17b8ca6a --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/output.txt @@ -0,0 +1,17 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +[0] container {{UUID}} check result: ok. +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 0 error(s), 1 warning(s). +=============================== +Total: 0 error(s), 1 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/{{UUID}}_vos-0 new file mode 100644 index 00000000000..0ee4a5bda25 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_POOL_EXT_RESERVED/{{UUID}}_vos-0 @@ -0,0 +1,79 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... warning: non-zero reserved space (0) +ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... ok. +---- [0] Append to active DTX tree... ok. +---- [1] ID (dae_xid)... ok. +---- [1] LID (dae_lid)... ok. +---- [1] Append to active DTX tree... ok. +---- [2] flagged invalid. +---- [3] ID (dae_xid)... ok. +---- [3] LID (dae_lid)... ok. +---- [3] Append to active DTX tree... ok. +---- [4] flagged invalid. +---- [5] ID (dae_xid)... ok. +---- [5] LID (dae_lid)... ok. +---- [5] Append to active DTX tree... ok. +---- [6] ID (dae_xid)... ok. +---- [6] LID (dae_lid)... ok. +---- [6] Append to active DTX tree... ok. +-- DTX blob (off=0x514650)... ok. +- Active DTX blob list: ok. +Check container: ok. +Check oid: 1185667690.2136093645.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb01880)... ok. +- Dkey tree: ok. +Check oid: 1185667690.2136093645.0.0: ok. +Check oid: 471378945.1581695481.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb016a0)... ok. +- Dkey tree: ok. +Check oid: 471378945.1581695481.0.0: ok. diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/output.txt new file mode 100644 index 00000000000..c0e41fbe345 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_DF_INCOMPT(-2023): 'Incompatible durable format version' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/{{UUID}}_vos-0 new file mode 100644 index 00000000000..92a81d8b9e6 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CONT_DOES_NOT_EXIST/{{UUID}}_vos-0 @@ -0,0 +1,8 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... error: unsupported (0x1c) diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_LOG_DIR/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_LOG_DIR/output.txt new file mode 100644 index 00000000000..49ddcfb7d0a --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_LOG_DIR/output.txt @@ -0,0 +1,2 @@ +Effective user: root +error: Cannot create log directory: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_POOL_DIR/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_POOL_DIR/output.txt new file mode 100644 index 00000000000..35658cc01ef --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_CREATE_POOL_DIR/output.txt @@ -0,0 +1,5 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... error: Cannot create a pool directory: {{STORAGE}}/{{UUID}}/: DER_INVAL(-1003): 'Invalid parameters' +error: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_EXEC/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_EXEC/output.txt new file mode 100644 index 00000000000..4a5438512f6 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_EXEC/output.txt @@ -0,0 +1,5 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... error: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/output.txt new file mode 100644 index 00000000000..d283bbb2409 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/output.txt @@ -0,0 +1,9 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +[0] container {{UUID}} check result: ok. +error: Wait for targets to stop: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/{{UUID}}_vos-0 new file mode 100644 index 00000000000..1a64a064296 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_JOIN/{{UUID}}_vos-0 @@ -0,0 +1,78 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. +Check container: + uuid: {{UUID}} +- uuid... ok. +- Padding (cd_pad)... ok. +- Padding (cd_used)... ok. +- Reserved (cd_reserv_upgrade)... ok. +- Object index tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a6c0)... ok. +--- Record fetch (off=0xac05c0)... ok. +---- Object (oid=1185667690.2136093645.0.0)... +----- ILOG... ok. +---- Object (oid=1185667690.2136093645.0.0)... ok. +--- Record fetch (off=0xac0540)... ok. +---- Object (oid=471378945.1581695481.0.0)... +----- ILOG... ok. +---- Object (oid=471378945.1581695481.0.0)... ok. +- Object index tree: ok. +- Active DTX blob list... +-- DTX blob (off=0x514650)... +--- Magic... ok. +--- 7 active entries: +---- [0] ID (dae_xid)... ok. +---- [0] LID (dae_lid)... ok. +---- [0] Append to active DTX tree... ok. +---- [1] ID (dae_xid)... ok. +---- [1] LID (dae_lid)... ok. +---- [1] Append to active DTX tree... ok. +---- [2] flagged invalid. +---- [3] ID (dae_xid)... ok. +---- [3] LID (dae_lid)... ok. +---- [3] Append to active DTX tree... ok. +---- [4] flagged invalid. +---- [5] ID (dae_xid)... ok. +---- [5] LID (dae_lid)... ok. +---- [5] Append to active DTX tree... ok. +---- [6] ID (dae_xid)... ok. +---- [6] LID (dae_lid)... ok. +---- [6] Append to active DTX tree... ok. +-- DTX blob (off=0x514650)... ok. +- Active DTX blob list: ok. +Check container: ok. +Check oid: 1185667690.2136093645.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb01880)... ok. +- Dkey tree: ok. +Check oid: 1185667690.2136093645.0.0: ok. +Check oid: 471378945.1581695481.0.0... +- Dkey tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xb016a0)... ok. +- Dkey tree: ok. +Check oid: 471378945.1581695481.0.0: ok. diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_START/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_START/output.txt new file mode 100644 index 00000000000..f8e273ec786 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_ENGINE_START/output.txt @@ -0,0 +1,3 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... error: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/output.txt new file mode 100644 index 00000000000..de0fde75e19 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/output.txt @@ -0,0 +1,7 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: Wait for targets to stop: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/{{UUID}}_vos-0 new file mode 100644 index 00000000000..d0b937b265a --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_NVME_HEALTH/{{UUID}}_vos-0 @@ -0,0 +1,5 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- error: NVMe devices (if applicable): DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/output.txt new file mode 100644 index 00000000000..cd54825e420 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/output.txt @@ -0,0 +1,8 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +[0] pool {{UUID}} check result: ok. +error: Wait for targets to stop: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/{{UUID}}_vos-0 new file mode 100644 index 00000000000..be76486dc7b --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_BIO/{{UUID}}_vos-0 @@ -0,0 +1,21 @@ +VOS file allocation: ok. +Check pool: + path: /dev/shm/daos/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... ok. +- Containers tree... +-- Tree class... ok. +-- Tree features... ok. +-- Node (off=0xa7a4c0)... ok. +- Containers tree: ok. +- Pool extension (off=0x400550)... ok. +- Garbage collector's tree... +-- Tree class... ok. +-- Tree features... ok. +-- Empty tree +- Garbage collector's tree: ok. +Check pool: ok. diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/output.txt new file mode 100644 index 00000000000..51be2e1856d --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_DF_INVAL(-2022): 'Unsupported durable format' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/{{UUID}}_vos-0 new file mode 100644 index 00000000000..170d72a8176 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_MAGIC/{{UUID}}_vos-0 @@ -0,0 +1,7 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... error: invalid (0x5ca1ab1e) diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/output.txt new file mode 100644 index 00000000000..af001f0abf5 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_INVAL(-1003): 'Invalid parameters' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/{{UUID}}_vos-0 new file mode 100644 index 00000000000..4301951525d --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UMEM/{{UUID}}_vos-0 @@ -0,0 +1,6 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- error: Open the pool: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/output.txt new file mode 100644 index 00000000000..a0c27020a11 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_ID_MISMATCH(-2035): 'ID mismatch' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/{{UUID}}_vos-0 new file mode 100644 index 00000000000..afb04852b9e --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_UUID/{{UUID}}_vos-0 @@ -0,0 +1,9 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... ok. +- UUID... error: mismatch (requested={{UUID}}, received={{UUID}}) diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/output.txt new file mode 100644 index 00000000000..c0e41fbe345 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_DF_INCOMPT(-2023): 'Incompatible durable format version' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: 1 error(s), 0 warning(s). +=============================== +Total: 1 error(s), 0 warning(s). +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/{{UUID}}_vos-0 new file mode 100644 index 00000000000..92a81d8b9e6 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_OPEN_VERSION/{{UUID}}_vos-0 @@ -0,0 +1,8 @@ +VOS file allocation: ok. +Check pool: + path: {{STORAGE}}/{{UUID}}/vos-0 + uuid: {{UUID}} +- NVMe devices (if applicable): ok. +- Open the pool: ok. +- Magic... ok. +- Version... error: unsupported (0x1c) diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/output.txt new file mode 100644 index 00000000000..0942146d674 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_INVAL(-1003): 'Invalid parameters' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: error: DER_INVAL(-1003): 'Invalid parameters' +=============================== +Total: error: DER_INVAL(-1003): 'Invalid parameters' +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/{{UUID}}_vos-0 new file mode 100644 index 00000000000..a524036e6ed --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PATH_ALLOC/{{UUID}}_vos-0 @@ -0,0 +1,2 @@ +VOS file allocation: ok. +error: VOS file path allocation failed: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/output.txt b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/output.txt new file mode 100644 index 00000000000..0942146d674 --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/output.txt @@ -0,0 +1,16 @@ +Effective user: root +Log directory: {{LOG_DIR}} +Start the engine... ok. +Create pools directories... ok. +Start targets... ok. +Wait for targets to stop... +error: [0] pool {{UUID}} check result: DER_INVAL(-1003): 'Invalid parameters' +Wait for targets to stop: ok. +Stop the engine... ok. +=============================== +Targets: +=============================== +[0] result: error: DER_INVAL(-1003): 'Invalid parameters' +=============================== +Total: error: DER_INVAL(-1003): 'Invalid parameters' +=============================== diff --git a/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/{{UUID}}_vos-0 new file mode 100644 index 00000000000..07b4501785d --- /dev/null +++ b/src/utils/dlck/tests/fault_templates/DLCK_FAULT_POOL_PREALLOCATE/{{UUID}}_vos-0 @@ -0,0 +1 @@ +error: VOS file allocation: DER_INVAL(-1003): 'Invalid parameters' diff --git a/src/utils/dlck/tests/run_fault_injection.py b/src/utils/dlck/tests/run_fault_injection.py new file mode 100755 index 00000000000..746764fa919 --- /dev/null +++ b/src/utils/dlck/tests/run_fault_injection.py @@ -0,0 +1,390 @@ +#!/usr/bin/env python3 +""" +Copyright 2026 Hewlett Packard Enterprise Development LP +All rights reserved. + +SPDX-License-Identifier: BSD-2-Clause-Patent +""" +import argparse +import json +import os +import re +import subprocess # nosec +import tempfile +from enum import Enum +from pathlib import Path + +import yaml + +# defaults and paths +DEFAULT_DLCK = "/opt/daos/bin/dlck" +TESTS_DIR = Path(__file__).resolve().parent +TEMPLATE_CONFIG = TESTS_DIR / "fault_injection_dlck.yaml" +TEMPLATE_DIR = TESTS_DIR / "fault_templates" +BUILD_DIR = Path(json.loads((TESTS_DIR.parents[3] / ".build_vars.json").read_text())["BUILD_DIR"]) + + +# usage and arguments +USAGE = """Run dlck with one fault from fault_injection_dlck.yaml enabled and compare the results \ +against the template. + +FAULT is a fault name (e.g. DLCK_FAULT_GETGRNAM) or its id (e.g. 131329). +Without FAULT, every fault in the template is run. +Expected results live in fault_templates/FAULT/: output.txt and the log files next to it. +Template placeholders: + {{UUID}} any UUID (e.g. the pool UUID) + {{STORAGE}} storage path (e.g. /dev/shm/daos or /mnt/daos) + {{LOG_DIR}} dlck temporary log directory +""" # noqa: E501 line too long +PARSER = argparse.ArgumentParser(description=USAGE, + formatter_class=argparse.RawDescriptionHelpFormatter) +PARSER.add_argument("--dlck", default=str(DEFAULT_DLCK), help="path to the dlck binary") +PARSER.add_argument("--storage", default="/mnt/daos", help="dlck --storage argument") +PARSER.add_argument("--nvme", default=None, help="dlck --nvme argument") +PARSER.add_argument("--update", action="store_true", + help="store the results of this run as the template") +PARSER.add_argument("faults", nargs="*", metavar="FAULT", + help="fault name or id (default: all faults in the template)") + + +class FaultCatalog: + """Reads the faults listed in the template config.""" + + # these faults have a very specific requirements which are not supported by this script + UNSUPPORTED_FAULTS = [ + "DLCK_MOCK_NOT_IN_DAOS_SERVER_GROUP", + "DLCK_MOCK_NO_DAOS_SERVER_GROUP", + "DLCK_FAULT_GETGROUPS", + "DLCK_FAULT_GETGRNAM"] + + NVME_FAULTS = ["DLCK_FAULT_POOL_OPEN_BIO", "DLCK_FAULT_POOL_NVME_HEALTH"] + + DISABLED_FAULTS = [ + "DAOS_FAULT_DAE_ALLOC" # DAOS-XXXX + ] + + # ' # - id: 131333 # DLCK_FAULT_CREATE_LOG_DIR' + _FAULT_RE = re.compile(r"^\s*#?\s*-\s*id:\s*(\d+)\s*#\s*(\w+)") + + def __init__(self, config_path): + self._config_path = config_path + self._faults = self._read_faults() + + @property + def faults(self): + """Return the complete dictionary of faults (id, name) in the catalog.""" + return self._faults + + def _read_faults(self): + """Return the (id, name) of each fault in the template config.""" + faults = [] + for line in self._config_path.read_text().splitlines(): + match = self._FAULT_RE.match(line) + if match: + faults.append((match.group(1), match.group(2))) + if not faults: + raise SystemExit(f"No faults found in {self._config_path}") + return faults + + def find(self, key): + """Return the (id, name) entry matching a fault name or id.""" + for fault in self._faults: + if key in fault: + return fault + raise SystemExit(f"fault '{key}' not found in {self._config_path}") + + +class DlckTestHelperRunner: + """Runs dlck_test_helper under sudo.""" + + DLCK_TEST_HELPER = BUILD_DIR / "src/utils/dlck/tests/dlck_test_helper" + POOL_UUID = "00000000-1111-2222-3333-444444444444" + + def __init__(self, storage): + self._storage = storage + + def init(self): + """Run dlck_test_helper""" + cmd = ["sudo", "-E", str(self.DLCK_TEST_HELPER), "--file", self.POOL_UUID, + "--storage", self._storage, "--create_pools", "--verbose", "--targets", "1"] + env = dict(os.environ, DLCK_NO_NVME="1") + proc = subprocess.run(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True, check=False) + if proc.returncode != 0: + raise SystemExit(f"dlck_test_helper failed with exit code {proc.returncode}\n\n" + f"{proc.stderr}\n\n{proc.stdout}") + print(proc.stdout) + # Change permissions of the VOS file to be read-only. + vos_file = Path(self._storage) / self.POOL_UUID / "vos-0" + subprocess.run(["sudo", "chmod", "440", str(vos_file)], check=True) + + def fini(self): + """Remove the files and directories under the storage path.""" + subprocess.run(["sudo", "find", self._storage, "-mindepth", "1", "-delete"], check=True) + + +class DlckRunner: + """Runs dlck under sudo.""" + + def __init__(self, dlck, file_arg, storage, nvme=None): + self._dlck = dlck + self._file_arg = file_arg + self._storage = storage + self._nvme = nvme + + def has_nvme(self): + """Return True if an NVMe device is specified.""" + return self._nvme is not None + + def run(self, config): + """Run dlck with the fault config; return the exit code and stdout.""" + env = dict(os.environ, DLCK_NO_NVME="1", D_FI_CONFIG=str(config)) + cmd = ["sudo", "-E", str(self._dlck), "--file", self._file_arg, + "--storage", self._storage, "--targets", "1"] + if self._nvme is not None: + cmd += ["--nvme", self._nvme] + proc = subprocess.run(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True, check=False) + return proc.returncode, proc.stdout, proc.stderr + + +class TemplateMatcher: + """Matches actual dlck output against template text with placeholders.""" + + LOG_DIR_RE = "/tmp/dlck_check_[A-Za-z0-9]{6}" + STORAGE_RE = r"/[\w./-]+/daos(?=/)" + _UUID_RE = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" + + @classmethod + def normalize(cls, text): + """Replace the variable parts of captured text with template placeholders.""" + text = re.sub(cls._UUID_RE, "{{UUID}}", text) + text = re.sub(cls.STORAGE_RE, "{{STORAGE}}", text) + return re.sub(cls.LOG_DIR_RE, "{{LOG_DIR}}", text) + + @classmethod + def compare_text(cls, name, expected, actual): + """Return mismatch messages between a template and the actual text, line by line.""" + errors = [] + exp_lines = cls.normalize(expected).splitlines() + act_lines = cls.normalize(actual).splitlines() + if len(exp_lines) != len(act_lines): + errors.append(f"{name}: {len(act_lines)} line(s), template has {len(exp_lines)}") + # enumerate(..., 1) starts line numbering at 1 + for num, (exp, act) in enumerate(zip(exp_lines, act_lines), 1): + if exp != act: + errors.append(f"{name}:{num}: expected '{exp}', got '{act}'") + return errors + + @classmethod + def compare_logs(cls, expected_files, actual_dir): + """Match log files by name and compare their contents.""" + expected = {p.name: p for p in expected_files} + actual = ({cls.normalize(p.name): p for p in actual_dir.iterdir()} + if actual_dir.is_dir() else {}) + errors = [] + for name, path in sorted(expected.items()): + if name not in actual: + errors.append(f"missing log file '{name}'") + continue + errors += cls.compare_text(f"logs/{name}", path.read_text(), + actual.pop(name).read_text()) + errors += [f"unexpected log file '{name}'" for name in sorted(actual)] + return errors + + +class FaultTemplate: + """Expected output and logs of one fault, stored in a template directory.""" + + def __init__(self, path): + self._path = path + self._output_file = path / "output.txt" + + def exists(self): + """Does the given template exist?""" + return self._output_file.is_file() + + def _log_files(self): + """Return the log files stored next to the output file.""" + if not self._path.is_dir(): + return [] + return [p for p in self._path.iterdir() if p.is_file() and p != self._output_file] + + def update(self, output, logs_dir): + """Store the normalized output and log files as the template.""" + self._path.mkdir(parents=True, exist_ok=True) + for old_log in self._log_files(): + old_log.unlink() + self._output_file.write_text(TemplateMatcher.normalize(output)) + if logs_dir.is_dir(): + for log in logs_dir.iterdir(): + name = TemplateMatcher.normalize(log.name) + (self._path / name).write_text(TemplateMatcher.normalize(log.read_text())) + + def compare(self, output, logs_dir): + """Return mismatch messages between this template and the actual output and logs.""" + errors = TemplateMatcher.compare_text("output.txt", self._output_file.read_text(), output) + errors += TemplateMatcher.compare_logs(self._log_files(), logs_dir) + return errors + + +class FaultInjectionTest: + """Runs faults through dlck and compares or stores the results.""" + + class ReturnCode(Enum): + """Return codes for the fault injection test.""" + OK = 0 + FAIL = 1 + NO_TEMPLATE = 2 + DISABLED = 3 + NOT_SUPPORTED = 4 + NVME_REQUIRED = 5 + + @staticmethod + def rc_to_str(code): + """Return the display text of a ReturnCode.""" + labels = { + FaultInjectionTest.ReturnCode.OK: "OK", + FaultInjectionTest.ReturnCode.FAIL: "FAIL", + FaultInjectionTest.ReturnCode.NO_TEMPLATE: "NO TEMPLATE", + FaultInjectionTest.ReturnCode.DISABLED: "DISABLED", + FaultInjectionTest.ReturnCode.NOT_SUPPORTED: "NOT SUPPORTED", + FaultInjectionTest.ReturnCode.NVME_REQUIRED: "NVME REQUIRED" + } + return labels[code] + + def __init__(self, catalog, runner, templates_dir, update): + self._catalog = catalog + self._runner = runner + self._templates_dir = templates_dir + self._update = update + + @staticmethod + def _make_config(fault_id): + """Return the YAML config text that enables only the given fault.""" + return yaml.safe_dump({"fault_config": [{"id": int(fault_id)}]}, sort_keys=False) + + @staticmethod + def _collect_logs(log_dir, dest): + """Copy dlck's log directory to dest and remove the original.""" + subprocess.run(["sudo", "cp", "-r", log_dir, str(dest)], check=True) + subprocess.run(["sudo", "chown", "-R", f"{os.getuid()}:{os.getgid()}", + str(dest)], check=True) + subprocess.run(["sudo", "rm", "-rf", log_dir], check=True) + + @staticmethod + def _print_logs(logs_dir): + """Print the content of every collected log file to stdout.""" + if not logs_dir.is_dir(): + return + for log in sorted(p for p in logs_dir.rglob("*") if p.is_file()): + print(f"--- {log.relative_to(logs_dir)} ---") + print(log.read_text()) + + def _skip_code(self, name): + """Return the ReturnCode for a fault that must be skipped, or None to run it.""" + if name in FaultCatalog.UNSUPPORTED_FAULTS: + print(f"fault: {name} is not supported by this script") + return self.ReturnCode.NOT_SUPPORTED + if name in FaultCatalog.NVME_FAULTS and not self._runner.has_nvme(): + print(f"fault: {name} requires NVMe but no NVMe device is specified") + return self.ReturnCode.NVME_REQUIRED + if name in FaultCatalog.DISABLED_FAULTS: + print(f"fault: {name} is disabled") + return self.ReturnCode.DISABLED + template_dir = self._templates_dir / name + if not self._update and not FaultTemplate(template_dir).exists(): + print(f"fault: {name}, no template in {template_dir} (run with --update to create it)") + return self.ReturnCode.NO_TEMPLATE + return None + + def run_fault(self, fault): + """Run one fault test.""" + + fault_id, name = fault + # skip faults that cannot run here + skip_code = self._skip_code(name) + if skip_code is not None: + return skip_code + + # generate result directory and config for the fault + result_dir = Path(tempfile.mkdtemp(prefix=f"{name}_")) + config = result_dir / "fault_injection_dlck.yaml" + config.write_text(self._make_config(fault_id)) + + # run dlck with the generated config and capture output + rc, output, errors = self._runner.run(config) + (result_dir / "output.txt").write_text(output) + + # collect logs if dlck produced any + logs_dir = result_dir / "logs" + log_dir = re.search(rf"^Log directory: ({TemplateMatcher.LOG_DIR_RE})$", + output, re.MULTILINE) + if log_dir: + self._collect_logs(log_dir.group(1), logs_dir) + + # print summary of the fault execution + print(f"fault: {name}, dlck exit code: {rc}, results: {result_dir}") + if errors: + print(errors, end="") + + template_dir = self._templates_dir / name + template = FaultTemplate(template_dir) + + # update template if requested + if self._update: + template.update(output, logs_dir) + print(f"template updated: {template_dir}") + return self.ReturnCode.OK + + errors = template.compare(output, logs_dir) + if errors: + print("FAIL") + print("\n".join(errors)) + self._print_logs(logs_dir) + return self.ReturnCode.FAIL + print("PASS") + return self.ReturnCode.OK + + +def main(): + """Main entry point for the fault injection test script.""" + args = PARSER.parse_args() + catalog = FaultCatalog(TEMPLATE_CONFIG) + helper = DlckTestHelperRunner(args.storage) + runner = DlckRunner(Path(args.dlck).resolve(), helper.POOL_UUID, args.storage) + test = FaultInjectionTest(catalog, runner, TEMPLATE_DIR, args.update) + + # select faults specified by the user if provided + selected = [catalog.find(key) for key in args.faults] or catalog.faults + if not selected: + print("No fault tests selected.") + return + + # run selected faults + results = {} + try: + print("Create and populate a pool with standard data:") + helper.init() + print("Run fault tests:") + for fault in selected: + results[fault[1]] = test.run_fault(fault) + finally: + helper.fini() + + # report the results + if len(results) == 0: + print("\nNo test results to report.") + return + + print("\nSummary:") + for name, code in results.items(): + print(f" {name}: {FaultInjectionTest.rc_to_str(code)}") + fail = any(code == FaultInjectionTest.ReturnCode.FAIL for code in results.values()) + print(f"\nResult: {'FAIL' if fail else 'OK'}") + if fail: + raise SystemExit(1) + + +if __name__ == "__main__": + main() diff --git a/utils/utest.yaml b/utils/utest.yaml index faf7f2315b4..98425649416 100644 --- a/utils/utest.yaml +++ b/utils/utest.yaml @@ -225,6 +225,10 @@ - cmd: ["src/utils/dlck/tests/dlck_checker_macros_ut"] - cmd: ["src/utils/dlck/tests/dlck_checker_main_ut"] - cmd: ["src/utils/dlck/tests/dlck_checker_worker_ut"] +- name: dlck_fault_injection + sudo: True + tests: + - cmd: ["src/utils/dlck/tests/run_fault_injection.py"] - name: Source metadata testing memcheck: False asan: False From 72b7d6a1be3260f729f72d26eb3eb4ea40729e78 Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Mon, 16 Nov 2026 13:21:50 +0000 Subject: [PATCH 2/6] DAOS-19836 dlck: disable DAOS_FAULT_DAE_ALLOC because of DAOS-19969 skip-unit-test-with-memcheck: true skip-test-rpms: true Skip-func-vm: true Skip-fault-injection-test: true Skip-test-el-9.6-rpms: true Skip-test-leap-15-rpms: true Skip-func-hw-test: true Skip-NLT: true Signed-off-by: Jan Michalski --- .../DAOS_FAULT_DAE_ALLOC/output.txt | 17 ------- .../DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 | 48 ------------------- src/utils/dlck/tests/run_fault_injection.py | 2 +- 3 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt delete mode 100644 src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt deleted file mode 100644 index f2199647aa3..00000000000 --- a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/output.txt +++ /dev/null @@ -1,17 +0,0 @@ -Effective user: root -Log directory: {{LOG_DIR}} -Start the engine... ok. -Create pools directories... ok. -Start targets... ok. -Wait for targets to stop... -[0] pool {{UUID}} check result: ok. -error: [0] container {{UUID}} check result: DER_IO(-2001): 'I / O error' -Wait for targets to stop: ok. -Stop the engine... ok. -=============================== -Targets: -=============================== -[0] result: ok. -=============================== -Total: 0 warning(s). -=============================== diff --git a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 b/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 deleted file mode 100644 index ab6f94b73a4..00000000000 --- a/src/utils/dlck/tests/fault_templates/DAOS_FAULT_DAE_ALLOC/{{UUID}}_vos-0 +++ /dev/null @@ -1,48 +0,0 @@ -VOS file allocation: ok. -Check pool: - path: {{STORAGE}}/{{UUID}}/vos-0 - uuid: {{UUID}} -- NVMe devices (if applicable): ok. -- Open the pool: ok. -- Magic... ok. -- Version... ok. -- UUID... ok. -- Containers tree... --- Tree class... ok. --- Tree features... ok. --- Node (off=0xa7a4c0)... ok. -- Containers tree: ok. -- Pool extension (off=0x400550)... ok. -- Garbage collector's tree... --- Tree class... ok. --- Tree features... ok. --- Empty tree -- Garbage collector's tree: ok. -Check pool: ok. -Check container: - uuid: {{UUID}} -- uuid... ok. -- Padding (cd_pad)... ok. -- Padding (cd_used)... ok. -- Reserved (cd_reserv_upgrade)... ok. -- Object index tree... --- Tree class... ok. --- Tree features... ok. --- Node (off=0xa7a6c0)... ok. ---- Record fetch (off=0xac05c0)... ok. ----- Object (oid=1185667690.2136093645.0.0)... ------ ILOG... ok. ----- Object (oid=1185667690.2136093645.0.0)... ok. ---- Record fetch (off=0xac0540)... ok. ----- Object (oid=471378945.1581695481.0.0)... ------ ILOG... ok. ----- Object (oid=471378945.1581695481.0.0)... ok. -- Object index tree: ok. -- Active DTX blob list... --- DTX blob (off=0x514650)... ---- Magic... ok. ---- 7 active entries: ----- [0] ID (dae_xid)... ok. ----- [0] LID (dae_lid)... error: cannot append to the active DTX table (dae_lid=2, dae_epoch=0x28e6104968380001) -- error: Active DTX blob list: DER_IO(-2001): 'I / O error' -error: Check container: DER_IO(-2001): 'I / O error' diff --git a/src/utils/dlck/tests/run_fault_injection.py b/src/utils/dlck/tests/run_fault_injection.py index 746764fa919..45be090f5b5 100755 --- a/src/utils/dlck/tests/run_fault_injection.py +++ b/src/utils/dlck/tests/run_fault_injection.py @@ -60,7 +60,7 @@ class FaultCatalog: NVME_FAULTS = ["DLCK_FAULT_POOL_OPEN_BIO", "DLCK_FAULT_POOL_NVME_HEALTH"] DISABLED_FAULTS = [ - "DAOS_FAULT_DAE_ALLOC" # DAOS-XXXX + "DAOS_FAULT_DAE_ALLOC" # DAOS-19969 ] # ' # - id: 131333 # DLCK_FAULT_CREATE_LOG_DIR' From 2651bcd66ea7e378a779693cfb69385710da8adf Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Tue, 17 Nov 2026 15:10:37 +0000 Subject: [PATCH 3/6] DAOS-19836 dlck: fix MD-on-SSD support skip-unit-test-with-memcheck: true skip-test-rpms: true Skip-func-vm: true Skip-fault-injection-test: true Skip-test-el-9.6-rpms: true Skip-test-leap-15-rpms: true Skip-func-hw-test: true Skip-NLT: true Signed-off-by: Jan Michalski --- src/utils/dlck/tests/run_fault_injection.py | 53 +++++++++++++++------ 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/src/utils/dlck/tests/run_fault_injection.py b/src/utils/dlck/tests/run_fault_injection.py index 45be090f5b5..7a2e8133da7 100755 --- a/src/utils/dlck/tests/run_fault_injection.py +++ b/src/utils/dlck/tests/run_fault_injection.py @@ -18,14 +18,16 @@ # defaults and paths DEFAULT_DLCK = "/opt/daos/bin/dlck" +DEFAULT_POOL_UUID = "00000000-1111-2222-3333-444444444444" TESTS_DIR = Path(__file__).resolve().parent TEMPLATE_CONFIG = TESTS_DIR / "fault_injection_dlck.yaml" TEMPLATE_DIR = TESTS_DIR / "fault_templates" BUILD_DIR = Path(json.loads((TESTS_DIR.parents[3] / ".build_vars.json").read_text())["BUILD_DIR"]) +NVME_FAULTS = ["DLCK_FAULT_POOL_OPEN_BIO", "DLCK_FAULT_POOL_NVME_HEALTH"] # usage and arguments -USAGE = """Run dlck with one fault from fault_injection_dlck.yaml enabled and compare the results \ +USAGE = f"""Run dlck with one fault from fault_injection_dlck.yaml enabled and compare the results \ against the template. FAULT is a fault name (e.g. DLCK_FAULT_GETGRNAM) or its id (e.g. 131329). @@ -35,12 +37,29 @@ {{UUID}} any UUID (e.g. the pool UUID) {{STORAGE}} storage path (e.g. /dev/shm/daos or /mnt/daos) {{LOG_DIR}} dlck temporary log directory + +MD-on-PMem mode: + In this mode, a pool is automatically created and populated using `dlck_test_helper`. \ +Most templates are optimized for this mode, but some faults cannot be tested in it. + +MD-on-SSD mode: + Some faults can be tested only in this mode: {', '.join(NVME_FAULTS)}. Sadly, pool in this mode \ +cannot be created automatically. So, you have to create a DAOS setup in the MD-on-SSD mode and \ +create a pool manually. Having that you can test these faults as shown below. \ +Note most of the templates are optimized for the MD-on-PMem mode so running faults other than list \ +below in the MD-on-SSD mode may report false negatives. + +{Path(__file__).name} --storage --nvme --pool_uuid \ +{' '.join(NVME_FAULTS)} """ # noqa: E501 line too long PARSER = argparse.ArgumentParser(description=USAGE, formatter_class=argparse.RawDescriptionHelpFormatter) PARSER.add_argument("--dlck", default=str(DEFAULT_DLCK), help="path to the dlck binary") PARSER.add_argument("--storage", default="/mnt/daos", help="dlck --storage argument") -PARSER.add_argument("--nvme", default=None, help="dlck --nvme argument") +PARSER.add_argument("--pool_uuid", default=DEFAULT_POOL_UUID, help="Pool UUID") +PARSER.add_argument("--nvme", default=None, help="dlck --nvme argument. " + "dlck_test_helper cannot create a pool in the MD-on-SSD mode " + "so the pool must be created manually.") PARSER.add_argument("--update", action="store_true", help="store the results of this run as the template") PARSER.add_argument("faults", nargs="*", metavar="FAULT", @@ -57,8 +76,6 @@ class FaultCatalog: "DLCK_FAULT_GETGROUPS", "DLCK_FAULT_GETGRNAM"] - NVME_FAULTS = ["DLCK_FAULT_POOL_OPEN_BIO", "DLCK_FAULT_POOL_NVME_HEALTH"] - DISABLED_FAULTS = [ "DAOS_FAULT_DAE_ALLOC" # DAOS-19969 ] @@ -98,14 +115,14 @@ class DlckTestHelperRunner: """Runs dlck_test_helper under sudo.""" DLCK_TEST_HELPER = BUILD_DIR / "src/utils/dlck/tests/dlck_test_helper" - POOL_UUID = "00000000-1111-2222-3333-444444444444" - def __init__(self, storage): + def __init__(self, storage, pool_uuid): self._storage = storage + self._pool_uuid = pool_uuid def init(self): """Run dlck_test_helper""" - cmd = ["sudo", "-E", str(self.DLCK_TEST_HELPER), "--file", self.POOL_UUID, + cmd = ["sudo", "-E", str(self.DLCK_TEST_HELPER), "--file", self._pool_uuid, "--storage", self._storage, "--create_pools", "--verbose", "--targets", "1"] env = dict(os.environ, DLCK_NO_NVME="1") proc = subprocess.run(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -115,7 +132,7 @@ def init(self): f"{proc.stderr}\n\n{proc.stdout}") print(proc.stdout) # Change permissions of the VOS file to be read-only. - vos_file = Path(self._storage) / self.POOL_UUID / "vos-0" + vos_file = Path(self._storage) / self._pool_uuid / "vos-0" subprocess.run(["sudo", "chmod", "440", str(vos_file)], check=True) def fini(self): @@ -138,11 +155,13 @@ def has_nvme(self): def run(self, config): """Run dlck with the fault config; return the exit code and stdout.""" - env = dict(os.environ, DLCK_NO_NVME="1", D_FI_CONFIG=str(config)) + env = dict(os.environ, D_FI_CONFIG=str(config)) cmd = ["sudo", "-E", str(self._dlck), "--file", self._file_arg, "--storage", self._storage, "--targets", "1"] if self._nvme is not None: cmd += ["--nvme", self._nvme] + else: + env["DLCK_NO_NVME"] = "1" proc = subprocess.run(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False) return proc.returncode, proc.stdout, proc.stderr @@ -286,7 +305,7 @@ def _skip_code(self, name): if name in FaultCatalog.UNSUPPORTED_FAULTS: print(f"fault: {name} is not supported by this script") return self.ReturnCode.NOT_SUPPORTED - if name in FaultCatalog.NVME_FAULTS and not self._runner.has_nvme(): + if name in NVME_FAULTS and not self._runner.has_nvme(): print(f"fault: {name} requires NVMe but no NVMe device is specified") return self.ReturnCode.NVME_REQUIRED if name in FaultCatalog.DISABLED_FAULTS: @@ -351,8 +370,8 @@ def main(): """Main entry point for the fault injection test script.""" args = PARSER.parse_args() catalog = FaultCatalog(TEMPLATE_CONFIG) - helper = DlckTestHelperRunner(args.storage) - runner = DlckRunner(Path(args.dlck).resolve(), helper.POOL_UUID, args.storage) + helper = DlckTestHelperRunner(args.storage, args.pool_uuid) if not args.nvme else None + runner = DlckRunner(Path(args.dlck).resolve(), args.pool_uuid, args.storage, args.nvme) test = FaultInjectionTest(catalog, runner, TEMPLATE_DIR, args.update) # select faults specified by the user if provided @@ -364,13 +383,17 @@ def main(): # run selected faults results = {} try: - print("Create and populate a pool with standard data:") - helper.init() + if helper: + print("Create and populate a pool with standard data:") + helper.init() + else: + print("Skipping pool creation and population as the MD-on-SSD mode is used.") print("Run fault tests:") for fault in selected: results[fault[1]] = test.run_fault(fault) finally: - helper.fini() + if helper: + helper.fini() # report the results if len(results) == 0: From 4f8d08d493c76dc41c382d1905eadaa5417d9447 Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Tue, 17 Nov 2026 23:10:52 +0000 Subject: [PATCH 4/6] DAOS-19836 dlck: print both required and actual targets value skip-unit-test-with-memcheck: true skip-test-rpms: true Skip-func-vm: true Skip-fault-injection-test: true Skip-test-el-9.6-rpms: true Skip-test-leap-15-rpms: true Skip-func-hw-test: true Skip-NLT: true Signed-off-by: Jan Michalski --- src/utils/dlck/dlck_args_engine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/dlck/dlck_args_engine.c b/src/utils/dlck/dlck_args_engine.c index ee89b2f2e45..3d329a3845f 100644 --- a/src/utils/dlck/dlck_args_engine.c +++ b/src/utils/dlck/dlck_args_engine.c @@ -43,7 +43,9 @@ args_engine_check(struct argp_state *state, struct dlck_args_engine *args) if (d_fault_inject_is_enabled()) { if (args->targets > 1) { - RETURN_FAIL(state, EINVAL, "Fault injection requires targets == 1"); + RETURN_FAIL(state, EINVAL, + "Fault injection requires targets == 1, actual targets == %u", + args->targets); } } From 177f9fab3a3918e84e8d0f676231dc0a4290b4c4 Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Mon, 23 Nov 2026 16:31:18 +0000 Subject: [PATCH 5/6] DAOS-19836 dlck: make sure no extra files got deleted skip-unit-test-with-memcheck: true skip-test-rpms: true Skip-func-vm: true Skip-fault-injection-test: true Skip-test-el-9.6-rpms: true Skip-test-leap-15-rpms: true Skip-func-hw-test: true Skip-NLT: true Signed-off-by: Jan Michalski --- src/utils/dlck/tests/run_fault_injection.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/utils/dlck/tests/run_fault_injection.py b/src/utils/dlck/tests/run_fault_injection.py index 7a2e8133da7..091f7d4f9a7 100755 --- a/src/utils/dlck/tests/run_fault_injection.py +++ b/src/utils/dlck/tests/run_fault_injection.py @@ -119,9 +119,18 @@ class DlckTestHelperRunner: def __init__(self, storage, pool_uuid): self._storage = storage self._pool_uuid = pool_uuid + self._files_created = False + + def _cleanup_paths(self): + """Return the VOS file and system database paths under the storage path.""" + return [Path(self._storage) / self._pool_uuid / "vos-0", Path(self._storage) / "sys_db"] def init(self): """Run dlck_test_helper""" + existing = [p for p in self._cleanup_paths() if p.exists()] + if existing: + names = ", ".join(str(p) for p in existing) + raise SystemExit(f"stale files already exist, remove them first: {names}") cmd = ["sudo", "-E", str(self.DLCK_TEST_HELPER), "--file", self._pool_uuid, "--storage", self._storage, "--create_pools", "--verbose", "--targets", "1"] env = dict(os.environ, DLCK_NO_NVME="1") @@ -131,13 +140,17 @@ def init(self): raise SystemExit(f"dlck_test_helper failed with exit code {proc.returncode}\n\n" f"{proc.stderr}\n\n{proc.stdout}") print(proc.stdout) + self._files_created = True # Change permissions of the VOS file to be read-only. vos_file = Path(self._storage) / self._pool_uuid / "vos-0" subprocess.run(["sudo", "chmod", "440", str(vos_file)], check=True) def fini(self): - """Remove the files and directories under the storage path.""" - subprocess.run(["sudo", "find", self._storage, "-mindepth", "1", "-delete"], check=True) + """Remove created VOS file and system database.""" + if not self._files_created: + return + subprocess.run(["sudo", "rm", "-f", "--", *map(str, self._cleanup_paths())], check=True) + self._files_created = False class DlckRunner: From f93ffb44aaea429fbaa342dfd346662f4e4d97b8 Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Mon, 23 Nov 2026 16:38:27 +0000 Subject: [PATCH 6/6] DAOS-19836 dlck: refine summary so faults are more highlighted skip-unit-test-with-memcheck: true skip-test-rpms: true Skip-func-vm: true Skip-fault-injection-test: true Skip-test-el-9.6-rpms: true Skip-test-leap-15-rpms: true Skip-func-hw-test: true Skip-NLT: true Signed-off-by: Jan Michalski --- src/utils/dlck/tests/run_fault_injection.py | 29 +++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/utils/dlck/tests/run_fault_injection.py b/src/utils/dlck/tests/run_fault_injection.py index 091f7d4f9a7..0c8eb9df262 100755 --- a/src/utils/dlck/tests/run_fault_injection.py +++ b/src/utils/dlck/tests/run_fault_injection.py @@ -273,15 +273,15 @@ class ReturnCode(Enum): NVME_REQUIRED = 5 @staticmethod - def rc_to_str(code): + def rc_to_str_with_padding(code): """Return the display text of a ReturnCode.""" labels = { - FaultInjectionTest.ReturnCode.OK: "OK", - FaultInjectionTest.ReturnCode.FAIL: "FAIL", - FaultInjectionTest.ReturnCode.NO_TEMPLATE: "NO TEMPLATE", - FaultInjectionTest.ReturnCode.DISABLED: "DISABLED", - FaultInjectionTest.ReturnCode.NOT_SUPPORTED: "NOT SUPPORTED", - FaultInjectionTest.ReturnCode.NVME_REQUIRED: "NVME REQUIRED" + FaultInjectionTest.ReturnCode.OK: "OK\t\t", + FaultInjectionTest.ReturnCode.FAIL: "FAIL\t\t", + FaultInjectionTest.ReturnCode.NO_TEMPLATE: "NO TEMPLATE\t", + FaultInjectionTest.ReturnCode.DISABLED: "DISABLED\t", + FaultInjectionTest.ReturnCode.NOT_SUPPORTED: "NOT SUPPORTED\t", + FaultInjectionTest.ReturnCode.NVME_REQUIRED: "NVME REQUIRED\t" } return labels[code] @@ -415,10 +415,17 @@ def main(): print("\nSummary:") for name, code in results.items(): - print(f" {name}: {FaultInjectionTest.rc_to_str(code)}") - fail = any(code == FaultInjectionTest.ReturnCode.FAIL for code in results.values()) - print(f"\nResult: {'FAIL' if fail else 'OK'}") - if fail: + print(f" {FaultInjectionTest.rc_to_str_with_padding(code)}{name}") + + ReturnCode = FaultInjectionTest.ReturnCode + failed = [name for name, code in results.items() if code == ReturnCode.FAIL] + passed = sum(1 for code in results.values() if code == ReturnCode.OK) + skipped = len(results) - passed - len(failed) + print(f"\nTotal: {len(results)}, pass: {passed}, skip: {skipped}, failed: {len(failed)}") + if failed: + print("\nFailed:\n " + "\n ".join(failed)) + print(f"\nResult: {'FAIL' if failed else 'OK'}") + if failed: raise SystemExit(1)