From: Nir Soffer <nsoffer@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-block@nongnu.org, "Daniel P. Berrangé" <berrange@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Nir Soffer" <nsoffer@redhat.com>
Subject: [PATCH v2 2/5] Support format or cache specific out file
Date: Mon, 28 Nov 2022 16:15:11 +0200 [thread overview]
Message-ID: <20221128141514.388724-3-nsoffer@redhat.com> (raw)
In-Reply-To: <20221128141514.388724-1-nsoffer@redhat.com>
Extend the test finder to find tests with format (*.out.qcow2) or cache
specific (*.out.nocache) out file. This worked before only for the
numbered tests.
---
tests/qemu-iotests/findtests.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/findtests.py b/tests/qemu-iotests/findtests.py
index dd77b453b8..f4344ce78c 100644
--- a/tests/qemu-iotests/findtests.py
+++ b/tests/qemu-iotests/findtests.py
@@ -38,31 +38,37 @@ def chdir(path: Optional[str] = None) -> Iterator[None]:
os.chdir(saved_dir)
class TestFinder:
def __init__(self, test_dir: Optional[str] = None) -> None:
self.groups = defaultdict(set)
with chdir(test_dir):
self.all_tests = glob.glob('[0-9][0-9][0-9]')
self.all_tests += [f for f in glob.iglob('tests/*')
- if not f.endswith('.out') and
- os.path.isfile(f + '.out')]
+ if self.is_test(f)]
for t in self.all_tests:
with open(t, encoding="utf-8") as f:
for line in f:
if line.startswith('# group: '):
for g in line.split()[2:]:
self.groups[g].add(t)
break
+ def is_test(self, fname: str) -> bool:
+ """
+ The tests directory contains tests (no extension) and out files
+ (*.out, *.out.{format}, *.out.{option}).
+ """
+ return re.search(r'.+\.out(\.\w+)?$', fname) is None
+
def add_group_file(self, fname: str) -> None:
with open(fname, encoding="utf-8") as f:
for line in f:
line = line.strip()
if (not line) or line[0] == '#':
continue
words = line.split()
test_file = self.parse_test_name(words[0])
--
2.38.1
next prev parent reply other threads:[~2022-11-28 14:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 14:15 [PATCH v2 0/5] Add qemu-img checksum command using blkhash Nir Soffer
2022-11-28 14:15 ` [PATCH v2 1/5] qemu-img.c: Move IO_BUF_SIZE to the top of the file Nir Soffer
2022-12-12 10:35 ` Hanna Reitz
2022-11-28 14:15 ` Nir Soffer [this message]
2022-12-12 10:38 ` [PATCH v2 2/5] Support format or cache specific out file Hanna Reitz
2022-12-13 15:56 ` Nir Soffer
2022-12-13 18:09 ` Hanna Reitz
2022-12-13 19:53 ` Nir Soffer
2022-11-28 14:15 ` [PATCH v2 3/5] qemu-img: Add checksum command Nir Soffer
2022-12-12 10:42 ` Hanna Reitz
2022-11-28 14:15 ` [PATCH v2 4/5] iotests: Test qemu-img checksum Nir Soffer
2022-12-12 10:43 ` Hanna Reitz
2022-11-28 14:15 ` [PATCH v2 5/5] qemu-img: Speed up checksum Nir Soffer
2022-12-12 10:43 ` Hanna Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221128141514.388724-3-nsoffer@redhat.com \
--to=nsoffer@redhat.com \
--cc=berrange@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).