Fixed OVERRIDE and N/A NVMe/SMART status handling
This commit is contained in:
parent
b5c93317dc
commit
5b74879805
1 changed files with 12 additions and 8 deletions
|
|
@ -162,8 +162,11 @@ class DiskObj():
|
||||||
print_standard('Tests disabled for this device')
|
print_standard('Tests disabled for this device')
|
||||||
pause()
|
pause()
|
||||||
elif not (len(self.tests) == 3 and HW_OVERRIDES_LIMITED):
|
elif not (len(self.tests) == 3 and HW_OVERRIDES_LIMITED):
|
||||||
self.disk_ok = HW_OVERRIDES_FORCED or ask(
|
if HW_OVERRIDES_FORCED or ask('Run tests on this device anyway?'):
|
||||||
'Run tests on this device anyway?')
|
self.disk_ok = True
|
||||||
|
if 'NVMe / SMART' in self.tests:
|
||||||
|
self.tests['NVMe / SMART'].update_status('OVERRIDE')
|
||||||
|
self.tests['NVMe / SMART'].disabled = True
|
||||||
|
|
||||||
def get_details(self):
|
def get_details(self):
|
||||||
"""Get data from lsblk."""
|
"""Get data from lsblk."""
|
||||||
|
|
@ -235,6 +238,9 @@ class DiskObj():
|
||||||
self.check_attributes(silent)
|
self.check_attributes(silent)
|
||||||
else:
|
else:
|
||||||
# No NVMe/SMART details
|
# No NVMe/SMART details
|
||||||
|
if 'NVMe / SMART' in self.tests:
|
||||||
|
self.tests['NVMe / SMART'].update_status('N/A')
|
||||||
|
self.tests['NVMe / SMART'].disabled = True
|
||||||
if silent:
|
if silent:
|
||||||
self.disk_ok = HW_OVERRIDES_FORCED
|
self.disk_ok = HW_OVERRIDES_FORCED
|
||||||
else:
|
else:
|
||||||
|
|
@ -247,8 +253,8 @@ class DiskObj():
|
||||||
if not self.disk_ok:
|
if not self.disk_ok:
|
||||||
for t in ['badblocks', 'I/O Benchmark']:
|
for t in ['badblocks', 'I/O Benchmark']:
|
||||||
if t in self.tests:
|
if t in self.tests:
|
||||||
self.tests[t].disabled = True
|
|
||||||
self.tests[t].update_status('Denied')
|
self.tests[t].update_status('Denied')
|
||||||
|
self.tests[t].disabled = True
|
||||||
|
|
||||||
def show_attributes(self):
|
def show_attributes(self):
|
||||||
"""Show NVMe/SMART attributes."""
|
"""Show NVMe/SMART attributes."""
|
||||||
|
|
@ -359,6 +365,8 @@ class TestObj():
|
||||||
|
|
||||||
def update_status(self, new_status=None):
|
def update_status(self, new_status=None):
|
||||||
"""Update status strings."""
|
"""Update status strings."""
|
||||||
|
if self.disabled:
|
||||||
|
return
|
||||||
if new_status:
|
if new_status:
|
||||||
self.status = build_status_string(
|
self.status = build_status_string(
|
||||||
self.label, new_status, self.info_label)
|
self.label, new_status, self.info_label)
|
||||||
|
|
@ -944,8 +952,8 @@ def run_nvme_smart_tests(state, test):
|
||||||
else:
|
else:
|
||||||
for t in ['badblocks', 'I/O Benchmark']:
|
for t in ['badblocks', 'I/O Benchmark']:
|
||||||
if t in test.dev.tests:
|
if t in test.dev.tests:
|
||||||
test.dev.tests[t].disabled = True
|
|
||||||
test.dev.tests[t].update_status('Denied')
|
test.dev.tests[t].update_status('Denied')
|
||||||
|
test.dev.tests[t].disabled = True
|
||||||
# TODO
|
# TODO
|
||||||
if no_logs:
|
if no_logs:
|
||||||
test.update_status('Unknown')
|
test.update_status('Unknown')
|
||||||
|
|
@ -955,10 +963,6 @@ def run_nvme_smart_tests(state, test):
|
||||||
else:
|
else:
|
||||||
test.failed = True
|
test.failed = True
|
||||||
test.update_status('NS')
|
test.update_status('NS')
|
||||||
else:
|
|
||||||
# NOTE: Pass/Fail not applicable without NVMe/SMART data
|
|
||||||
# Override request earlier disabled other test(s) as appropriate
|
|
||||||
test.update_status('N/A')
|
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue