qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel]  [PATCH 0/3] Add acceptance test for migration
@ 2019-08-05 18:20 Balamuruhan S
  2019-08-05 18:20 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Balamuruhan S @ 2019-08-05 18:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Balamuruhan S, clg, david

Add new test for migration that bringup vm with different machine types and
migrate it, introduce new API in avocado_qemu to query all the machine
types supported by qemu.

Test run:

# avocado run migration.py
JOB ID     : ef54f57a073eb267d2347e32225f2adbe27969de
JOB LOG    : /home/bala/avocado-fvt-wrapper/results/job-2019-08-05T13.54-ef54f57/job.log
 (1/2) migration.py:Migration.test_migration_with_tcp_localhost: PASS (0.54 s)
 (2/2) migration.py:Migration.test_migration_with_machine_types: PASS (5.21 s)
RESULTS    : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 5.86 s

Currently acceptance test for migration error out as we check `query-migrate`
in target after migration which is not appropriate.

Balamuruhan S (3):
  tests/acceptance/migration: fix post migration check
  tests/acceptance/avocado_qemu: add method to get supported machine
    types
  tests/acceptance/migration: test to migrate will all machine types

 tests/acceptance/avocado_qemu/__init__.py |  6 ++++++
 tests/acceptance/migration.py             | 27 ++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

-- 
2.14.5



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

* [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check
  2019-08-05 18:20 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
@ 2019-08-05 18:20 ` Balamuruhan S
  2019-08-05 18:20 ` [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types Balamuruhan S
  2019-08-05 18:20 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all " Balamuruhan S
  2 siblings, 0 replies; 5+ messages in thread
From: Balamuruhan S @ 2019-08-05 18:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Balamuruhan S, clg, david

assert `query-migrate` in target doesn't give migration
status and test errors even if migration succeeds.

In target:
{'execute': 'query-migrate'}
{"return": {}}

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/migration.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 6115cf6c24..66941db3b3 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -47,7 +47,6 @@ class Migration(Test):
             step=0.1,
             args=(source_vm,)
         )
-        self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
         self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
         self.assertEqual(dest_vm.command('query-status')['status'], 'running')
         self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate')
-- 
2.14.5



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

* [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types
  2019-08-05 18:20 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
  2019-08-05 18:20 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
@ 2019-08-05 18:20 ` Balamuruhan S
  2019-08-05 18:20 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all " Balamuruhan S
  2 siblings, 0 replies; 5+ messages in thread
From: Balamuruhan S @ 2019-08-05 18:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Balamuruhan S, clg, david

add `get_machine_types()` to return list of supported machine types
by the qemu binary.

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index aee5d820ed..df18561e97 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -82,6 +82,12 @@ class Test(avocado.Test):
             self._vms[name] = self._new_vm(*args)
         return self._vms[name]
 
+    def get_machine_types(self):
+        cmd = "%s -machine ?" % self.qemu_bin
+        output = avocado.utils.process.getoutput(cmd).split("\n")
+        output.remove("Supported machines are:")
+        return [each.split()[0] for each in output]
+
     def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
-- 
2.14.5



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

* [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
  2019-08-05 18:20 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
  2019-08-05 18:20 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
  2019-08-05 18:20 ` [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types Balamuruhan S
@ 2019-08-05 18:20 ` Balamuruhan S
  2 siblings, 0 replies; 5+ messages in thread
From: Balamuruhan S @ 2019-08-05 18:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Balamuruhan S, clg, david

add migration test to query machine types supported by qemu binary
and migrate vm will all supported type.

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 66941db3b3..a598b54718 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -50,3 +50,29 @@ class Migration(Test):
         self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
         self.assertEqual(dest_vm.command('query-status')['status'], 'running')
         self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate')
+
+
+    def test_migration_with_machine_types(self):
+        migration_port = self._get_free_port()
+        for machine in self.get_machine_types():
+            if 'pseries' in machine:
+                print("migrating with machine type - {}".format(machine))
+                source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine))
+                dest_uri = 'tcp:localhost:%u' % migration_port
+                dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine),
+                                      '-incoming', dest_uri)
+                dest_vm.launch()
+                source_vm.launch()
+                source_vm.qmp('migrate', uri=dest_uri)
+                wait.wait_for(
+                    self.migration_finished,
+                    timeout=self.timeout,
+                    step=0.1,
+                    args=(source_vm,)
+                )
+                self.assertEqual(source_vm.command('query-migrate')['status'],
+                                                   'completed')
+                self.assertEqual(dest_vm.command('query-status')['status'],
+                                                 'running')
+                self.assertEqual(source_vm.command('query-status')['status'],
+                                                   'postmigrate')
-- 
2.14.5



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

* [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types
  2019-09-16  9:34 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
@ 2019-09-16  9:34 ` Balamuruhan S
  0 siblings, 0 replies; 5+ messages in thread
From: Balamuruhan S @ 2019-09-16  9:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, ccarrara, groug, Balamuruhan S, sathnaga, clg, crosa,
	qemu-ppc, david

add `get_machine_types()` to return list of supported machine types
by the qemu binary.

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index bd41e0443c..42a1b572bd 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -85,6 +85,12 @@ class Test(avocado.Test):
             self._vms[name] = self._new_vm(*args)
         return self._vms[name]
 
+    def get_machine_types(self):
+        cmd = "%s -machine ?" % self.qemu_bin
+        output = avocado.utils.process.getoutput(cmd).split("\n")
+        output.remove("Supported machines are:")
+        return [each.split()[0] for each in output]
+
     def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
-- 
2.14.5



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

end of thread, other threads:[~2019-09-16  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 18:20 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
2019-08-05 18:20 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
2019-08-05 18:20 ` [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types Balamuruhan S
2019-08-05 18:20 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all " Balamuruhan S
2019-09-16  9:34 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
2019-09-16  9:34 ` [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types Balamuruhan S

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