qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] iotests: Add more "skip_if_unsupported" stateme


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH] iotests: Add more "skip_if_unsupported" statements to the python tests
Date: Tue, 20 Aug 2019 14:24:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 20.08.19 09:14, Thomas Huth wrote:
> On 8/19/19 9:13 PM, Max Reitz wrote:
>> On 19.08.19 11:21, Thomas Huth wrote:
>>> The python code already contains a possibility to skip tests if the
>>> corresponding driver is not available in the qemu binary - use it
>>> in more spots to avoid that the tests are failing if the driver has
>>> been disabled.
>>>
>>> Signed-off-by: Thomas Huth <address@hidden>
>>> ---
>>>  tests/qemu-iotests/030 |  3 +++
>>>  tests/qemu-iotests/040 |  2 ++
>>>  tests/qemu-iotests/041 | 14 +++++++++++++-
>>>  tests/qemu-iotests/245 |  2 ++
>>>  4 files changed, 20 insertions(+), 1 deletion(-)
>>
>> [...]
>>
>>> diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
>>> index 26bf1701eb..f45d20fbe0 100755
>>> --- a/tests/qemu-iotests/041
>>> +++ b/tests/qemu-iotests/041
>>> @@ -817,6 +817,7 @@ class TestRepairQuorum(iotests.QMPTestCase):
>>>      image_len = 1 * 1024 * 1024 # MB
>>>      IMAGES = [ quorum_img1, quorum_img2, quorum_img3 ]
>>>  
>>> +    @iotests.skip_if_unsupported(['quorum'])
>>>      def setUp(self):
>>>          self.vm = iotests.VM()
>>
>> It’s clear that none of these tests can run if there is no quorum
>> support, because setUp() creates a quorum node.  I think it would be
>> nice if it would suffice to just skip everything automatically if
>> setUp() is skipped and not have to bother about each of the test cases.
>>
>> Coincidentally (:-)), I have a patch to do that, namely “iotests: Allow
>> skipping test cases” in my “iotests: Selfish patches” series:
>>
>> https://lists.nongnu.org/archive/html/qemu-block/2019-06/msg01106.html
>>
>> Yes, that means you cannot use an annotation because it needs @self to
>> be able to skip the test.  Hm... But I think I can make that work by
>> simply s/case_notrun/args[0].case_skip/ in skip_if_unsupported()?
> 
> Sure, feel free to ignore my patch here or to modify it according to
> your reworks. As long as we finally get the iotests into a shape where
> they are a little bit more flexible wrt the enabled/disabled drivers,
> I'm happy.

Oh, no, I don’t mean to ignore the patch.  I just think that a
skip_if_unsupported() annotation above setUp() should be enough to skip
all tests.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]