summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAhmed Abouzied <email@aabouzied.com>2021-08-03 00:22:57 +0200
committerThomas Huth <thuth@redhat.com>2022-04-20 09:44:29 +0200
commit41663beda53c517fd442648e4b62c9dada8bff9b (patch)
tree2c420ef276efe53853945f482bbd88da9192fffd
parent0ca703662e3fd2f36a9bc36ffb256562ffb7b930 (diff)
downloadfocaccia-qemu-41663beda53c517fd442648e4b62c9dada8bff9b.tar.gz
focaccia-qemu-41663beda53c517fd442648e4b62c9dada8bff9b.zip
tests/avocado: Allow overwrite smp and memory size command line options
Removes the hard-coded values in setUp(). Class inheriting from
avocado_qemu.LinuxTest can overwrite the default smp and memory instead.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/453
Signed-off-by: Ahmed Abouzied <email@aabouzied.com>
Message-Id: <20210802222257.50946-1-email@aabouzied.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/avocado/avocado_qemu/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py
index ac85e36a4d..39f15c1d51 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -516,6 +516,8 @@ class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
     distro = None
     username = 'root'
     password = 'password'
+    smp = '2'
+    memory = '1024'
 
     def _set_distro(self):
         distro_name = self.params.get(
@@ -546,8 +548,8 @@ class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
     def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'):
         super().setUp()
         self._set_distro()
-        self.vm.add_args('-smp', '2')
-        self.vm.add_args('-m', '1024')
+        self.vm.add_args('-smp', self.smp)
+        self.vm.add_args('-m', self.memory)
         # The following network device allows for SSH connections
         self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22',
                          '-device', '%s,netdev=vnet' % network_device_type)