Limit badblocks scan to minimum in test_mode

This commit is contained in:
2Shirt 2022-10-22 19:41:27 -07:00
parent a324e71ba9
commit 25b64d6852
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -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)