Merge remote-tracking branch 'upstream/dev' into hw-diags-rewrite
This commit is contained in:
commit
2372fb0d2f
1 changed files with 12 additions and 11 deletions
|
|
@ -70,8 +70,8 @@ KEY_SMART = 'ata_smart_attributes'
|
||||||
QUICK_LABEL = '{YELLOW}(Quick){CLEAR}'.format(**COLORS)
|
QUICK_LABEL = '{YELLOW}(Quick){CLEAR}'.format(**COLORS)
|
||||||
SIDE_PANE_WIDTH = 20
|
SIDE_PANE_WIDTH = 20
|
||||||
STATUSES = {
|
STATUSES = {
|
||||||
'RED': ['Denied', 'ERROR', 'NS', 'OVERRIDE', 'TimedOut'],
|
'RED': ['Denied', 'ERROR', 'NS', 'TimedOut'],
|
||||||
'YELLOW': ['Aborted', 'N/A', 'Unknown', 'Working'],
|
'YELLOW': ['Aborted', 'N/A', 'OVERRIDE', 'Unknown', 'Working'],
|
||||||
'GREEN': ['CS'],
|
'GREEN': ['CS'],
|
||||||
}
|
}
|
||||||
TESTS_CPU = ['Prime95']
|
TESTS_CPU = ['Prime95']
|
||||||
|
|
@ -246,7 +246,9 @@ class DiskObj():
|
||||||
print_standard(' (Have you tried swapping the disk cable?)')
|
print_standard(' (Have you tried swapping the disk cable?)')
|
||||||
else:
|
else:
|
||||||
# Override?
|
# Override?
|
||||||
show_report(self.generate_attribute_report(description=True))
|
show_report(
|
||||||
|
self.generate_attribute_report(description=True),
|
||||||
|
log_report=True)
|
||||||
print_warning(' {} error(s) detected.'.format(attr_type))
|
print_warning(' {} error(s) detected.'.format(attr_type))
|
||||||
if override_disabled:
|
if override_disabled:
|
||||||
print_standard('Tests disabled for this device')
|
print_standard('Tests disabled for this device')
|
||||||
|
|
@ -1452,8 +1454,6 @@ def run_nvme_smart_tests(state, test):
|
||||||
|
|
||||||
# Show attributes
|
# Show attributes
|
||||||
clear_screen()
|
clear_screen()
|
||||||
print_info('Device ({})'.format(test.dev.name))
|
|
||||||
print_standard(' {}'.format(test.dev.description))
|
|
||||||
show_report(test.dev.generate_attribute_report())
|
show_report(test.dev.generate_attribute_report())
|
||||||
print_standard(' ')
|
print_standard(' ')
|
||||||
|
|
||||||
|
|
@ -1517,7 +1517,7 @@ def run_nvme_smart_tests(state, test):
|
||||||
test.update_status('TimedOut')
|
test.update_status('TimedOut')
|
||||||
|
|
||||||
# Disable other drive tests if necessary
|
# Disable other drive tests if necessary
|
||||||
if not test.passed:
|
if test.failed:
|
||||||
for t in ['badblocks', 'I/O Benchmark']:
|
for t in ['badblocks', 'I/O Benchmark']:
|
||||||
test.dev.disable_test(t, 'Denied')
|
test.dev.disable_test(t, 'Denied')
|
||||||
|
|
||||||
|
|
@ -1541,11 +1541,12 @@ def secret_screensaver(screensaver=None):
|
||||||
raise Exception('Invalid screensaver')
|
raise Exception('Invalid screensaver')
|
||||||
run_program(cmd, check=False, pipe=False)
|
run_program(cmd, check=False, pipe=False)
|
||||||
|
|
||||||
def show_report(report):
|
def show_report(report, log_report=False):
|
||||||
"""Show report on screen and save to log w/out color."""
|
"""Show report on screen and optionally save to log w/out color."""
|
||||||
for line in report:
|
for line in report:
|
||||||
print(line)
|
print(line)
|
||||||
print_log(strip_colors(line))
|
if log_report:
|
||||||
|
print_log(strip_colors(line))
|
||||||
|
|
||||||
def show_results(state):
|
def show_results(state):
|
||||||
"""Show results for all tests."""
|
"""Show results for all tests."""
|
||||||
|
|
@ -1560,7 +1561,7 @@ def show_results(state):
|
||||||
_enabled |= state.tests[k]['Enabled']
|
_enabled |= state.tests[k]['Enabled']
|
||||||
if _enabled:
|
if _enabled:
|
||||||
print_success('CPU:'.format(k))
|
print_success('CPU:'.format(k))
|
||||||
show_report(state.cpu.generate_cpu_report())
|
show_report(state.cpu.generate_cpu_report(), log_report=True)
|
||||||
print_standard(' ')
|
print_standard(' ')
|
||||||
|
|
||||||
# Disk tests
|
# Disk tests
|
||||||
|
|
@ -1571,7 +1572,7 @@ def show_results(state):
|
||||||
print_success('Disk{}:'.format(
|
print_success('Disk{}:'.format(
|
||||||
'' if len(state.disks) == 1 else 's'))
|
'' if len(state.disks) == 1 else 's'))
|
||||||
for disk in state.disks:
|
for disk in state.disks:
|
||||||
show_report(disk.generate_disk_report())
|
show_report(disk.generate_disk_report(), log_report=True)
|
||||||
print_standard(' ')
|
print_standard(' ')
|
||||||
|
|
||||||
def update_main_options(state, selection, main_options):
|
def update_main_options(state, selection, main_options):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue