diff mbox series

[04/17] iotest 030: skip quorum test setup/teardown too

Message ID 20180426161958.2872-5-rkagan@virtuozzo.com
State New
Headers show
Series iotests: don't choke on disabled drivers | expand

Commit Message

Roman Kagan April 26, 2018, 4:19 p.m. UTC
If quorum driver is not enabled, test 030 skips the corresponding
testcase.  This, however, is insufficient: quorum is first used in the
testsuite's setUp.

To avoid erroring out here, skip setUp/tearDown, too.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
---
 tests/qemu-iotests/030 | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Max Reitz May 30, 2018, 12:19 p.m. UTC | #1
On 2018-04-26 18:19, Roman Kagan wrote:
> If quorum driver is not enabled, test 030 skips the corresponding
> testcase.  This, however, is insufficient: quorum is first used in the
> testsuite's setUp.
> 
> To avoid erroring out here, skip setUp/tearDown, too.
> 
> Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
> ---
>  tests/qemu-iotests/030 | 6 ++++++
>  1 file changed, 6 insertions(+)

Not sure if there is any nicer way of doing this, but:

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox series

Patch

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 640a6dfd10..6b20ff005e 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -423,6 +423,9 @@  class TestQuorum(iotests.QMPTestCase):
     backing = []
 
     def setUp(self):
+        if not iotests.supports_quorum():
+            return
+
         opts = ['driver=quorum', 'vote-threshold=2']
 
         # Initialize file names and command-line options
@@ -445,6 +448,9 @@  class TestQuorum(iotests.QMPTestCase):
         self.vm.launch()
 
     def tearDown(self):
+        if not iotests.supports_quorum():
+            return
+
         self.vm.shutdown()
         for img in self.children:
             os.remove(img)