Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
e44ee36
DAOS-17519 test: Automate dlck testing (basic/fault_injection)
rpadma2 Dec 23, 2025
1dfe0ef
DAOS-17519 test: Fix linting issues.
rpadma2 Dec 23, 2025
a376c98
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Jan 6, 2026
1f16a51
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Mar 12, 2026
aa8ede9
DAOS-17519 test: Some of the review updates.
rpadma2 Mar 12, 2026
5213ba6
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Mar 31, 2026
0cea354
DAOS-17519 test: Fix Linting issues.
rpadma2 Mar 31, 2026
585528a
DAOS-17519 test: Fix python/flake8 lint and copyright issues.
rpadma2 Mar 31, 2026
593f473
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 May 22, 2026
e4508aa
DAOS-17519 test: Update the control_meta_dir.
rpadma2 May 22, 2026
10920ac
DAOS-17519 test: Fix typo on control_metadata_dir path.
rpadma2 May 23, 2026
2b4bc8a
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Aug 12, 2026
4103769
DAOS-17519 test: Fix some of the pylint errors.
rpadma2 Aug 12, 2026
2191472
DAOS-17519 test: Fix more pylint issues.
rpadma2 Aug 12, 2026
fb11310
DAOS-17519 test: Update test timeouts.
rpadma2 Aug 12, 2026
7284649
DAOS-17519 test: add_pool needed parameter.
rpadma2 Aug 13, 2026
3b870dc
DAOS-17519 test: Fix flake8 newline issue.
rpadma2 Aug 13, 2026
3c8a19a
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Aug 17, 2026
68b4f6b
DAOS-17519 test: Python script review updates.
rpadma2 Aug 17, 2026
a30908f
DAOS-17519 test: Fix the dlck_utils class.
rpadma2 Aug 18, 2026
6031604
DAOS-17519 test: Address dlck_basic_fault test failure.
rpadma2 Aug 18, 2026
1dcadf5
DAOS-17519 test: Implement dlck_utils.py to use ExecutableCommand class.
rpadma2 Aug 18, 2026
391e926
DAOS-17519 test: Fix the error checking issues.
rpadma2 Aug 19, 2026
a0406f1
DAOS-17519 test: Run basic test without passing env.
rpadma2 Aug 20, 2026
9c314c7
DAOS-17519 test: Create a separate dlck logger.
rpadma2 Aug 20, 2026
04898a8
DAOS-17519 test: Removed unused variable.
rpadma2 Aug 20, 2026
903d016
DAOS-17519 test: Fix the pylint issue.
rpadma2 Aug 20, 2026
7d3f84e
DAOS-17519 test: Update the pool size to 80 percent.
rpadma2 Aug 20, 2026
035fc95
DAOS-17519 test: Remove the fault injection file after test completion.
rpadma2 Aug 23, 2026
47973fc
DAOS-17519 test: Fix minor lint issue.
rpadma2 Aug 23, 2026
e0cba86
DAOS-17519 test: Pass user information as string.
rpadma2 Aug 23, 2026
1e89fc4
DAOS-17519 test: Remove with_exports property.
rpadma2 Aug 24, 2026
c682b97
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Aug 24, 2026
6eea9f3
DAOS-17519 test: Set the system_ram_reserved to 16.
rpadma2 Aug 24, 2026
e870619
DAOS-17519 test: Add with_exports back to the dlck_utils.
rpadma2 Aug 24, 2026
becb001
DAOS-17519 test: Add the --log_dir parameter to dlck.
rpadma2 Aug 24, 2026
890c976
DAOS-17519 test: Pass the log_dir path while calling dlck.
rpadma2 Aug 24, 2026
3f038d8
DAOS-17519 test: Revert the system_ram_reserved changes.
rpadma2 Aug 24, 2026
b4dd96a
DAOS-17519 test: Fix the DAOS build error.
rpadma2 Aug 24, 2026
20b7cb7
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Aug 24, 2026
50253bc
DAOS-17519 test: Add the logfile to the YAML file.
rpadma2 Aug 24, 2026
ee085bc
DAOS-17519 test: fix pylint issue.
rpadma2 Aug 24, 2026
7fd7d82
DAOS-17519 test: Adding --verbose to dlck command.
rpadma2 Aug 25, 2026
5af0ef1
DAOS-17519 test: Fix C lint issues.
rpadma2 Aug 25, 2026
f9f6c02
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Aug 25, 2026
067c4d1
DAOS-17519 test: Modified the files based on all the code review upda…
rpadma2 Aug 25, 2026
0b0c783
DAOS-17519 test: Update the Copyright information.
rpadma2 Aug 25, 2026
edf4949
DAOS-17519 test: Reduce the pool size to 10 percent.
rpadma2 Aug 25, 2026
5178e62
DAOS-17519 test: Updated new faults and allow exception for dlck faul…
rpadma2 Aug 25, 2026
09e6bd9
DAOS-17519 test: Address the scons dlck compile error.
rpadma2 Aug 25, 2026
0a6b0be
DAOS-17519 test: More review updates and check errors.
rpadma2 Aug 27, 2026
e8a4309
DAOS-17519 test: Remove unwanted code.
rpadma2 Aug 27, 2026
f32bea4
DAOS-17519 test: Address the dlck build error.
rpadma2 Aug 27, 2026
82a724d
DAOS-17519 test: Minor space issue.
rpadma2 Aug 27, 2026
3d4781f
DAOS-17519 test: Fix clang errors.
rpadma2 Aug 27, 2026
33590aa
DAOS-17519 test: More clang errors.
rpadma2 Aug 27, 2026
3479901
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Aug 27, 2026
e061e56
DAOS-17519 test: Reduce the test_servers. Review updates.
rpadma2 Aug 27, 2026
767de9a
DAOS-17519 test: Modify fault injection mechanism for dlck utility.
rpadma2 Aug 28, 2026
0891a3c
DAOS-17519 test: Remove the unwanted comment.
rpadma2 Aug 28, 2026
db479c6
DAOS-17519 test: Fix pylint issue.
rpadma2 Aug 28, 2026
ee205a0
DAOS-17519 test: Merged both the test cases to a single python file.
rpadma2 Aug 28, 2026
9c8b347
DAOS-17519 test: Missed to remove add_pool import.
rpadma2 Aug 28, 2026
9d199de
DAOS-17519 test: Removed unused variable.
rpadma2 Aug 28, 2026
f78c858
DAOS-17519 test: Fixed the get_pool call.
rpadma2 Aug 29, 2026
e48754d
DAOS-17519 test: Renamed dlck_utils.py to dlck_test_base.py.
rpadma2 Aug 30, 2026
0e72f41
DAOS-17519 test: Minor lint issue.
rpadma2 Aug 30, 2026
e3234a0
DAOS-17519 test: Merge branch 'master' into rpadma2/daos_17519
rpadma2 Aug 30, 2026
3e60841
DAOS-17519 test: Remove some of the fault injection flags.
rpadma2 Aug 31, 2026
3627519
DAOS-17591 test: Add the log_dir and verbose parameter.
rpadma2 Aug 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions src/tests/ftest/recovery/dlck_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
"""
Copyright 2026 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import os
import re

from dlck_test_base import DlckTestBase
from fault_config_utils import FaultInjection
from file_utils import distribute_files


class DlckBasicTest(DlckTestBase):
"""Test class for dlck command line utility.

