OSDN Git Service

iotests: Allow skipping test cases
authorMax Reitz <mreitz@redhat.com>
Tue, 17 Sep 2019 09:19:59 +0000 (11:19 +0200)
committerMax Reitz <mreitz@redhat.com>
Mon, 28 Oct 2019 10:22:30 +0000 (11:22 +0100)
commit6be012252018249d3a2843a0143ee8cca41c276d
treebeefd2cb040c0ab361b73492730be382234d83e5
parenta6f8f9f82c857cf31cda702e6c62d623e8ddedd5
iotests: Allow skipping test cases

case_notrun() does not actually skip the current test case.  It just
adds a "notrun" note and then returns to the caller, who manually has to
skip the test.  Generally, skipping a test case is as simple as
returning from the current function, but not always: For example, this
model does not allow skipping tests already in the setUp() function.

Thus, add a QMPTestCase.case_skip() function that invokes case_notrun()
and then self.skipTest().  To make this work, we need to filter the
information on how many test cases were skipped from the unittest
output.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Message-id: 20190917092004.999-3-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/iotests.py