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 <m...@redhat.com> Signed-off-by: Ani Sinha <a...@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