[Top][All Lists]

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

Re: [PATCH 2/5] iotests: allow test discovery before building

From: Thomas Huth
Subject: Re: [PATCH 2/5] iotests: allow test discovery before building
Date: Fri, 3 Mar 2023 09:14:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 02/03/2023 19.46, Daniel P. Berrangé wrote:
The 'check' script can be invoked in "dry run" mode, in which case it
merely does test discovery and prints out all their names. Despite only
doing test discovery it still validates that the various QEMU binaries
can be found. This makes it impossible todo test discovery prior to
building QEMU. This is a desirable feature to support, because it will
let meson discover tests.

Fortunately the code in the TestEnv constructor is ordered in a way
that makes this fairly trivial to achieve. We can just short circuit
the constructor after the basic directory paths have been set.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
  tests/qemu-iotests/check      | 1 +
  tests/qemu-iotests/testenv.py | 5 +++++
  2 files changed, 6 insertions(+)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 806abc21d6..7e287a79a3 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -129,6 +129,7 @@ if __name__ == '__main__':
                    imgopts=args.imgopts, misalign=args.misalign,
                    debug=args.debug, valgrind=args.valgrind,
                    gdb=args.gdb, qprint=args.print,
+                  dry_run=args.dry_run,
diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
index 9bf37cd381..952efa0e63 100644
--- a/tests/qemu-iotests/testenv.py
+++ b/tests/qemu-iotests/testenv.py
@@ -178,6 +178,7 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode: str,
                   valgrind: bool = False,
                   gdb: bool = False,
                   qprint: bool = False,
+                 dry_run: bool = False,
                   source_dir: Optional[str] = None,
                   build_dir: Optional[str] = None) -> None:
          self.imgfmt = imgfmt
@@ -232,6 +233,10 @@ def __init__(self, imgfmt: str, imgproto: str, aiomode: 
          self.build_root = os.path.join(self.build_iotests, '..', '..')
+        if dry_run:
+            return
self.malloc_perturb_ = os.getenv('MALLOC_PERTURB_',

This gives me a feeling of Deja-Vu:


... to bad that I never got that merged ;-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

reply via email to

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