This avoid breaking tests on RHEL6 where gnutls is too old for quorum to be built by default.
Signed-off-by: Benoit Canet <ben...@irqsave.net> --- tests/qemu-iotests/041 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 0815e19..c5267c0 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -18,6 +18,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # +import subprocess import time import os import iotests @@ -735,7 +736,19 @@ class TestRepairQuorum(ImageMirroringTestCase): image_len = 1 * 1024 * 1024 # MB IMAGES = [ quorum_img1, quorum_img2, quorum_img3 ] + def has_quorum(self): + qemu_img_args = os.environ.get('QEMU_IMG', 'qemu-img').strip().split(' ') + qemu_img_args.append("--help") + p1 = subprocess.Popen(qemu_img_args, stdout=subprocess.PIPE) + p2 = subprocess.Popen(["grep", "quorum"], stdin=p1.stdout, + stdout=subprocess.PIPE) + p1.stdout.close() + return len(p2.communicate()[0]) + def setUp(self): + if not self.has_quorum(): + self.skipTest('Quorum not builtin') + self.vm = iotests.VM() # Add each individual quorum images -- 2.0.0