From 25b64d685262700f3ac78a0efccabd7823560447 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 22 Oct 2022 19:41:27 -0700 Subject: [PATCH] Limit badblocks scan to minimum in test_mode --- scripts/wk/hw/benchmark.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/wk/hw/benchmark.py b/scripts/wk/hw/benchmark.py index 3b6481e3..8aebf51d 100644 --- a/scripts/wk/hw/benchmark.py +++ b/scripts/wk/hw/benchmark.py @@ -66,6 +66,8 @@ def calc_io_dd_values(dev_size, test_mode=False) -> dict[str, int]: test_mode limits the benchmark to IO_MINIMUM_TEST_SIZE (if possible) """ + if test_mode and dev_size > IO_MINIMUM_TEST_SIZE: + dev_size = IO_MINIMUM_TEST_SIZE read_total = min(IO_MINIMUM_TEST_SIZE, dev_size) read_total = max(read_total, dev_size*IO_ALT_TEST_SIZE_FACTOR) read_chunks = int(read_total // IO_CHUNK_SIZE)