From ba302f0c5b4678a0c995bcd5933bca01c5b1939f Mon Sep 17 00:00:00 2001 From: 2Shirt <1923621+2Shirt@users.noreply.github.com> Date: Wed, 3 Oct 2018 23:52:23 -0600 Subject: [PATCH] Add SMART short test results to osTicket report --- .bin/Scripts/functions/hw_diags.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 807965ae..b1284989 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -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)