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)
|
||||
SIDE_PANE_WIDTH = 20
|
||||
STATUSES = {
|
||||
'RED': ['Denied', 'ERROR', 'NS', 'OVERRIDE', 'TimedOut'],
|
||||
'YELLOW': ['Aborted', 'N/A', 'Unknown', 'Working'],
|
||||
'RED': ['Denied', 'ERROR', 'NS', 'TimedOut'],
|
||||
'YELLOW': ['Aborted', 'N/A', 'OVERRIDE', 'Unknown', 'Working'],
|
||||
'GREEN': ['CS'],
|
||||
}
|
||||
TESTS_CPU = ['Prime95']
|
||||
|
|
@ -246,7 +246,9 @@ class DiskObj():
|
|||
print_standard(' (Have you tried swapping the disk cable?)')
|
||||
else:
|
||||
# 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))
|
||||
if override_disabled:
|
||||
print_standard('Tests disabled for this device')
|
||||
|
|
@ -1452,8 +1454,6 @@ def run_nvme_smart_tests(state, test):
|
|||
|
||||
# Show attributes
|
||||
clear_screen()
|
||||
print_info('Device ({})'.format(test.dev.name))
|
||||
print_standard(' {}'.format(test.dev.description))
|
||||
show_report(test.dev.generate_attribute_report())
|
||||
print_standard(' ')
|
||||
|
||||
|
|
@ -1517,7 +1517,7 @@ def run_nvme_smart_tests(state, test):
|
|||
test.update_status('TimedOut')
|
||||
|
||||
# Disable other drive tests if necessary
|
||||
if not test.passed:
|
||||
if test.failed:
|
||||
for t in ['badblocks', 'I/O Benchmark']:
|
||||
test.dev.disable_test(t, 'Denied')
|
||||
|
||||
|
|
@ -1541,10 +1541,11 @@ def secret_screensaver(screensaver=None):
|
|||
raise Exception('Invalid screensaver')
|
||||
run_program(cmd, check=False, pipe=False)
|
||||
|
||||
def show_report(report):
|
||||
"""Show report on screen and save to log w/out color."""
|
||||
def show_report(report, log_report=False):
|
||||
"""Show report on screen and optionally save to log w/out color."""
|
||||
for line in report:
|
||||
print(line)
|
||||
if log_report:
|
||||
print_log(strip_colors(line))
|
||||
|
||||
def show_results(state):
|
||||
|
|
@ -1560,7 +1561,7 @@ def show_results(state):
|
|||
_enabled |= state.tests[k]['Enabled']
|
||||
if _enabled:
|
||||
print_success('CPU:'.format(k))
|
||||
show_report(state.cpu.generate_cpu_report())
|
||||
show_report(state.cpu.generate_cpu_report(), log_report=True)
|
||||
print_standard(' ')
|
||||
|
||||
# Disk tests
|
||||
|
|
@ -1571,7 +1572,7 @@ def show_results(state):
|
|||
print_success('Disk{}:'.format(
|
||||
'' if len(state.disks) == 1 else 's'))
|
||||
for disk in state.disks:
|
||||
show_report(disk.generate_disk_report())
|
||||
show_report(disk.generate_disk_report(), log_report=True)
|
||||
print_standard(' ')
|
||||
|
||||
def update_main_options(state, selection, main_options):
|
||||
|
|
|
|||
Loading…
Reference in a new issue