Skip to content

Conversation

@Pavithra1602
Copy link
Contributor

This test does Err injection and check if shutdown_state changed to dirty and reverts the changes to clean state.

@Pavithra1602
Copy link
Contributor Author

[root@ltcblue9fq-lp12 memory]# avocado run --max-parallel-tasks=1 ndctl.py:NdctlTest.test_inject_SMART_errors -m ndctl.py.data/ndctl.yaml
JOB ID : 41de9d6a2c32f309873dae48c6f2340476306398
JOB LOG : /home/OpTest/avocado-fvt-wrapper/results/job-2025-10-14T14.41-41de9d6/job.log
(1/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-fsdax-version-upstream-807e: STARTED
(1/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-fsdax-version-upstream-807e: CANCEL: iniparser is needed for the test to be run (1.29 s)
(2/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-sector-version-upstream-fb4b: STARTED
(2/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-sector-version-upstream-fb4b: CANCEL: iniparser is needed for the test to be run (1.05 s)
(3/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-fsdax-version-distro-5d2e: STARTED
(3/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-fsdax-version-distro-5d2e: PASS (0.28 s)
(4/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-sector-version-distro-a45a: STARTED
(4/4) ndctl.py:NdctlTest.test_inject_SMART_errors;run-fio_job-map-mode_types-sector-version-distro-a45a: PASS (0.28 s)
RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 2
JOB HTML : /home/OpTest/avocado-fvt-wrapper/results/job-2025-10-14T14.41-41de9d6/results.html
JOB TIME : 27.00 s
[root@ltcblue9fq-lp12 memory]#

@Naresh-ibm Naresh-ibm self-assigned this Oct 15, 2025
self.ndctl = os.path.abspath('/usr/bin/ndctl')
self.daxctl = os.path.abspath('/usr/bin/daxctl')

def get_shutdown_state(self, region):
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Pavithra1602 please add the docstring

memory/ndctl.py Outdated
self.daxctl = os.path.abspath('/usr/bin/daxctl')

def get_shutdown_state(self, region):
self.output = process.system_output('ndctl list -DH -r %s | grep shutdown_state'
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can use the cmd variable and re-use it, like below.

cmd = 'ndctl list -DH -r %s | grep shutdown_state' % region
self.output = process.system_output(cmd , sudo=True, shell=True)

memory/ndctl.py Outdated
self.output = process.system_output('ndctl list -DH -r %s | grep dev'
% region, sudo=True, shell=True)
process.system('ndctl inject-smart %s -U' % str(self.output).split("\"")[3],
sudo=True, shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, use cmd variable for easy indentation

memory/ndctl.py Outdated
self.output = process.system_output('ndctl list -DH -r %s | grep dev'
% region, sudo=True, shell=True)
process.system('ndctl inject-smart %s -N' % str(self.output).split("\"")[3],
sudo=True, shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here and above

…a pmem device.

This test does Err injection and check if shutdown_state changed to dirty and reverts the changes to clean state.

Signed-off-by: Pavithra <[email protected]>
Copy link
Collaborator

@Naresh-ibm Naresh-ibm left a comment

Choose a reason for hiding this comment

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

@Pavithra1602 Thanks for incorporating the changes.
LGTM

@Naresh-ibm Naresh-ibm merged commit 4251053 into avocado-framework-tests:master Nov 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants