aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCleber Rosa <crosa@redhat.com>2019-08-28 15:36:28 -0400
committerCleber Rosa <crosa@redhat.com>2019-09-20 17:03:52 -0400
commit7219c2e842019222792d4070808108e78142da7f (patch)
tree9ee8a4dad0194a062019c2c67b0b12a4f1c5e410
parentd0b63087ce97da2f9b69e9c07daefc57fd99e83e (diff)
Acceptance test x86_cpu_model_versions: split into smaller tests
The justifications being automatic destruction of the vm instances when no longer needed and more compact test naming under a common class. Besides those, a smaller test makes the one and only assertion rather obvious, which suggests that we could even get rid of the more verbose (and manual) error messages (to be decided). Naming of the tests tries to follow the following pattern: test_($cpu_version)_($no_arch_capabitilies_set_or_unset)_($machine_version) The presence of each naming component is optional, depending on whether the test manually sets it or not. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190828193628.7687-4-crosa@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--tests/acceptance/x86_cpu_model_versions.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py
index 220d18f68d..5fc9ca4bc6 100644
--- a/tests/acceptance/x86_cpu_model_versions.py
+++ b/tests/acceptance/x86_cpu_model_versions.py
@@ -234,7 +234,14 @@ class X86CPUModelAliases(avocado_qemu.Test):
self.validate_aliases(cpus)
- def test_Cascadelake_arch_capabilities_result(self):
+
+class CascadelakeArchCapabilities(avocado_qemu.Test):
+ """
+ Validation of Cascadelake arch-capabilities
+
+ :avocado: tags=arch:x86_64
+ """
+ def test_4_1(self):
# machine-type only:
vm = self.get_vm()
vm.add_args('-S')
@@ -243,8 +250,8 @@ class X86CPUModelAliases(avocado_qemu.Test):
vm.launch()
self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'),
'pc-i440fx-4.1 + Cascadelake-Server should not have arch-capabilities')
- vm.shutdown()
+ def test_4_0(self):
vm = self.get_vm()
vm.add_args('-S')
vm.set_machine('pc-i440fx-4.0')
@@ -252,8 +259,8 @@ class X86CPUModelAliases(avocado_qemu.Test):
vm.launch()
self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server should not have arch-capabilities')
- vm.shutdown()
+ def test_set_4_0(self):
# command line must override machine-type if CPU model is not versioned:
vm = self.get_vm()
vm.add_args('-S')
@@ -262,8 +269,8 @@ class X86CPUModelAliases(avocado_qemu.Test):
vm.launch()
self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server,+arch-capabilities should have arch-capabilities')
- vm.shutdown()
+ def test_unset_4_1(self):
vm = self.get_vm()
vm.add_args('-S')
vm.set_machine('pc-i440fx-4.1')
@@ -271,8 +278,8 @@ class X86CPUModelAliases(avocado_qemu.Test):
vm.launch()
self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'),
'pc-i440fx-4.1 + Cascadelake-Server,-arch-capabilities should not have arch-capabilities')
- vm.shutdown()
+ def test_v1_4_0(self):
# versioned CPU model overrides machine-type:
vm = self.get_vm()
vm.add_args('-S')
@@ -281,8 +288,8 @@ class X86CPUModelAliases(avocado_qemu.Test):
vm.launch()
self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities')
- vm.shutdown()
+ def test_v2_4_0(self):
vm = self.get_vm()
vm.add_args('-S')
vm.set_machine('pc-i440fx-4.0')
@@ -290,8 +297,8 @@ class X86CPUModelAliases(avocado_qemu.Test):
vm.launch()
self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities')
- vm.shutdown()
+ def test_v1_set_4_0(self):
# command line must override machine-type and versioned CPU model:
vm = self.get_vm()
vm.add_args('-S')
@@ -300,8 +307,8 @@ class X86CPUModelAliases(avocado_qemu.Test):
vm.launch()
self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'),
'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities')
- vm.shutdown()
+ def test_v2_unset_4_1(self):
vm = self.get_vm()
vm.add_args('-S')
vm.set_machine('pc-i440fx-4.1')