All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] Acceptance tests: cpu_queries.py improvements
@ 2019-09-11  0:42 Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 1/4] tests/acceptance/cpu_queries.py: cleanups Cleber Rosa
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Cleber Rosa @ 2019-09-11  0:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

The cpu_queries.py test is currently x86_64 specific, so this sets a
'arch' tag to make sure the correct target binary is used by default.

Also, a few minor cleanups and optimizations.

Cleber Rosa (4):
  tests/acceptance/cpu_queries.py: cleanups
  tests/acceptance/cpu_queries.py: tag test as x86_64 specific
  tests/acceptance/cpu_queries.py: add machine tag
  tests/acceptance/cpu_queries.py: minor optmizations

 tests/acceptance/cpu_queries.py | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

-- 
2.21.0



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

* [Qemu-devel] [PATCH 1/4] tests/acceptance/cpu_queries.py: cleanups
  2019-09-11  0:42 [Qemu-devel] [PATCH 0/4] Acceptance tests: cpu_queries.py improvements Cleber Rosa
@ 2019-09-11  0:42 ` Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 2/4] tests/acceptance/cpu_queries.py: tag test as x86_64 specific Cleber Rosa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Cleber Rosa @ 2019-09-11  0:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

Simple cleanups for debugging code that is not being used.

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

diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py
index e71edec39f..a9ac3d692e 100644
--- a/tests/acceptance/cpu_queries.py
+++ b/tests/acceptance/cpu_queries.py
@@ -8,8 +8,6 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
-import logging
-
 from avocado_qemu import Test
 
 class QueryCPUModelExpansion(Test):
@@ -24,7 +22,6 @@ class QueryCPUModelExpansion(Test):
 
         cpus = self.vm.command('query-cpu-definitions')
         for c in cpus:
-            print(repr(c))
             self.assertNotIn('', c['unavailable-features'], c['name'])
 
         for c in cpus:
-- 
2.21.0



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

* [Qemu-devel] [PATCH 2/4] tests/acceptance/cpu_queries.py: tag test as x86_64 specific
  2019-09-11  0:42 [Qemu-devel] [PATCH 0/4] Acceptance tests: cpu_queries.py improvements Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 1/4] tests/acceptance/cpu_queries.py: cleanups Cleber Rosa
@ 2019-09-11  0:42 ` Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 3/4] tests/acceptance/cpu_queries.py: add machine tag Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 4/4] tests/acceptance/cpu_queries.py: minor optmizations Cleber Rosa
  3 siblings, 0 replies; 5+ messages in thread
From: Cleber Rosa @ 2019-09-11  0:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

This is an usability improvement, and prevents the test from being
automatically run with some not supported targets (say on an ppc64le
or aarch64 host).

Actually, the x86_64 tagging is a little white lie, because in theory,
at least parts of the test, such as the query-cpu-model-expansion
query, should also work on s390x.  But, that is actually failing, so a
future development round will attempt to make tests run on all
possible supported targets.

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

diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py
index a9ac3d692e..1028588920 100644
--- a/tests/acceptance/cpu_queries.py
+++ b/tests/acceptance/cpu_queries.py
@@ -13,6 +13,8 @@ from avocado_qemu import Test
 class QueryCPUModelExpansion(Test):
     """
     Run query-cpu-model-expansion for each CPU model, and validate results
+
+    :avocado: tags=arch:x86_64
     """
 
     def test(self):
-- 
2.21.0



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

* [Qemu-devel] [PATCH 3/4] tests/acceptance/cpu_queries.py: add machine tag
  2019-09-11  0:42 [Qemu-devel] [PATCH 0/4] Acceptance tests: cpu_queries.py improvements Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 1/4] tests/acceptance/cpu_queries.py: cleanups Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 2/4] tests/acceptance/cpu_queries.py: tag test as x86_64 specific Cleber Rosa
@ 2019-09-11  0:42 ` Cleber Rosa
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 4/4] tests/acceptance/cpu_queries.py: minor optmizations Cleber Rosa
  3 siblings, 0 replies; 5+ messages in thread
From: Cleber Rosa @ 2019-09-11  0:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

This is for informational / filtering purposes only, that is, allows
one to run all tests with machine model "none".

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

diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py
index 1028588920..9cd6f553ff 100644
--- a/tests/acceptance/cpu_queries.py
+++ b/tests/acceptance/cpu_queries.py
@@ -15,6 +15,7 @@ class QueryCPUModelExpansion(Test):
     Run query-cpu-model-expansion for each CPU model, and validate results
 
     :avocado: tags=arch:x86_64
+    :avocado: tags=machine:none
     """
 
     def test(self):
-- 
2.21.0



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

* [Qemu-devel] [PATCH 4/4] tests/acceptance/cpu_queries.py: minor optmizations
  2019-09-11  0:42 [Qemu-devel] [PATCH 0/4] Acceptance tests: cpu_queries.py improvements Cleber Rosa
                   ` (2 preceding siblings ...)
  2019-09-11  0:42 ` [Qemu-devel] [PATCH 3/4] tests/acceptance/cpu_queries.py: add machine tag Cleber Rosa
@ 2019-09-11  0:42 ` Cleber Rosa
  3 siblings, 0 replies; 5+ messages in thread
From: Cleber Rosa @ 2019-09-11  0:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: Willian Rampazzo, Philippe Mathieu-Daudé,
	Eduardo Habkost, Wainer dos Santos Moschetta, Cleber Rosa

This avoids the second loop over the cpus, and reuses some of the
variables.

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

diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py
index 9cd6f553ff..54aa310fb8 100644
--- a/tests/acceptance/cpu_queries.py
+++ b/tests/acceptance/cpu_queries.py
@@ -25,9 +25,8 @@ class QueryCPUModelExpansion(Test):
 
         cpus = self.vm.command('query-cpu-definitions')
         for c in cpus:
-            self.assertNotIn('', c['unavailable-features'], c['name'])
-
-        for c in cpus:
-            model = {'name': c['name']}
-            e = self.vm.command('query-cpu-model-expansion', model=model, type='full')
-            self.assertEquals(e['model']['name'], c['name'])
+            model_name = c['name']
+            self.assertNotIn('', c['unavailable-features'], model_name)
+            e = self.vm.command('query-cpu-model-expansion',
+                                model={'name': model_name}, type='full')
+            self.assertEquals(e['model']['name'], model_name)
-- 
2.21.0



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

end of thread, other threads:[~2019-09-11  0:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  0:42 [Qemu-devel] [PATCH 0/4] Acceptance tests: cpu_queries.py improvements Cleber Rosa
2019-09-11  0:42 ` [Qemu-devel] [PATCH 1/4] tests/acceptance/cpu_queries.py: cleanups Cleber Rosa
2019-09-11  0:42 ` [Qemu-devel] [PATCH 2/4] tests/acceptance/cpu_queries.py: tag test as x86_64 specific Cleber Rosa
2019-09-11  0:42 ` [Qemu-devel] [PATCH 3/4] tests/acceptance/cpu_queries.py: add machine tag Cleber Rosa
2019-09-11  0:42 ` [Qemu-devel] [PATCH 4/4] tests/acceptance/cpu_queries.py: minor optmizations Cleber Rosa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.