[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/24] iotests: Mark verify functions as private
From: |
Max Reitz |
Subject: |
[PULL 13/24] iotests: Mark verify functions as private |
Date: |
Tue, 5 May 2020 14:58:15 +0200 |
From: John Snow <address@hidden>
Mark the verify functions as "private" with a leading underscore, to
discourage their use. Update type signatures while we're here.
(Also, make pending patches not yet using the new entry points fail in a
very obvious way.)
Signed-off-by: John Snow <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/iotests.py | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 9f85e1fba3..35d8cae997 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1006,7 +1006,8 @@ def case_notrun(reason):
open('%s/%s.casenotrun' % (output_dir, seq), 'a').write(
' [case not run] ' + reason + '\n')
-def verify_image_format(supported_fmts=(), unsupported_fmts=()):
+def _verify_image_format(supported_fmts: Sequence[str] = (),
+ unsupported_fmts: Sequence[str] = ()) -> None:
assert not (supported_fmts and unsupported_fmts)
if 'generic' in supported_fmts and \
@@ -1020,7 +1021,8 @@ def verify_image_format(supported_fmts=(),
unsupported_fmts=()):
if not_sup or (imgfmt in unsupported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
-def verify_protocol(supported=(), unsupported=()):
+def _verify_protocol(supported: Sequence[str] = (),
+ unsupported: Sequence[str] = ()) -> None:
assert not (supported and unsupported)
if 'generic' in supported:
@@ -1030,7 +1032,8 @@ def verify_protocol(supported=(), unsupported=()):
if not_sup or (imgproto in unsupported):
notrun('not suitable for this protocol: %s' % imgproto)
-def verify_platform(supported=(), unsupported=()):
+def _verify_platform(supported: Sequence[str] = (),
+ unsupported: Sequence[str] = ()) -> None:
if any((sys.platform.startswith(x) for x in unsupported)):
notrun('not suitable for this OS: %s' % sys.platform)
@@ -1038,11 +1041,11 @@ def verify_platform(supported=(), unsupported=()):
if not any((sys.platform.startswith(x) for x in supported)):
notrun('not suitable for this OS: %s' % sys.platform)
-def verify_cache_mode(supported_cache_modes=()):
+def _verify_cache_mode(supported_cache_modes: Sequence[str] = ()) -> None:
if supported_cache_modes and (cachemode not in supported_cache_modes):
notrun('not suitable for this cache mode: %s' % cachemode)
-def verify_aio_mode(supported_aio_modes=()):
+def _verify_aio_mode(supported_aio_modes: Sequence[str] = ()):
if supported_aio_modes and (aiomode not in supported_aio_modes):
notrun('not suitable for this aio mode: %s' % aiomode)
@@ -1170,11 +1173,11 @@ def execute_setup_common(supported_fmts: Sequence[str]
= (),
sys.stderr.write('Please run this test via the "check" script\n')
sys.exit(os.EX_USAGE)
- verify_image_format(supported_fmts, unsupported_fmts)
- verify_protocol(supported_protocols, unsupported_protocols)
- verify_platform(supported=supported_platforms)
- verify_cache_mode(supported_cache_modes)
- verify_aio_mode(supported_aio_modes)
+ _verify_image_format(supported_fmts, unsupported_fmts)
+ _verify_protocol(supported_protocols, unsupported_protocols)
+ _verify_platform(supported=supported_platforms)
+ _verify_cache_mode(supported_cache_modes)
+ _verify_aio_mode(supported_aio_modes)
debug = '-d' in sys.argv
if debug:
--
2.26.2
- [PULL 02/24] iotests: don't use 'format' for drive_add, (continued)
- [PULL 02/24] iotests: don't use 'format' for drive_add, Max Reitz, 2020/05/05
- [PULL 04/24] iotests: replace mutable list default args, Max Reitz, 2020/05/05
- [PULL 06/24] iotests: alphabetize standard imports, Max Reitz, 2020/05/05
- [PULL 05/24] iotests: add pylintrc file, Max Reitz, 2020/05/05
- [PULL 07/24] iotests: drop pre-Python 3.4 compatibility code, Max Reitz, 2020/05/05
- [PULL 01/24] iotests: do a light delinting, Max Reitz, 2020/05/05
- [PULL 08/24] iotests: touch up log function signature, Max Reitz, 2020/05/05
- [PULL 10/24] iotests: add hmp helper with logging, Max Reitz, 2020/05/05
- [PULL 12/24] iotest 258: use script_main, Max Reitz, 2020/05/05
- [PULL 11/24] iotests: add script_initialize, Max Reitz, 2020/05/05
- [PULL 13/24] iotests: Mark verify functions as private,
Max Reitz <=
- [PULL 09/24] iotests: limit line length to 79 chars, Max Reitz, 2020/05/05
- [PULL 18/24] block: Comment cleanups, Max Reitz, 2020/05/05
- [PULL 14/24] iotests: use python logging for iotests.log(), Max Reitz, 2020/05/05
- [PULL 19/24] Fix iotest 153, Max Reitz, 2020/05/05
- [PULL 17/24] qcow2: Tweak comment about bitmaps vs. resize, Max Reitz, 2020/05/05
- [PULL 21/24] block/block-copy: alloc task on each iteration, Max Reitz, 2020/05/05
- [PULL 16/24] qcow2: Allow resize of images with internal snapshots, Max Reitz, 2020/05/05
- [PULL 20/24] block/block-copy: rename in-flight requests to tasks, Max Reitz, 2020/05/05
- [PULL 22/24] block/block-copy: add state pointer to BlockCopyTask, Max Reitz, 2020/05/05
- [PULL 15/24] block: Add blk_new_with_bs() helper, Max Reitz, 2020/05/05