diff --git a/scripts/wk/hw/volumes.py b/scripts/wk/hw/volumes.py index 3c085665..83f64b28 100644 --- a/scripts/wk/hw/volumes.py +++ b/scripts/wk/hw/volumes.py @@ -56,16 +56,14 @@ def add_dev_line(test_obj, details) -> None: if filesystem == 'BitLocker': test_obj.report.append(f'{report_line} {bytes_to_string(size)}') - # Bail early + # Handle unsupported devices if not details['mountpoint']: # Under Linux the volume needs to be mounted to get used space - return - if used < 0: - # Only include "real" devices - return + used = -1 # Check for failures - if (percent_used >= VOLUME_FAILURE_THRESHOLD + if (used > 0 + and percent_used >= VOLUME_FAILURE_THRESHOLD and size >= VOLUME_SIZE_THRESHOLD * 1024**3): test_obj.failed = True @@ -76,7 +74,8 @@ def add_dev_line(test_obj, details) -> None: elif percent_used >= VOLUME_WARNING_THRESHOLD: color = 'YELLOW' size_line = f'{bytes_to_string(size)}' - size_line += f' ({bytes_to_string(used)} used, {percent_used:0.0f}% full)' + if used > 0: + size_line += f' ({bytes_to_string(used)} used, {percent_used:0.0f}% full)' size_line = color_string(size_line, str(color)) # Done