Merge branch 'project-overhaul' into dev
This commit is contained in:
commit
d3adc08c15
3 changed files with 18 additions and 5 deletions
|
|
@ -130,7 +130,7 @@ TMUX_LAYOUT = OrderedDict({
|
||||||
# Testing panes
|
# Testing panes
|
||||||
'Temps': {'height': 1000, 'Check': False},
|
'Temps': {'height': 1000, 'Check': False},
|
||||||
'Prime95': {'height': 11, 'Check': False},
|
'Prime95': {'height': 11, 'Check': False},
|
||||||
'SMART': {'height': 3, 'Check': True},
|
'SMART': {'height': 4, 'Check': True},
|
||||||
'badblocks': {'height': 5, 'Check': True},
|
'badblocks': {'height': 5, 'Check': True},
|
||||||
'I/O Benchmark': {'height': 1000, 'Check': False},
|
'I/O Benchmark': {'height': 1000, 'Check': False},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,11 @@ class State():
|
||||||
disk.tests['Disk Self-Test'].report.append(
|
disk.tests['Disk Self-Test'].report.append(
|
||||||
std.color_string('Please manually review SMART data', 'YELLOW'),
|
std.color_string('Please manually review SMART data', 'YELLOW'),
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
# No blocking errors encountered, check for minor attribute failures
|
||||||
|
if not disk.check_attributes(only_blocking=False):
|
||||||
|
disk.tests['Disk Attributes'].failed = True
|
||||||
|
disk.tests['Disk Attributes'].set_status('Failed')
|
||||||
|
|
||||||
# Disable tests if necessary
|
# Disable tests if necessary
|
||||||
if disable_tests:
|
if disable_tests:
|
||||||
|
|
@ -824,7 +829,7 @@ def disk_io_benchmark(state, test_objects, skip_usb=True):
|
||||||
f'Disk I/O Benchmark{"s" if len(test_objects) > 1 else ""}',
|
f'Disk I/O Benchmark{"s" if len(test_objects) > 1 else ""}',
|
||||||
)
|
)
|
||||||
state.panes['I/O Benchmark'] = tmux.split_window(
|
state.panes['I/O Benchmark'] = tmux.split_window(
|
||||||
percent=75,
|
percent=50,
|
||||||
vertical=True,
|
vertical=True,
|
||||||
text=' ',
|
text=' ',
|
||||||
)
|
)
|
||||||
|
|
@ -928,7 +933,7 @@ def disk_self_test(state, test_objects):
|
||||||
# Show progress
|
# Show progress
|
||||||
if threads[-1].is_alive():
|
if threads[-1].is_alive():
|
||||||
state.panes['SMART'].append(
|
state.panes['SMART'].append(
|
||||||
tmux.split_window(lines=3, vertical=True, watch_file=test_log),
|
tmux.split_window(lines=4, vertical=True, watch_file=test_log),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Wait for all tests to complete
|
# Wait for all tests to complete
|
||||||
|
|
|
||||||
|
|
@ -452,6 +452,12 @@ class Disk(BaseObj):
|
||||||
status_str = 'Starting self-test...'
|
status_str = 'Starting self-test...'
|
||||||
test_details = self.get_smart_self_test_details()
|
test_details = self.get_smart_self_test_details()
|
||||||
test_minutes = 15
|
test_minutes = 15
|
||||||
|
size_str = bytes_to_string(self.details["size"], use_binary=False)
|
||||||
|
header_str = color_string(
|
||||||
|
['[', self.path.name, ' ', size_str, ']'],
|
||||||
|
[None, 'BLUE', None, 'CYAN', None],
|
||||||
|
sep='',
|
||||||
|
)
|
||||||
|
|
||||||
# Check if disk supports self-tests
|
# Check if disk supports self-tests
|
||||||
if not test_details:
|
if not test_details:
|
||||||
|
|
@ -463,6 +469,8 @@ class Disk(BaseObj):
|
||||||
test_minutes = int(test_minutes) + 10
|
test_minutes = int(test_minutes) + 10
|
||||||
|
|
||||||
# Start test
|
# Start test
|
||||||
|
with open(log_path, 'w') as _f:
|
||||||
|
_f.write(f'{header_str}\nInitializing...')
|
||||||
cmd = [
|
cmd = [
|
||||||
'sudo',
|
'sudo',
|
||||||
'smartctl',
|
'smartctl',
|
||||||
|
|
@ -487,7 +495,7 @@ class Disk(BaseObj):
|
||||||
|
|
||||||
# Update log
|
# Update log
|
||||||
with open(log_path, 'w') as _f:
|
with open(log_path, 'w') as _f:
|
||||||
_f.write(f'SMART self-test status for {self.path}:\n {status_str}')
|
_f.write(f'{header_str}\nSMART self-test status:\n {status_str}')
|
||||||
|
|
||||||
# Check if finished
|
# Check if finished
|
||||||
if 'remaining_percent' not in test_details['status']:
|
if 'remaining_percent' not in test_details['status']:
|
||||||
|
|
@ -539,7 +547,7 @@ class Disk(BaseObj):
|
||||||
'raw': int(value),
|
'raw': int(value),
|
||||||
'raw_str': str(value),
|
'raw_str': str(value),
|
||||||
}
|
}
|
||||||
except ValueError:
|
except (TypeError, ValueError):
|
||||||
# Ignoring invalid attribute
|
# Ignoring invalid attribute
|
||||||
LOG.error('Invalid NVMe attribute: %s %s', name, value)
|
LOG.error('Invalid NVMe attribute: %s %s', name, value)
|
||||||
elif KEY_SMART in self.smartctl:
|
elif KEY_SMART in self.smartctl:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue