From: Cleber Rosa <crosa@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>
Cc: "Fam Zheng" <fam@euphon.net>,
"Aleksandar Rikalo" <arikalo@wavecomp.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Willian Rampazzo" <wrampazz@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PULL 4/7] Acceptance test x86_cpu_model_versions: split into smaller tests
Date: Mon, 23 Sep 2019 09:40:16 -0400 [thread overview]
Message-ID: <20190923134019.8548-5-crosa@redhat.com> (raw)
In-Reply-To: <20190923134019.8548-1-crosa@redhat.com>
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>
---
tests/acceptance/x86_cpu_model_versions.py | 23 ++++++++++++++--------
1 file 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')
--
2.21.0
next prev parent reply other threads:[~2019-09-23 13:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 13:40 [PULL 0/7] Python (acceptance tests) queue - 2019-09-23 Cleber Rosa
2019-09-23 13:40 ` [PULL 1/7] Acceptance test machine_m68k_nextcube.py: relax the error code pattern Cleber Rosa
2019-09-23 13:40 ` [PULL 2/7] Acceptance test x86_cpu_model_versions: shutdown VMs Cleber Rosa
2019-09-23 13:40 ` [PULL 3/7] Acceptance test x86_cpu_model_versions: fix mismatches between test and messages Cleber Rosa
2019-09-23 13:40 ` Cleber Rosa [this message]
2019-09-23 13:40 ` [PULL 5/7] tests/acceptance: Refactor and improve reporting in linux_ssh_mips_malta.py Cleber Rosa
2019-09-23 13:40 ` [PULL 6/7] tests/acceptance: Add new test cases " Cleber Rosa
2019-09-23 13:40 ` [PULL 7/7] Acceptance tests: use avocado.utils.ssh for SSH interaction Cleber Rosa
2019-09-23 19:54 ` [PULL 0/7] Python (acceptance tests) queue - 2019-09-23 no-reply
2019-09-24 1:26 ` no-reply
2019-09-24 8:10 ` no-reply
2019-09-24 12:49 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190923134019.8548-5-crosa@redhat.com \
--to=crosa@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=arikalo@wavecomp.com \
--cc=aurelien@aurel32.net \
--cc=ehabkost@redhat.com \
--cc=fam@euphon.net \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@redhat.com \
--cc=wrampazz@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).