Received: from eggs.gnu.org ([2001:4830:134:3::10]:33215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1wKU-0007Zf-EU for qemu-devel@nongnu.org; Tue, 01 Jul 2014 07:34:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1wKP-00053N-C1 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 07:34:30 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:54070 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1wKP-00053A-3M for qemu-devel@nongnu.org; Tue, 01 Jul 2014 07:34:25 -0400 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Tue, 1 Jul 2014 13:34:12 +0200 Message-Id: <1404214452-30048-1-git-send-email-benoit.canet@irqsave.net> Subject: [Qemu-devel] [PATCH v2] qemu-iotests: Disable Quorum testing in 041 when Quorum is not builtin List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , Benoit Canet , stefanha@redhat.com This avoid breaking tests on RHEL6 where gnutls is too old for quorum to be built by default. Signed-off-by: Benoit Canet --- tests/qemu-iotests/041 | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 0815e19..55255a7 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -735,6 +735,9 @@ class TestRepairQuorum(ImageMirroringTestCase): image_len = 1 * 1024 * 1024 # MB IMAGES = [ quorum_img1, quorum_img2, quorum_img3 ] + def has_quorum(self): + return 'quorum' in iotests.qemu_img_pipe('--help') + def setUp(self): self.vm = iotests.VM() @@ -752,8 +755,9 @@ class TestRepairQuorum(ImageMirroringTestCase): #assemble the quorum block device from the individual files args = { "options" : { "driver": "quorum", "id": "quorum0", "vote-threshold": 2, "children": [ "img0", "img1", "img2" ] } } - result = self.vm.qmp("blockdev-add", **args) - self.assert_qmp(result, 'return', {}) + if self.has_quorum(): + result = self.vm.qmp("blockdev-add", **args) + self.assert_qmp(result, 'return', {}) def tearDown(self): @@ -766,6 +770,9 @@ class TestRepairQuorum(ImageMirroringTestCase): pass def test_complete(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() result = self.vm.qmp('drive-mirror', device='quorum0', sync='full', @@ -784,6 +791,9 @@ class TestRepairQuorum(ImageMirroringTestCase): 'target image does not match source after mirroring') def test_cancel(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() result = self.vm.qmp('drive-mirror', device='quorum0', sync='full', @@ -800,6 +810,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.vm.shutdown() def test_cancel_after_ready(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() result = self.vm.qmp('drive-mirror', device='quorum0', sync='full', @@ -818,6 +831,9 @@ class TestRepairQuorum(ImageMirroringTestCase): 'target image does not match source after mirroring') def test_pause(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() result = self.vm.qmp('drive-mirror', device='quorum0', sync='full', @@ -846,6 +862,9 @@ class TestRepairQuorum(ImageMirroringTestCase): 'target image does not match source after mirroring') def test_medium_not_found(self): + if not self.has_quorum(): + return + result = self.vm.qmp('drive-mirror', device='ide1-cd0', sync='full', node_name='repair0', replaces='img1', @@ -853,6 +872,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') def test_image_not_found(self): + if not self.has_quorum(): + return + result = self.vm.qmp('drive-mirror', device='quorum0', sync='full', node_name='repair0', replaces='img1', @@ -861,6 +883,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') def test_device_not_found(self): + if not self.has_quorum(): + return + result = self.vm.qmp('drive-mirror', device='nonexistent', sync='full', node_name='repair0', replaces='img1', @@ -868,6 +893,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'DeviceNotFound') def test_wrong_sync_mode(self): + if not self.has_quorum(): + return + result = self.vm.qmp('drive-mirror', device='quorum0', node_name='repair0', replaces='img1', @@ -875,12 +903,18 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') def test_no_node_name(self): + if not self.has_quorum(): + return + result = self.vm.qmp('drive-mirror', device='quorum0', sync='full', replaces='img1', target=quorum_repair_img, format=iotests.imgfmt) self.assert_qmp(result, 'error/class', 'GenericError') def test_unexistant_replaces(self): + if not self.has_quorum(): + return + result = self.vm.qmp('drive-mirror', device='quorum0', sync='full', node_name='repair0', replaces='img77', @@ -888,6 +922,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') def test_after_a_quorum_snapshot(self): + if not self.has_quorum(): + return + result = self.vm.qmp('blockdev-snapshot-sync', node_name='img1', snapshot_file=quorum_snapshot_file, snapshot_node_name="snap1"); -- 2.0.1