[PATCH 10/15] tests/functional: honour requested test VM name in QEMUMachine

Daniel P. Berrangé posted 15 patches 4 days, 2 hours ago
There is a newer version of this series
[PATCH 10/15] tests/functional: honour requested test VM name in QEMUMachine
Posted by Daniel P. Berrangé 4 days, 2 hours ago
The functional test case class is going to the trouble of passing
around a machine name, but then fails to give this QEMUMachine. As
a result, QEMUMachine will create a completely random name. Since
log file names match the machine name, this results in log files
accumulating over time.

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

diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index ca13af244b..f9c9de1166 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -164,6 +164,7 @@ def require_device(self, devicename):
 
     def _new_vm(self, name, *args):
         vm = QEMUMachine(self.qemu_bin,
+                         name=name,
                          base_temp_dir=self.workdir,
                          log_dir=self.logdir)
         self.log.debug('QEMUMachine "%s" created', name)
-- 
2.46.0


Re: [PATCH 10/15] tests/functional: honour requested test VM name in QEMUMachine
Posted by Thomas Huth 3 days, 23 hours ago
On 19/11/2024 16.05, Daniel P. Berrangé wrote:
> The functional test case class is going to the trouble of passing
> around a machine name, but then fails to give this QEMUMachine. As
> a result, QEMUMachine will create a completely random name. Since
> log file names match the machine name, this results in log files
> accumulating over time.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/functional/qemu_test/testcase.py | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
> index ca13af244b..f9c9de1166 100644
> --- a/tests/functional/qemu_test/testcase.py
> +++ b/tests/functional/qemu_test/testcase.py
> @@ -164,6 +164,7 @@ def require_device(self, devicename):
>   
>       def _new_vm(self, name, *args):
>           vm = QEMUMachine(self.qemu_bin,
> +                         name=name,
>                            base_temp_dir=self.workdir,
>                            log_dir=self.logdir)
>           self.log.debug('QEMUMachine "%s" created', name)

Reviewed-by: Thomas Huth <thuth@redhat.com>