:avocado: recursive
"""
def check_dlck_result(self, result, fault_name):
"""Check that dlck reported the expected error for an injected fault.
Args:
result (dict): The result object returned by the dlck command.
fault_name (str): The name of the injected fault.
"""
expected_errors = ("DER_INVAL", "DER_NONEXIST", "DER_ID_MISMATCH",
"DER_DF_INCOMPT", "DER_DF_INVAL", "WARNING:")
warning_pattern = r"\b[1-9]\d*\s+warning(?:\(s\)|s?)\b"
output = f"{result.joined_stdout}\n{result.joined_stderr}"
expected_error_found = any(error in output for error in expected_errors)
warning_found = re.search(warning_pattern, output)
if not (expected_error_found or warning_found):
return f"{fault_name}: no expected error found in dlck output: {output}"
return None

def test_dlck_basic(self):
"""Basic Test: Run 'dlck' command

:avocado: tags=all,daily_regression
:avocado: tags=hw,medium
:avocado: tags=recovery,dlck_cmd
:avocado: tags=DlckBasicTest,test_dlck_basic
"""
dmg = self.get_dmg_command()
self.log_step("Create a pool to run dlck")
pool = self.get_pool()
dlck = self.get_dlck_command()
dlck.pool_uuid.value = pool.uuid
dlck.log_dir.value = self.test_env.log_dir
dlck.run_user = 'daos_server'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a new default.

dlck.storage.value = self.server_managers[0].get_config_value("scm_mount")
if self.server_managers[0].manager.job.using_control_metadata:
dlck.nvme.value = os.path.join(
self.server_managers[0].get_config_value("path"), "daos_control", "engine0",
"daos_nvme.conf")

self.log_step("Perform dmg system stop to run dlck command")
dmg.system_stop()

self.log_step("Run dlck command to check the health of the pool and storage")
result = dlck.run()

self.log_step("Perform dmg system start after running dlck command")
dmg.system_start()
if not result.passed:
self.fail(f"dlck failed on {result.failed_hosts}")
self.log.info("dlck basic test passed with no errors")

def test_dlck_basic_fault(self):
"""Basic Fault Test: Run 'dlck' injecting basic faults.

:avocado: tags=all,full_regression
:avocado: tags=hw,medium
:avocado: tags=recovery,dlck_cmd,faults
:avocado: tags=DlckBasicTest,test_dlck_basic_fault
"""
errors = []
faults_object = FaultInjection()
faults_dict = faults_object.get_faults_dict()
fault_list = self.params.get("fault_list", '/run/dlck_test_faults/*')
self.log.info("Test log dir %s", self.test_env.log_dir)
fault_inject_file = os.path.join(self.test_env.log_dir, "fi.yaml")
self.log.info("Fault injection file: %s", fault_inject_file)
self.log.info("Faults: %s", fault_list)
self.log.info("Faults dict: %s", faults_dict)
dmg = self.get_dmg_command()
pool = self.get_pool()
dlck = self.get_dlck_command()
dlck.pool_uuid.value = pool.uuid
dlck.log_dir.value = self.test_env.log_dir
dlck.run_user = 'daos_server'
dlck.exit_status_exception = False
dlck.env["D_FI_CONFIG"] = fault_inject_file
dlck.storage.value = self.server_managers[0].get_config_value("scm_mount")
if self.server_managers[0].manager.job.using_control_metadata:
dlck.nvme.value = os.path.join(
self.server_managers[0].get_config_value("path"), "daos_control", "engine0",
"daos_nvme.conf")

self.log_step("Perform dmg system stop to run dlck command")
dmg.system_stop()

for test_fault in fault_list:
with open(fault_inject_file, 'w') as f:
f.write("fault_config:\n")
for count, (key, value) in enumerate(faults_dict[test_fault].items()):
if count == 0:
f.write(f"- {key}: \'{value}\'\n")
else:
f.write(f" {key}: \'{value}\'\n")
Comment on lines +103 to +109

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized it makes little sense we generate a YAML file line by line when we could use the pyyaml package. From what I see we already use it in functional tests. Please look out for import yaml.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it would look like something like:

            fault_config = {
                'fault_config': [
                    {key: str(value) for key, value in faults_dict[test_fault].items()}]}
            with open(fault_inject_file, 'w') as f:
                yaml.dump(fault_config, f, default_flow_style=False)

@rpadma2 rpadma2 Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you mean run all fault injection tests in a single dlck run? If so, does it mean DLCK will parse the YAML file and inject one fault at a time and run the testing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This is a limitation of the Fault Injection sub-system. No changes here.
My suggestion only means you can generate this YAML files in a standardized way rather than writing it like a random text file.
You still will have to generate a YAML file per-fault you want to inject and keep the outer loop.

self.log.info("Reading the updated fault injection file contents")
with open(fault_inject_file, 'r') as f:
file_data = f.read()
self.log.info("\n %s", file_data)
distribute_files(self.log, self.hostlist_servers, fault_inject_file,
fault_inject_file)
self.log_step("Run dlck command after injecting fault")
result = dlck.run()
error = self.check_dlck_result(result, test_fault)
if error:
errors.append(error)

self.log_step("Perform dmg system start after running dlck command")
dmg.system_start()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no line break from beginning of the test to here. IMO, it would be easier to read by adding a few line breaks to separate many lines of code into blocks of code that runs similar tasks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do it later... Let the present PR run complete.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if errors:
self.fail(f"dlck basic test failed with errors: {errors}")
self.log.info("dlck basic fault test passed with no errors")
39 changes: 39 additions & 0 deletions src/tests/ftest/recovery/dlck_basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
hosts:
test_servers: 1
test_clients: 1

timeout: 420
server_config:
name: daos_server
engines_per_host: 1
engines:
0:
targets: 4
storage: auto
Comment thread
janekmi marked this conversation as resolved.

pool:
size: 10%

dlck_test_faults:
fault_list:
- DLCK_FAULT_GETGRNAM
- DLCK_MOCK_NO_DAOS_SERVER_GROUP
- DLCK_FAULT_CREATE_POOL_DIR
- DLCK_FAULT_CREATE_LOG_DIR
- DLCK_FAULT_ENGINE_START
- DLCK_FAULT_ENGINE_JOIN
- DLCK_FAULT_ENGINE_STOP
- DAOS_FAULT_POOL_NVME_HEALTH
- DAOS_FAULT_POOL_OPEN_BIO
- DAOS_FAULT_POOL_OPEN_UMEM
- DAOS_FAULT_POOL_OPEN_MAGIC
- DAOS_FAULT_POOL_OPEN_VERSION
- DAOS_FAULT_POOL_OPEN_UUID
- DAOS_FAULT_BTREE_OPEN_INV_CLASS_28
- DAOS_FAULT_BTREE_OPEN_INV_CLASS_29
- DAOS_FAULT_BTREE_OPEN_UNREG_CLASS_28
- DAOS_FAULT_BTREE_OPEN_UNREG_CLASS_29
- DAOS_FAULT_BTREE_FEATURES_28
- DAOS_FAULT_BTREE_FEATURES_29
- DAOS_FAULT_POOL_EXT_PADDING
- DAOS_FAULT_POOL_EXT_RESERVED
Loading
Loading