@@ -324,6 +324,16 @@ _get_pci_parent_from_blkdev() {
tail -2 | head -1
}
+_require_test_dev_size_mb() {
+ local require_sz_mb=$1
+ local test_dev_sz_mb=$(($(blockdev --getsize64 "$TEST_DEV")/1024/1024))
+
+ if (( "$test_dev_sz_mb" < "$require_sz_mb" )); then
+ SKIP_REASONS+=("${TEST_DEV} required at least ${require_sz_mb}m")
+ return 1
+ fi
+}
+
_require_test_dev_in_hotplug_slot() {
local parent
parent="$(_get_pci_parent_from_blkdev)"
@@ -16,6 +16,10 @@ requires() {
_have_fio
}
+device_requires() {
+ _require_test_dev_size_mb 1024
+}
+
test_device() {
local subsys="blktests-subsystem-1"
local ctrldev
nvme/035 has minimum TEST_DEV size requirement, add a helper function to check it Signed-off-by: Yi Zhang <yi.zhang@redhat.com> --- common/rc | 10 ++++++++++ tests/nvme/035 | 4 ++++ 2 files changed, 14 insertions(+)