aboutsummaryrefslogtreecommitdiff
path: root/tests/acceptance/x86_cpu_model_versions.py
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/x86_cpu_model_versions.py
parentf108934fca0a5d6acfc93be6d3684574d18794e2 (diff)
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/x86_cpu_model_versions.py')
-rw-r--r--tests/acceptance/x86_cpu_model_versions.py53
1 files changed, 39 insertions, 14 deletions
diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py
index 6eb977954d..90558d9a71 100644
--- a/tests/acceptance/x86_cpu_model_versions.py
+++ b/tests/acceptance/x86_cpu_model_versions.py
@@ -75,12 +75,15 @@ class X86CPUModelAliases(avocado_qemu.Test):
"EPYC-IBPB shouldn't be versioned")
def test_4_0_alias_compatibility(self):
- """Check if pc-*-4.0 unversioned CPU model won't be reported as aliases"""
+ """
+ Check if pc-*-4.0 unversioned CPU model won't be reported as aliases
+
+ :avocado: tags=machine:pc-i440fx-4.0
+ """
# pc-*-4.0 won't expose non-versioned CPU models as aliases
# We do this to help management software to keep compatibility
# with older QEMU versions that didn't have the versioned CPU model
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.0')
self.vm.launch()
cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions'))
@@ -105,9 +108,12 @@ class X86CPUModelAliases(avocado_qemu.Test):
self.assertNotIn('alias-of', c, "%s shouldn't be an alias" % (name))
def test_4_1_alias(self):
- """Check if unversioned CPU model is an alias pointing to right version"""
+ """
+ Check if unversioned CPU model is an alias pointing to right version
+
+ :avocado: tags=machine:pc-i440fx-4.1
+ """
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.1')
self.vm.launch()
cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions'))
@@ -207,9 +213,12 @@ class X86CPUModelAliases(avocado_qemu.Test):
self.validate_aliases(cpus)
def test_none_alias(self):
- """Check if unversioned CPU model is an alias pointing to some version"""
+ """
+ Check if unversioned CPU model is an alias pointing to some version
+
+ :avocado: tags=machine:none
+ """
self.vm.add_args('-S')
- self.vm.set_machine('none')
self.vm.launch()
cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions'))
@@ -242,68 +251,84 @@ class CascadelakeArchCapabilities(avocado_qemu.Test):
return self.vm.command('qom-get', path=cpu_path, property=prop)
def test_4_1(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.1
+ """
# machine-type only:
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.1')
self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off')
self.vm.launch()
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
'pc-i440fx-4.1 + Cascadelake-Server should not have arch-capabilities')
def test_4_0(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.0
+ """
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.0')
self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off')
self.vm.launch()
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server should not have arch-capabilities')
def test_set_4_0(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.0
+ """
# command line must override machine-type if CPU model is not versioned:
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.0')
self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off,+arch-capabilities')
self.vm.launch()
self.assertTrue(self.get_cpu_prop('arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server,+arch-capabilities should have arch-capabilities')
def test_unset_4_1(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.1
+ """
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.1')
self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off,-arch-capabilities')
self.vm.launch()
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
'pc-i440fx-4.1 + Cascadelake-Server,-arch-capabilities should not have arch-capabilities')
def test_v1_4_0(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.0
+ """
# versioned CPU model overrides machine-type:
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.0')
self.vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off')
self.vm.launch()
self.assertFalse(self.get_cpu_prop('arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities')
def test_v2_4_0(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.0
+ """
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.0')
self.vm.add_args('-cpu', 'Cascadelake-Server-v2,x-force-features=on,check=off,enforce=off')
self.vm.launch()
self.assertTrue(self.get_cpu_prop('arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities')
def test_v1_set_4_0(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.0
+ """
# command line must override machine-type and versioned CPU model:
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.0')
self.vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off,+arch-capabilities')
self.vm.launch()
self.assertTrue(self.get_cpu_prop('arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities')
def test_v2_unset_4_1(self):
+ """
+ :avocado: tags=machine:pc-i440fx-4.1
+ """
self.vm.add_args('-S')
- self.vm.set_machine('pc-i440fx-4.1')
self.vm.add_args('-cpu', 'Cascadelake-Server-v2,x-force-features=on,check=off,enforce=off,-arch-capabilities')
self.vm.launch()
self.assertFalse(self.get_cpu_prop('arch-capabilities'),