From d173d317e314ad46c4af97eeb8cfcada1bb8e16f Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 5 Dec 2019 22:57:13 -0700 Subject: [PATCH] Updated badblocks section * Start tests in reverse order (so they appear in order on screen) * Fixed report parsing --- scripts/wk/hw/diags.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index f7cc562c..5bc33ba0 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -553,7 +553,7 @@ def disk_self_test(state, test_objects): f'Disk self-test{"s" if len(test_objects) > 1 else ""}', ) std.print_info(f'Starting self-test{"s" if len(test_objects) > 1 else ""}') - for test in test_objects: + for test in reversed(test_objects): test.set_status('Working') test_log = f'{state.log_dir}/{test.dev.path.name}_selftest.log' @@ -631,10 +631,13 @@ def disk_surface_scan(state, test_objects): ) # Check results - with open(log_path, 'a') as _f: + with open(log_path, 'r') as _f: + # Skip first line + _f.readline() + # Check the rest for line in _f.readlines(): line = line.strip() - if not line or line.startswith('Checking'): + if not line or line.startswith('Checking' or line.startswith('[')): # Skip continue if re.search(f'^Pass completed.*0.*0/0/0', line, re.IGNORECASE): @@ -655,7 +658,7 @@ def disk_surface_scan(state, test_objects): std.print_info( f'Starting disk surface scan{"s" if len(test_objects) > 1 else ""}', ) - for test in test_objects: + for test in reversed(test_objects): test_log = f'{state.log_dir}/{test.dev.path.name}_badblocks.log' # Start thread