diff --git a/scripts/wk/cfg/hw.py b/scripts/wk/cfg/hw.py index 673d45f4..10355377 100644 --- a/scripts/wk/cfg/hw.py +++ b/scripts/wk/cfg/hw.py @@ -19,6 +19,7 @@ BADBLOCKS_LARGE_DISK = 3 * 1024**4 CPU_CRITICAL_TEMP = 99 CPU_FAILURE_TEMP = 90 CPU_TEST_MINUTES = 7 +IO_SMALL_DISK = 450 * 1000**3 KEY_NVME = 'nvme_smart_health_information_log' KEY_SMART = 'ata_smart_attributes' KNOWN_DISK_ATTRIBUTES = { diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index c587af9d..36d87dcb 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -44,6 +44,10 @@ IO_MINIMUM_TEST_SIZE = 10 * 1024**3 IO_RATE_REGEX = re.compile( r'(?P\d+) bytes.* (?P\S+) s(?:,|ecs )', ) +IO_SIZE_SKIP_NAME = ( + 'Skip USB Benchmarks ' + f'(< {std.bytes_to_string(cfg.hw.IO_SMALL_DISK, use_binary=False)})' + ) MENU_ACTIONS = ( 'Audio Test', 'Keyboard Test', @@ -76,7 +80,7 @@ MENU_SETS = { MENU_TOGGLES = ( 'osTicket Integration', 'osTicket Tech Note', - 'Skip USB Benchmarks', + IO_SIZE_SKIP_NAME, ) NUM_DISK_TESTS = len([s for s in MENU_OPTIONS if s.startswith('Disk')]) PLATFORM = std.PLATFORM @@ -963,17 +967,23 @@ def disk_io_benchmark(state, test_objects, skip_usb=True): vertical=True, text=' ', ) + + # Skip USB devices if requested + for test in test_objects: + if ( + skip_usb + and test.dev.details['bus'] == 'USB' + and test.dev.details['size'] < cfg.hw.IO_SMALL_DISK + ): + test.set_status('Skipped') + test.disabled = True + continue + + # Start benchmark for test in test_objects: if test.disabled: - # Skip continue - # Skip USB devices if requested - if skip_usb and test.dev.details['bus'] == 'USB': - test.set_status('Skipped') - continue - - # Start benchmark if not aborted: std.clear_screen() std.print_report(test.dev.generate_report()) @@ -1642,7 +1652,7 @@ def run_diags(state, menu, quick_mode=False): function = details['Function'] args = [details['Objects']] if name == 'Disk I/O Benchmark': - args.append(menu.toggles['Skip USB Benchmarks']['Selected']) + args.append(menu.toggles[IO_SIZE_SKIP_NAME]['Selected']) std.clear_screen() try: function(state, *args)