aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common.rc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/common.rc')
-rw-r--r--tests/qemu-iotests/common.rc14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 5502c3d..ee20be8 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -520,5 +520,19 @@ _require_command()
[ -x "$c" ] || _notrun "$1 utility required, skipped this test"
}
+# Check that a set of drivers has been whitelisted in the QEMU binary
+#
+_require_drivers()
+{
+ available=$($QEMU -drive format=help | \
+ sed -e '/Supported formats:/!d' -e 's/Supported formats://')
+ for driver
+ do
+ if ! echo "$available" | grep -q " $driver\( \|$\)"; then
+ _notrun "$driver not available"
+ fi
+ done
+}
+
# make sure this script returns success
true