[PULL 49/51] iotests: log messages from notrun()

Kevin Wolf posted 51 patches 4 years, 11 months ago
Maintainers: Stefan Weil <sw@weilnetz.de>, Stefan Hajnoczi <stefanha@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>, John Snow <jsnow@redhat.com>, Wen Congyang <wencongyang2@huawei.com>, "Denis V. Lunev" <den@openvz.org>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Jeff Cody <codyprime@gmail.com>, Alberto Garcia <berto@igalia.com>, Max Reitz <mreitz@redhat.com>, Ari Sundholm <ari@tuxera.com>, Xie Changlong <xiechanglong.d@gmail.com>
There is a newer version of this series
[PULL 49/51] iotests: log messages from notrun()
Posted by Kevin Wolf 4 years, 11 months ago
From: John Snow <jsnow@redhat.com>

Shift the logging initialization up to occur prior to validation checks,
so that notrun() messages still get printed to console.

(Also, remove the "debugging messages active" message, because we don't
need to see that hundreds of times per iotest suite run.)

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20200514201614.19941-2-jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/iotests.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1d7f6fd7cf..f20d90f969 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1168,18 +1168,17 @@ 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)
 
+    debug = '-d' in sys.argv
+    if debug:
+        sys.argv.remove('-d')
+    logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))
+
     _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:
-        sys.argv.remove('-d')
-    logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))
-    logger.debug("iotests debugging messages active")
-
     return debug
 
 def execute_test(*args, test_function=None, **kwargs):
-- 
2.25.4