Add SMART short test results to osTicket report

This commit is contained in:
2Shirt 2018-10-03 23:52:23 -06:00
parent cdb0963139
commit ba302f0c5b

View file

@ -90,6 +90,7 @@ TESTS = {
'NVMe/SMART': {
'Enabled': False,
'Quick': False,
'Short Test': {},
'Status': {},
},
'badblocks': {
@ -601,6 +602,12 @@ def post_drive_results(ticket_number):
report[-1] = report[-1].replace('_', ' ')
report.append('')
# SMART Short test result
if TESTS['NVMe/SMART']['Short Test'][name]:
report.append('SMART short test result: {}'.format(
TESTS['NVMe/SMART']['Short Test'][name]))
report.append('')
# badblocks
bb_status = TESTS['badblocks']['Status'].get(name, None)
if TESTS['badblocks']['Enabled'] and bb_status not in ['Denied', 'Skipped', 'Aborted']:
@ -1122,6 +1129,7 @@ def run_nvme_smart(ticket_number):
# Run
for name, dev in sorted(TESTS['NVMe/SMART']['Devices'].items()):
TESTS['NVMe/SMART']['Short Test'][name] = None
cur_status = TESTS['NVMe/SMART']['Status'][name]
if cur_status == 'OVERRIDE':
# Skipping test per user request
@ -1187,8 +1195,10 @@ def run_nvme_smart(ticket_number):
'passed', False)
if test_passed:
TESTS['NVMe/SMART']['Status'][name] = 'CS'
TESTS['NVMe/SMART']['Short Test'][name] = 'CS'
else:
TESTS['NVMe/SMART']['Status'][name] = 'NS'
TESTS['NVMe/SMART']['Short Test'][name] = 'NS'
update_progress()
print_standard('Done', timestamp=False)