Skip to content

DAOS-17519 test: Automate dlck testing (basic/fault_injection) - #17307

Open
rpadma2 wants to merge 65 commits into
masterfrom
rpadma2/daos_17519
Open

DAOS-17519 test: Automate dlck testing (basic/fault_injection)#17307
rpadma2 wants to merge 65 commits into
masterfrom
rpadma2/daos_17519

Conversation

@rpadma2

@rpadma2 rpadma2 commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@github-actions

github-actions Bot commented Dec 23, 2025

Copy link
Copy Markdown

Ticket title is 'Automation - Basic dlck test: scan the DAOS system by running the dlck tool.'
Status is 'In Progress'
Labels: 'test_2.8,testp2'
https://daosio.atlassian.net/browse/DAOS-17519

Test-tag: DlckBasicTest DlckBasicFaultTest
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Comment thread src/tests/ftest/util/fault_config_utils.py Outdated
Comment thread src/tests/ftest/util/fault_config_utils.py Outdated
Comment thread src/tests/ftest/util/fault_config_utils.py Outdated
Comment thread src/tests/ftest/util/fault_config_utils.py Outdated
Comment thread src/tests/ftest/util/fault_config_utils.py Outdated
Comment thread src/tests/ftest/recovery/dlck_basic_fault.py Outdated
Comment thread src/tests/ftest/recovery/dlck_basic_fault.py Outdated
Comment thread src/tests/ftest/recovery/dlck_basic_fault.py Outdated
Comment thread src/tests/ftest/recovery/dlck_basic.yaml Outdated
Comment thread src/tests/ftest/recovery/dlck_basic.py Outdated
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest
@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-17307/3/testReport/

rpadma2 added 2 commits March 12, 2026 11:26
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/4/execution/node/966/log

rpadma2 added 3 commits March 31, 2026 10:49
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/5/execution/node/988/log

rpadma2 added 2 commits May 22, 2026 13:18
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/6/execution/node/867/log

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/7/execution/node/866/log

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@rpadma2
rpadma2 requested a review from janekmi August 12, 2026 18:40
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/8/execution/node/1073/log

@daosbuild3

Copy link
Copy Markdown
Collaborator

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17307/9/execution/node/1072/log

@daosbuild3

Copy link
Copy Markdown
Collaborator

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-unit-test: true
Skip-fault-injection-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@rpadma2

rpadma2 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@daosbuild3

Copy link
Copy Markdown
Collaborator

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Comment thread src/utils/dlck/cmds/dlck_cmd_check.c Outdated
Comment thread src/tests/ftest/recovery/dlck_basic.yaml Outdated
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@rpadma2

rpadma2 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @janekmi , @phender , @daltonbohning and @shimizukko for your reviews... The dlck test framework seems to be much better now. Take a look at the latest changes.

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Comment thread src/tests/ftest/recovery/dlck_basic.py Outdated
errors = []
dmg = self.get_dmg_command()
self.log_step("Create a pool to run dlck")
pool = add_pool(self)

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.

We actually want to go back to using ONLY self.get_pool so if you need to push again, please change this to use self.get_pool.

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.

Comment thread src/tests/ftest/recovery/dlck_basic.py Outdated
Comment on lines +43 to +44
errors.append(f"dlck failed on {result.failed_hosts}")
self.fail(f"dlck basic test failed with errors: {errors}")

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.

This is the only error in the list, so I think we should just print it directly

Suggested change
errors.append(f"dlck failed on {result.failed_hosts}")
self.fail(f"dlck basic test failed with errors: {errors}")
self.fail(f"dlck failed on {result.failed_hosts}")

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.

test_servers: 1
test_clients: 1

timeout: 600

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.

The last run completed in under 5 minutes so maybe this can be reduce to like 7 minutes?

Suggested change
timeout: 600
timeout: 420

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.

self.log.info("Faults: %s", fault_list)
self.log.info("Faults dict: %s", faults_dict)
dmg = self.get_dmg_command()
pool = add_pool(self)

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.

Suggested change
pool = add_pool(self)
pool = self.get_pool(self)

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

Comment thread src/tests/ftest/recovery/dlck_basic_fault.py Outdated
Comment on lines +70 to +76
count = 0
for key, value in faults_dict[test_fault].items():
if count == 0:
f.write(f"- {key}: \'{value}\'\n")
else:
f.write(f" {key}: \'{value}\'\n")
count += 1

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.

You can use enumerate instead of keeping track of the count

Suggested change
count = 0
for key, value in faults_dict[test_fault].items():
if count == 0:
f.write(f"- {key}: \'{value}\'\n")
else:
f.write(f" {key}: \'{value}\'\n")
count += 1
for count, (key, value) in enumerate(d.items()):
if count == 0:
f.write(f"- {key}: \'{value}\'\n")
else:
f.write(f" {key}: \'{value}\'\n")

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. Good suggestion !

Comment thread src/tests/ftest/util/dlck_utils.py Outdated
super().__init__(namespace, "dlck", path)
self.pool_uuid = FormattedParameter("--file={}", None)
self.nvme = FormattedParameter("--nvme={}", None)
self.storage_mount = FormattedParameter("--storage={}", None)

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.

Any reason to not call this self.storage to match the command line param name?

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.

Sure. Done.

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.

Since the server and pool config is the same for each test, I would suggest combining these two tests into a single python file.

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.

Yes. Merged both the test cases to a single python file...

Comment thread src/tests/ftest/recovery/dlck_basic_fault.py Outdated
Comment thread src/tests/ftest/recovery/dlck_basic_fault.py Outdated
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
@rpadma2

rpadma2 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Hmm... Something doesn't work after I changed to use get_pool instead of add_pool... Let me debug it later...

Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-md-on-ssd: false
Skip-fault-injection-test: true
Skip-unit-test: true
Skip-nlt: true
Test-tag: DlckBasicFaultTest DlckBasicTest

Signed-off-by: rpadma2 <ravindran.padmanabhan@hpe.com>
raise TypeError(f"Invalid {self.command} host NodeSet: {value} ({type(value)})")
self._hosts = value.copy()

def _run_process(self, raise_exception=None):

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.

Should the default for raise_exception be False instead of None?

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.

@shimizukko : Presently I am using this file based on @phender PR (related to his branch : hendersp/DAOS-19532 . Hopefully, all issues related to command_utils.py is addressed in that PR which I merge to my branch later.

Returns:
CommandResult: result from running the command
"""
if raise_exception is None:

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.

If it's bool shouldn't we use False?

Suggested change
if raise_exception is None:
if raise_exception is False:

detected, running = stop_processes(
self.log, hosts, regex, full_command=self.full_command_regex)
if not detected:
self.log.info(

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.

Shouldn't we collect error here (and elif and else block below) and return it at the end?

from command_utils_base import CommandWithParameters, FormattedParameter
from run_utils import run_remote

class TestDlck(TestWithServers):

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 the pattern is to separate util file and test base file. If this is a test base file, the class name should be:

Suggested change
class TestDlck(TestWithServers):
class DlckTestBase(TestWithServers):

The file name should be dlck_test_base.py

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.

@daltonbohning / @phender : Any comments? I can do whatever we decide. This is an initial version... I am pretty sure we will be create lot of utility functions later....

errors.append(error)
self.log_step("Run the dmg start 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.

:avocado: recursive
"""
def check_dlck_result(self, result, fault_name):
"""Check that dlck reports the expected error for an injected fault."""

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.

You might want to add Args section to explain the arguments.
Also, the description would be more clear if you say "Check that dlck reported the expected error..."

Comment on lines +91 to +97
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")

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants