From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Ani Sinha" <ani@anisinha.ca>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Beraldo Leal" <bleal@redhat.com>
Subject: [PULL 7/8] acpi/tests/avocado/bits: keep the work directory when BITS_DEBUG is set in env
Date: Tue, 22 Nov 2022 05:23:42 -0500 [thread overview]
Message-ID: <20221122102227.6603-8-mst@redhat.com> (raw)
In-Reply-To: <20221122102227.6603-1-mst@redhat.com>
From: Ani Sinha <ani@anisinha.ca>
Debugging bits issue often involves running the QEMU command line manually
outside of the avocado environment with the generated ISO. Hence, its
inconvenient if the iso gets cleaned up after the test has finished. This change
makes sure that the work directory is kept after the test finishes if the test
is run with BITS_DEBUG=1 in the environment so that the iso is available for use
with the QEMU command line.
CC: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Ani Sinha <ani@anisinha.ca>
Message-Id: <20221117113630.543495-1-ani@anisinha.ca>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/avocado/acpi-bits.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py
index ac13e22dc9..4be663968c 100644
--- a/tests/avocado/acpi-bits.py
+++ b/tests/avocado/acpi-bits.py
@@ -260,7 +260,7 @@ def generate_bits_iso(self):
self.logger.info('using grub-mkrescue for generating biosbits iso ...')
try:
- if os.getenv('V'):
+ if os.getenv('V') or os.getenv('BITS_DEBUG'):
subprocess.check_call([mkrescue_script, '-o', iso_file,
bits_dir], stderr=subprocess.STDOUT)
else:
@@ -344,7 +344,7 @@ def parse_log(self):
self._print_log(log)
raise e
else:
- if os.getenv('V'):
+ if os.getenv('V') or os.getenv('BITS_DEBUG'):
self._print_log(log)
def tearDown(self):
@@ -353,8 +353,13 @@ def tearDown(self):
"""
if self._vm:
self.assertFalse(not self._vm.is_running)
- self.logger.info('removing the work directory %s', self._workDir)
- shutil.rmtree(self._workDir)
+ if not os.getenv('BITS_DEBUG'):
+ self.logger.info('removing the work directory %s', self._workDir)
+ shutil.rmtree(self._workDir)
+ else:
+ self.logger.info('not removing the work directory %s ' \
+ 'as BITS_DEBUG is ' \
+ 'passed in the environment', self._workDir)
super().tearDown()
def test_acpi_smbios_bits(self):
--
MST
next prev parent reply other threads:[~2022-11-22 10:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 10:23 [PULL 0/8] pc,virtio: regression, test fixes Michael S. Tsirkin
2022-11-22 10:23 ` [PULL 1/8] vhost: mask VIRTIO_F_RING_RESET for vhost and vhost-user devices Michael S. Tsirkin
2022-11-22 10:23 ` [PULL 2/8] tests: acpi: whitelist DSDT before moving PRQx to _SB scope Michael S. Tsirkin
2022-11-22 10:23 ` [PULL 3/8] acpi: x86: move RPQx field back " Michael S. Tsirkin
2022-11-22 10:23 ` [PULL 4/8] tests: acpi: x86: update expected DSDT after moving PRQx fields in " Michael S. Tsirkin
2022-11-22 10:23 ` [PULL 5/8] MAINTAINERS: add mst to list of biosbits maintainers Michael S. Tsirkin
2022-11-22 10:23 ` [PULL 6/8] tests/avocado: configure acpi-bits to use avocado timeout Michael S. Tsirkin
2022-11-22 10:23 ` Michael S. Tsirkin [this message]
2022-11-22 10:23 ` [PULL 8/8] virtio: disable error for out of spec queue-enable Michael S. Tsirkin
2022-11-22 17:09 ` [PULL 0/8] pc,virtio: regression, test fixes Stefan Hajnoczi
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=20221122102227.6603-8-mst@redhat.com \
--to=mst@redhat.com \
--cc=ani@anisinha.ca \
--cc=berrange@redhat.com \
--cc=bleal@redhat.com \
--cc=crosa@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@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).