qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Silbe <silbe@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Kevin Wolf <kwolf@redhat.com>
Cc: Tu Bo <tubo@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 4/7] qemu-iotests: 148: properly skip test if quorum support is missing
Date: Tue,  5 Apr 2016 11:21:46 +0200	[thread overview]
Message-ID: <1459848109-29756-5-git-send-email-silbe@linux.vnet.ibm.com> (raw)
In-Reply-To: <1459848109-29756-1-git-send-email-silbe@linux.vnet.ibm.com>

qemu-iotests test case 148 already had some code for skipping the test
if quorum support is missing, but it didn't work in all
cases. TestQuorumEvents.setUp() gets run before the actual test class
(which contains the skipping code) and tries to start qemu with a drive
using the quorum driver. For some reason this works fine when using
qcow2, but fails for raw.

As the entire test case requires quorum, just check for availability
before even starting the test suite. Introduce a verify_quorum()
function in iotests.py for this purpose so future test cases can make
use of it.

Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com>
---
 tests/qemu-iotests/148        | 4 +---
 tests/qemu-iotests/iotests.py | 5 +++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/148 b/tests/qemu-iotests/148
index d066ec3..e01b061 100644
--- a/tests/qemu-iotests/148
+++ b/tests/qemu-iotests/148
@@ -79,9 +79,6 @@ sector = "%d"
                 self.assert_qmp(event, 'data/sector-num', sector)
 
     def testQuorum(self):
-        if not 'quorum' in iotests.qemu_img_pipe('--help'):
-            return
-
         # Generate an error and get an event
         self.vm.hmp_qemu_io("drive0", "aio_read %d %d" %
                             (offset * sector_size, sector_size))
@@ -139,4 +136,5 @@ class TestFifoQuorumEvents(TestQuorumEvents):
     read_pattern = 'fifo'
 
 if __name__ == '__main__':
+    iotests.verify_quorum()
     iotests.main(supported_fmts=["raw"])
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index fb5c482..bf31ec8 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -437,6 +437,11 @@ def verify_platform(supported_oses=['linux']):
     if True not in [sys.platform.startswith(x) for x in supported_oses]:
         notrun('not suitable for this OS: %s' % sys.platform)
 
+def verify_quorum():
+    '''Skip test suite if quorum support is not available'''
+    if 'quorum' not in qemu_img_pipe('--help'):
+        notrun('quorum support missing')
+
 def main(supported_fmts=[], supported_oses=['linux']):
     '''Run tests'''
 
-- 
1.9.1

  parent reply	other threads:[~2016-04-05  9:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05  9:21 [Qemu-devel] [PATCH 0/7] next round of qemu-iotests fixes Sascha Silbe
2016-04-05  9:21 ` [Qemu-devel] [PATCH 1/7] qemu-iotests: check: don't place files with predictable names in /tmp Sascha Silbe
2016-04-06 15:36   ` [Qemu-devel] [Qemu-block] " Max Reitz
2016-04-07 19:54     ` Sascha Silbe
2016-04-05  9:21 ` [Qemu-devel] [PATCH 2/7] qemu-iotests: fix 051 on non-PC architectures Sascha Silbe
2016-04-06 15:43   ` [Qemu-devel] [Qemu-block] " Max Reitz
2016-04-05  9:21 ` [Qemu-devel] [PATCH 3/7] qemu-iotests: iotests.VM: remove qtest socket on error Sascha Silbe
2016-04-06 15:55   ` [Qemu-devel] [Qemu-block] " Max Reitz
2016-04-07 19:58     ` Sascha Silbe
2016-04-05  9:21 ` Sascha Silbe [this message]
2016-04-06 16:04   ` [Qemu-devel] [Qemu-block] [PATCH 4/7] qemu-iotests: 148: properly skip test if quorum support is missing Max Reitz
2016-04-05  9:21 ` [Qemu-devel] [PATCH 5/7] qemu-iotests: 068: don't require KVM Sascha Silbe
2016-04-06 16:12   ` [Qemu-devel] [Qemu-block] " Max Reitz
2016-04-05  9:21 ` [Qemu-devel] [PATCH 6/7] qemu-iotests: 141: reduce likelihood of race condition on systems with fast IO Sascha Silbe
2016-04-06 16:15   ` [Qemu-devel] [Qemu-block] " Max Reitz
2016-04-06 16:30     ` Kevin Wolf
2016-04-07 20:27     ` Sascha Silbe
2016-04-08 11:11       ` Kevin Wolf
2016-04-08 12:01       ` Sascha Silbe
2016-04-08 12:31         ` Kevin Wolf
2016-04-08 13:46           ` Sascha Silbe
2016-04-05  9:21 ` [Qemu-devel] [PATCH 7/7] qemu-iotests: iotests.py: get rid of __all__ Sascha Silbe
2016-04-06 16:18   ` [Qemu-devel] [Qemu-block] " Max Reitz
2016-04-08 14:49 ` [Qemu-devel] [Qemu-block] [PATCH 0/7] next round of qemu-iotests fixes Max Reitz
2016-04-08 17:17   ` Sascha Silbe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459848109-29756-5-git-send-email-silbe@linux.vnet.ibm.com \
    --to=silbe@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tubo@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).