-
Notifications
You must be signed in to change notification settings - Fork 130
Test to verify the error injection feature of ndctl inject-smart for a pmem device. #3060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test to verify the error injection feature of ndctl inject-smart for a pmem device. #3060
Conversation
|
[root@ltcblue9fq-lp12 memory]# avocado run --max-parallel-tasks=1 ndctl.py:NdctlTest.test_inject_SMART_errors -m ndctl.py.data/ndctl.yaml |
| self.ndctl = os.path.abspath('/usr/bin/ndctl') | ||
| self.daxctl = os.path.abspath('/usr/bin/daxctl') | ||
|
|
||
| def get_shutdown_state(self, region): |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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]>
c399100 to
2afea1b
Compare
Naresh-ibm
left a comment
There was a problem hiding this 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
This test does Err injection and check if shutdown_state changed to dirty and reverts the changes to clean state.