Skip to content

Commit

Permalink
tests/avocado: Allow overwrite smp and memory size command line options
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ahmedaabouzied authored and huth committed Apr 20, 2022
1 parent 0ca7036 commit 41663be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/avocado/avocado_qemu/__init__.py
Expand Up @@ -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(
Expand Down Expand Up @@ -546,8 +548,8 @@ def _set_distro(self):
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)
Expand Down

0 comments on commit 41663be

Please sign in to comment.