From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X482c-0003tL-Em for qemu-devel@nongnu.org; Mon, 07 Jul 2014 08:29:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X482V-000554-Tr for qemu-devel@nongnu.org; Mon, 07 Jul 2014 08:29:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X482V-00054e-EX for qemu-devel@nongnu.org; Mon, 07 Jul 2014 08:28:59 -0400 From: Stefan Hajnoczi Date: Mon, 7 Jul 2014 14:28:32 +0200 Message-Id: <1404736118-10078-6-git-send-email-stefanha@redhat.com> In-Reply-To: <1404736118-10078-1-git-send-email-stefanha@redhat.com> References: <1404736118-10078-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL for-2.1 05/11] 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: =?UTF-8?q?Beno=C3=AEt=20Canet?= , Peter Maydell , Benoit Canet , Stefan Hajnoczi From: Beno=C3=AEt Canet This avoid breaking tests on RHEL6 where gnutls is too old for quorum to = be built by default. Signed-off-by: Benoit Canet Signed-off-by: Stefan Hajnoczi --- 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 005090e..5dbd4ee 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -740,6 +740,9 @@ class TestRepairQuorum(ImageMirroringTestCase): image_len =3D 1 * 1024 * 1024 # MB IMAGES =3D [ quorum_img1, quorum_img2, quorum_img3 ] =20 + def has_quorum(self): + return 'quorum' in iotests.qemu_img_pipe('--help') + def setUp(self): self.vm =3D iotests.VM() =20 @@ -757,8 +760,9 @@ class TestRepairQuorum(ImageMirroringTestCase): #assemble the quorum block device from the individual files args =3D { "options" : { "driver": "quorum", "id": "quorum0", "vote-threshold": 2, "children": [ "img0", "img1", "img= 2" ] } } - result =3D self.vm.qmp("blockdev-add", **args) - self.assert_qmp(result, 'return', {}) + if self.has_quorum(): + result =3D self.vm.qmp("blockdev-add", **args) + self.assert_qmp(result, 'return', {}) =20 =20 def tearDown(self): @@ -771,6 +775,9 @@ class TestRepairQuorum(ImageMirroringTestCase): pass =20 def test_complete(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() =20 result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', sync=3D= 'full', @@ -789,6 +796,9 @@ class TestRepairQuorum(ImageMirroringTestCase): 'target image does not match source after mirror= ing') =20 def test_cancel(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() =20 result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', sync=3D= 'full', @@ -805,6 +815,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.vm.shutdown() =20 def test_cancel_after_ready(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() =20 result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', sync=3D= 'full', @@ -823,6 +836,9 @@ class TestRepairQuorum(ImageMirroringTestCase): 'target image does not match source after mirror= ing') =20 def test_pause(self): + if not self.has_quorum(): + return + self.assert_no_active_block_jobs() =20 result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', sync=3D= 'full', @@ -851,6 +867,9 @@ class TestRepairQuorum(ImageMirroringTestCase): 'target image does not match source after mirror= ing') =20 def test_medium_not_found(self): + if not self.has_quorum(): + return + result =3D self.vm.qmp('drive-mirror', device=3D'ide1-cd0', sync= =3D'full', node_name=3D'repair0', replaces=3D'img1', @@ -858,6 +877,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_image_not_found(self): + if not self.has_quorum(): + return + result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', sync=3D= 'full', node_name=3D'repair0', replaces=3D'img1', @@ -866,6 +888,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_device_not_found(self): + if not self.has_quorum(): + return + result =3D self.vm.qmp('drive-mirror', device=3D'nonexistent', s= ync=3D'full', node_name=3D'repair0', replaces=3D'img1', @@ -873,6 +898,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'DeviceNotFound') =20 def test_wrong_sync_mode(self): + if not self.has_quorum(): + return + result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', node_name=3D'repair0', replaces=3D'img1', @@ -880,12 +908,18 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_no_node_name(self): + if not self.has_quorum(): + return + result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', sync=3D= 'full', replaces=3D'img1', target=3Dquorum_repair_img, format=3Diotest= s.imgfmt) self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_unexistant_replaces(self): + if not self.has_quorum(): + return + result =3D self.vm.qmp('drive-mirror', device=3D'quorum0', sync=3D= 'full', node_name=3D'repair0', replaces=3D'img77', @@ -893,6 +927,9 @@ class TestRepairQuorum(ImageMirroringTestCase): self.assert_qmp(result, 'error/class', 'GenericError') =20 def test_after_a_quorum_snapshot(self): + if not self.has_quorum(): + return + result =3D self.vm.qmp('blockdev-snapshot-sync', node_name=3D'im= g1', snapshot_file=3Dquorum_snapshot_file, snapshot_node_name=3D"snap1"); --=20 1.9.3