qemu-devel
[Top][All Lists]
Advanced

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

[PATCH] acpi/tests/avocado/bits: don't remove the work directory when V


From: Ani Sinha
Subject: [PATCH] acpi/tests/avocado/bits: don't remove the work directory when V is in env
Date: Thu, 17 Nov 2022 13:16:29 +0530

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 V=1 in the environment so that the iso is available for use with the
QEMU command line.

CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Ani Sinha <ani@anisinha.ca>
---
 tests/avocado/acpi-bits.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py
index 8745a58a76..7657343f2a 100644
--- a/tests/avocado/acpi-bits.py
+++ b/tests/avocado/acpi-bits.py
@@ -354,7 +354,11 @@ 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('V'):
+            shutil.rmtree(self._workDir)
+        else:
+            self.logger.info('not removing the work directory %s as V is ' \
+                             'passed in the environment', self._workDir)
         super().tearDown()
 
     def test_acpi_smbios_bits(self):
-- 
2.34.1




reply via email to

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