qemu-iotests: add ability to exclude certain protocols from tests
authorJeff Cody <jcody@redhat.com>
Tue, 14 Feb 2017 16:21:17 +0000 (11:21 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 24 Feb 2017 15:09:22 +0000 (16:09 +0100)
Add the ability for shell script tests to exclude specific
protocols.  This is useful to allow all protocols except ones known to
not support a feature used in the test (e.g. .bdrv_create).

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/common.rc

index a3d904fc22b0503a7728ac961334d366293e45e5..6c0fd4cc61b8e3df4407db516f18d2305202b35d 100644 (file)
@@ -379,6 +379,18 @@ _supported_proto()
     _notrun "not suitable for this image protocol: $IMGPROTO"
 }
 
+# tests whether $IMGPROTO is specified as an unsupported image protocol for a test
+#
+_unsupported_proto()
+{
+    for f; do
+        if [ "$f" = "$IMGPROTO" ]; then
+            _notrun "not suitable for this image protocol: $IMGPROTO"
+            return
+        fi
+    done
+}
+
 # tests whether the host OS is one of the supported OSes for a test
 #
 _supported_os()