qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements
@ 2019-08-28 19:36 Cleber Rosa
  2019-08-28 19:36 ` [Qemu-devel] [PATCH 1/3] Acceptance test x86_cpu_model_versions: shutdown VMs Cleber Rosa
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Cleber Rosa @ 2019-08-28 19:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

This corrects some of the messages given on failures (aligning them to
the test code), and splits a larger test into smaller and more
manageable pieces.

Cleber Rosa (3):
  Acceptance test x86_cpu_model_versions: shutdown VMs
  Acceptance test x86_cpu_model_versions: fix mismatches between test
    and messages
  Acceptance test x86_cpu_model_versions: split into smaller tests

 tests/acceptance/x86_cpu_model_versions.py | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

-- 
2.21.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 1/3] Acceptance test x86_cpu_model_versions: shutdown VMs
  2019-08-28 19:36 [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements Cleber Rosa
@ 2019-08-28 19:36 ` Cleber Rosa
  2019-08-28 19:36 ` [Qemu-devel] [PATCH 2/3] Acceptance test x86_cpu_model_versions: fix mismatches between test and messages Cleber Rosa
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Cleber Rosa @ 2019-08-28 19:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

This shuts down the VMs that won't be used any longer during the
remainder of the test.

It's debatable if the very last one should also be shutdown manually,
and my opinion is that it shouldn't because that's taken care by the
immediately following tearDown().

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/x86_cpu_model_versions.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py
index 1c9fd6a56e..e6c76b0d4c 100644
--- a/tests/acceptance/x86_cpu_model_versions.py
+++ b/tests/acceptance/x86_cpu_model_versions.py
@@ -243,6 +243,7 @@ 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()
 
         vm = self.get_vm()
         vm.add_args('-S')
@@ -251,6 +252,7 @@ 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()
 
         # command line must override machine-type if CPU model is not versioned:
         vm = self.get_vm()
@@ -260,6 +262,7 @@ 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()
 
         vm = self.get_vm()
         vm.add_args('-S')
@@ -268,6 +271,7 @@ 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()
 
         # versioned CPU model overrides machine-type:
         vm = self.get_vm()
@@ -277,6 +281,7 @@ class X86CPUModelAliases(avocado_qemu.Test):
         vm.launch()
         self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'),
                          'pc-i440fx-4.1 + Cascadelake-Server-v1 should not have arch-capabilities')
+        vm.shutdown()
 
         vm = self.get_vm()
         vm.add_args('-S')
@@ -285,6 +290,7 @@ class X86CPUModelAliases(avocado_qemu.Test):
         vm.launch()
         self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'),
                          'pc-i440fx-4.1 + Cascadelake-Server-v1 should have arch-capabilities')
+        vm.shutdown()
 
         # command line must override machine-type and versioned CPU model:
         vm = self.get_vm()
@@ -294,6 +300,7 @@ 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()
 
         vm = self.get_vm()
         vm.add_args('-S')
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 2/3] Acceptance test x86_cpu_model_versions: fix mismatches between test and messages
  2019-08-28 19:36 [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements Cleber Rosa
  2019-08-28 19:36 ` [Qemu-devel] [PATCH 1/3] Acceptance test x86_cpu_model_versions: shutdown VMs Cleber Rosa
@ 2019-08-28 19:36 ` Cleber Rosa
  2019-08-28 19:36 ` [Qemu-devel] [PATCH 3/3] Acceptance test x86_cpu_model_versions: split into smaller tests Cleber Rosa
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Cleber Rosa @ 2019-08-28 19:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

This fixes a few mismatches between the test and the error messages
produced in case of failures.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/x86_cpu_model_versions.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py
index e6c76b0d4c..220d18f68d 100644
--- a/tests/acceptance/x86_cpu_model_versions.py
+++ b/tests/acceptance/x86_cpu_model_versions.py
@@ -280,7 +280,7 @@ class X86CPUModelAliases(avocado_qemu.Test):
         vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off')
         vm.launch()
         self.assertFalse(get_cpu_prop(vm, 'arch-capabilities'),
-                         'pc-i440fx-4.1 + Cascadelake-Server-v1 should not have arch-capabilities')
+                         'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities')
         vm.shutdown()
 
         vm = self.get_vm()
@@ -289,14 +289,14 @@ class X86CPUModelAliases(avocado_qemu.Test):
         vm.add_args('-cpu', 'Cascadelake-Server-v2,x-force-features=on,check=off,enforce=off')
         vm.launch()
         self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'),
-                         'pc-i440fx-4.1 + Cascadelake-Server-v1 should have arch-capabilities')
+                         'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities')
         vm.shutdown()
 
         # command line must override machine-type and versioned CPU model:
         vm = self.get_vm()
         vm.add_args('-S')
         vm.set_machine('pc-i440fx-4.0')
