diff mbox series

[09/15] tests/functional: put QEMUMachine logs in testcase log directory

Message ID 20241119150519.1123365-10-berrange@redhat.com (mailing list archive)
State New
Headers show
Series test/functional: improve functional test debugging & fix tuxrun | expand

Commit Message

Daniel P. Berrangé Nov. 19, 2024, 3:05 p.m. UTC
We are not passing the 'log_dir' parameter to QEMUMachine, so the
QEMU stdout/err logs are being placed in a temp directory and thus
deleted after execution. This makes them inaccessible as gitlab
CI artifacts.

Pass the testcase log directory path into QEMUMachine to make the
logs persistent.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/testcase.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Alex Bennée Nov. 19, 2024, 5:10 p.m. UTC | #1
Daniel P. Berrangé <berrange@redhat.com> writes:

> We are not passing the 'log_dir' parameter to QEMUMachine, so the
> QEMU stdout/err logs are being placed in a temp directory and thus
> deleted after execution. This makes them inaccessible as gitlab
> CI artifacts.
>
> Pass the testcase log directory path into QEMUMachine to make the
> logs persistent.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
diff mbox series

Patch

diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index b9418e2ac0..ca13af244b 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -163,10 +163,11 @@  def require_device(self, devicename):
             self.skipTest('no support for device ' + devicename)
 
     def _new_vm(self, name, *args):
-        vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir)
+        vm = QEMUMachine(self.qemu_bin,
+                         base_temp_dir=self.workdir,
+                         log_dir=self.logdir)
         self.log.debug('QEMUMachine "%s" created', name)
         self.log.debug('QEMUMachine "%s" temp_dir: %s', name, vm.temp_dir)
-        self.log.debug('QEMUMachine "%s" log_dir: %s', name, vm.log_dir)
         if args:
             vm.add_args(*args)
         return vm