aboutsummaryrefslogtreecommitdiff
path: root/tests/acceptance/avocado_qemu
diff options
context:
space:
mode:
authorCleber Rosa <crosa@redhat.com>2019-11-04 10:13:18 -0500
committerCleber Rosa <crosa@redhat.com>2019-12-16 11:23:19 -0500
commitba21bde930f50360b135268e4e69a0ad561ddca2 (patch)
tree466a9e9766c567d09642a8eb093ce64a6cf60b31 /tests/acceptance/avocado_qemu
parentf108934fca0a5d6acfc93be6d3684574d18794e2 (diff)
downloadqemu-ba21bde930f50360b135268e4e69a0ad561ddca2.zip
qemu-ba21bde930f50360b135268e4e69a0ad561ddca2.tar.gz
qemu-ba21bde930f50360b135268e4e69a0ad561ddca2.tar.bz2
Acceptance tests: use avocado tags for machine type
The same way the arch tag is being used as a fallback for the arch parameter, let's do the same for QEMU's machine and avoid some boiler plate code. This is now possible because, since Avocado 72.0, it's possible to use tags with names that match the machine types on QEMU. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20191104151323.9883-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
Diffstat (limited to 'tests/acceptance/avocado_qemu')
-rw-r--r--tests/acceptance/avocado_qemu/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index e676d9c..6618ea6 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -115,6 +115,9 @@ class Test(avocado.Test):
self.arch = self.params.get('arch',
default=self._get_unique_tag_val('arch'))
+ self.machine = self.params.get('machine',
+ default=self._get_unique_tag_val('machine'))
+
default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
self.qemu_bin = self.params.get('qemu_bin',
default=default_qemu_bin)
@@ -136,6 +139,8 @@ class Test(avocado.Test):
name = str(uuid.uuid4())
if self._vms.get(name) is None:
self._vms[name] = self._new_vm(*args)
+ if self.machine is not None:
+ self._vms[name].set_machine(self.machine)
return self._vms[name]
def tearDown(self):