-        vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off,+arch-capabilities')
+        vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off,+arch-capabilities')
         vm.launch()
         self.assertTrue(get_cpu_prop(vm, 'arch-capabilities'),
                          'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities')
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 3/3] Acceptance test x86_cpu_model_versions: split into smaller tests
  2019-08-28 19:36 [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements Cleber Rosa
  2019-08-28 19:36 ` [Qemu-devel] [PATCH 1/3] Acceptance test x86_cpu_model_versions: shutdown VMs Cleber Rosa
  2019-08-28 19:36 ` [Qemu-devel] [PATCH 2/3] Acceptance test x86_cpu_model_versions: fix mismatches between test and messages Cleber Rosa
@ 2019-08-28 19:36 ` Cleber Rosa
  2019-08-28 20:56 ` [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements no-reply
  2019-08-29 17:26 ` Eduardo Habkost
  4 siblings, 0 replies; 6+ messages in thread
From: Cleber Rosa @ 2019-08-28 19:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

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>
---
 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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements
  2019-08-28 19:36 [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements Cleber Rosa
                   ` (2 preceding siblings ...)
  2019-08-28 19:36 ` [Qemu-devel] [PATCH 3/3] Acceptance test x86_cpu_model_versions: split into smaller tests Cleber Rosa
@ 2019-08-28 20:56 ` no-reply
  2019-08-29 17:26 ` Eduardo Habkost
  4 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2019-08-28 20:56 UTC (permalink / raw)
  To: crosa; +Cc: ehabkost, qemu-devel, wainersm, wrampazz, crosa, philmd

Patchew URL: https://patchew.org/QEMU/20190828193628.7687-1-crosa@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements
Message-id: 20190828193628.7687-1-crosa@redhat.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
2a57147 Acceptance test x86_cpu_model_versions: split into smaller tests
30c6782 Acceptance test x86_cpu_model_versions: fix mismatches between test and messages
f63b60f Acceptance test x86_cpu_model_versions: shutdown VMs

=== OUTPUT BEGIN ===
1/3 Checking commit f63b60f49e7a (Acceptance test x86_cpu_model_versions: shutdown VMs)
2/3 Checking commit 30c678277001 (Acceptance test x86_cpu_model_versions: fix mismatches between test and messages)
ERROR: line over 90 characters
#22: FILE: tests/acceptance/x86_cpu_model_versions.py:283:
+                         'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities')

ERROR: line over 90 characters
#31: FILE: tests/acceptance/x86_cpu_model_versions.py:292:
+                         'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities')

ERROR: line over 90 characters
#39: FILE: tests/acceptance/x86_cpu_model_versions.py:299:
+        vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off,+arch-capabilities')

total: 3 errors, 0 warnings, 24 lines checked

Patch 2/3 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

3/3 Checking commit 2a57147a862b (Acceptance test x86_cpu_model_versions: split into smaller tests)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190828193628.7687-1-crosa@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements
  2019-08-28 19:36 [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements Cleber Rosa
                   ` (3 preceding siblings ...)
  2019-08-28 20:56 ` [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements no-reply
@ 2019-08-29 17:26 ` Eduardo Habkost
  4 siblings, 0 replies; 6+ messages in thread
From: Eduardo Habkost @ 2019-08-29 17:26 UTC (permalink / raw)
  To: Cleber Rosa
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	qemu-devel, Wainer dos Santos Moschetta

On Wed, Aug 28, 2019 at 03:36:25PM -0400, Cleber Rosa wrote:
> This corrects some of the messages given on failures (aligning them to
> the test code), and splits a larger test into smaller and more
> manageable pieces.

Thanks!

I'm queueing this on python-next.

-- 
Eduardo


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-29 17:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 19:36 [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements Cleber Rosa
2019-08-28 19:36 ` [Qemu-devel] [PATCH 1/3] Acceptance test x86_cpu_model_versions: shutdown VMs Cleber Rosa
2019-08-28 19:36 ` [Qemu-devel] [PATCH 2/3] Acceptance test x86_cpu_model_versions: fix mismatches between test and messages Cleber Rosa
2019-08-28 19:36 ` [Qemu-devel] [PATCH 3/3] Acceptance test x86_cpu_model_versions: split into smaller tests Cleber Rosa
2019-08-28 20:56 ` [Qemu-devel] [PATCH 0/3] Acceptance test x86_cpu_model_versions: fixes and minor improvements no-reply
2019-08-29 17:26 ` Eduardo Habkost

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).