[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 17/26] tests: refactor python I/O tests helper ma
From: |
Daniel P. Berrange |
Subject: |
[Qemu-devel] [PATCH v3 17/26] tests: refactor python I/O tests helper main method |
Date: |
Mon, 15 Feb 2016 16:10:50 +0000 |
The iotests.py helper provides a main() method for running
tests via the python unit test framework. Not all tests
will want to use this, so refactor it to split the testing
of compatible formats and platforms into separate helper
methods
Signed-off-by: Daniel P. Berrange <address@hidden>
---
tests/qemu-iotests/iotests.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 5f82bbe..51e53bb 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -29,7 +29,8 @@ import qtest
import struct
__all__ = ['imgfmt', 'imgproto', 'test_dir' 'qemu_img', 'qemu_io',
- 'VM', 'QMPTestCase', 'notrun', 'main']
+ 'VM', 'QMPTestCase', 'notrun', 'main', 'verify_image_format',
+ 'verify_platform']
# This will not work if arguments contain spaces but is necessary if we
# want to support the override options that ./check supports.
@@ -394,17 +395,22 @@ def notrun(reason):
print '%s not run: %s' % (seq, reason)
sys.exit(0)
-def main(supported_fmts=[], supported_oses=['linux']):
- '''Run tests'''
-
- debug = '-d' in sys.argv
- verbosity = 1
+def verify_image_format(supported_fmts=[]):
if supported_fmts and (imgfmt not in supported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
+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 main(supported_fmts=[], supported_oses=['linux']):
+ '''Run tests'''
+
+ debug = '-d' in sys.argv
+ verbosity = 1
+ verify_image_format(supported_fmts)
+ verify_platform(supported_oses)
+
# We need to filter out the time taken from the output so that qemu-iotest
# can reliably diff the results against master output.
import StringIO
--
2.5.0
- [Qemu-devel] [PATCH v3 05/26] crypto: skip testing of unsupported cipher algorithms, (continued)
- [Qemu-devel] [PATCH v3 05/26] crypto: skip testing of unsupported cipher algorithms, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 04/26] crypto: add support for anti-forensic split algorithm, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 03/26] crypto: add support for generating initialization vectors, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 07/26] crypto: add support for the serpent cipher algorithm, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 08/26] crypto: add support for the twofish cipher algorithm, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 10/26] crypto: refactor code for dealing with AES cipher, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 15/26] qemu-img/qemu-io: don't prompt for passwords if not required, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 14/26] block: add flag to indicate that no I/O will be performed, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 09/26] crypto: import an implementation of the XTS cipher mode, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 12/26] crypto: add block encryption framework, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 17/26] tests: refactor python I/O tests helper main method,
Daniel P. Berrange <=
- [Qemu-devel] [PATCH v3 11/26] crypto: wire up XTS mode for cipher APIs, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 18/26] tests: add output filter to python I/O tests helper, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 20/26] qcow2: make qcow2_encrypt_sectors encrypt in place, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 22/26] qcow: make encrypt_sectors encrypt in place, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 13/26] crypto: implement the LUKS block encryption format, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 16/26] tests: redirect stderr to stdout for iotests, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 24/26] block: rip out all traces of password prompting, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 23/26] qcow: convert QCow to use QCryptoBlock for encryption, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 25/26] block: remove all encryption handling APIs, Daniel P. Berrange, 2016/02/15
- [Qemu-devel] [PATCH v3 21/26] qcow2: convert QCow2 to use QCryptoBlock for encryption, Daniel P. Berrange, 2016/02/15