* [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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
2019-09-17 9:44 ` Dr. David Alan Gilbert
@ 2019-09-18 0:46 ` David Gibson
0 siblings, 0 replies; 9+ messages in thread
From: David Gibson @ 2019-09-18 0:46 UTC (permalink / raw)
To: Dr. David Alan Gilbert
Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc,
Balamuruhan S
[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]
On Tue, Sep 17, 2019 at 10:44:25AM +0100, Dr. David Alan Gilbert wrote:
> * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote:
> > > * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > > > 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>
> > >
> > > Depending on the architecture you might find that some machine types
> > > aren't migratable while some are.
> >
> > Thanks Dave, is there a way to query/check whether a machine type on the
> > architecture is migratable or should we try migrating and handle exception
> > on failure ?
>
> I don't know a way to detect it; you can add -only-migratable to get
> qemu to fai early if a device is declared as being non-migratable; but
> that still doesn't say that all the devices have actually been tested
> migrating.
At present we kind of have an informal distinction between those
machine types that are mature and maintained enough to support
migration (which I think is just pc, q35, pseries and arm virt) and
those which aren't.
There isn't, as far as I know, a way to detect this.
I know we've mentioned at least briefly the idea of formalizing this
distinction at qemu summit, but I don't think the discussion went
anywhere.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
2019-09-17 8:45 ` Balamuruhan S
@ 2019-09-17 9:44 ` Dr. David Alan Gilbert
2019-09-18 0:46 ` David Gibson
0 siblings, 1 reply; 9+ messages in thread
From: Dr. David Alan Gilbert @ 2019-09-17 9:44 UTC (permalink / raw)
To: Balamuruhan S
Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david
* Balamuruhan S (bala24@linux.ibm.com) wrote:
> On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote:
> > * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > > 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>
> >
> > Depending on the architecture you might find that some machine types
> > aren't migratable while some are.
>
> Thanks Dave, is there a way to query/check whether a machine type on the
> architecture is migratable or should we try migrating and handle exception
> on failure ?
I don't know a way to detect it; you can add -only-migratable to get
qemu to fai early if a device is declared as being non-migratable; but
that still doesn't say that all the devices have actually been tested
migrating.
Dave
> -- Bala
> >
> > Dave
> >
> > > ---
> > > tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
> > > 1 file changed, 26 insertions(+)
> > >
> > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> > > index 0f3553c8f0..74416ccc21 100644
> > > --- a/tests/acceptance/migration.py
> > > +++ b/tests/acceptance/migration.py
> > > @@ -49,3 +49,29 @@ class Migration(Test):
> > > 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
> > >
> > >
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
2019-09-16 14:50 ` Dr. David Alan Gilbert
@ 2019-09-17 8:45 ` Balamuruhan S
2019-09-17 9:44 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 9+ messages in thread
From: Balamuruhan S @ 2019-09-17 8:45 UTC (permalink / raw)
To: Dr. David Alan Gilbert
Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david
On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote:
> * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > 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>
>
> Depending on the architecture you might find that some machine types
> aren't migratable while some are.
Thanks Dave, is there a way to query/check whether a machine type on the
architecture is migratable or should we try migrating and handle exception
on failure ?
-- Bala
>
> Dave
>
> > ---
> > tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
> > 1 file changed, 26 insertions(+)
> >
> > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> > index 0f3553c8f0..74416ccc21 100644
> > --- a/tests/acceptance/migration.py
> > +++ b/tests/acceptance/migration.py
> > @@ -49,3 +49,29 @@ class Migration(Test):
> > 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
> >
> >
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
2019-09-16 9:34 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types Balamuruhan S
@ 2019-09-16 14:50 ` Dr. David Alan Gilbert
2019-09-17 8:45 ` Balamuruhan S
0 siblings, 1 reply; 9+ messages in thread
From: Dr. David Alan Gilbert @ 2019-09-16 14:50 UTC (permalink / raw)
To: Balamuruhan S
Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david
* Balamuruhan S (bala24@linux.ibm.com) wrote:
> 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>
Depending on the architecture you might find that some machine types
aren't migratable while some are.
Dave
> ---
> tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> index 0f3553c8f0..74416ccc21 100644
> --- a/tests/acceptance/migration.py
> +++ b/tests/acceptance/migration.py
> @@ -49,3 +49,29 @@ class Migration(Test):
> 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
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all 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
2019-09-16 14:50 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 9+ 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 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 0f3553c8f0..74416ccc21 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -49,3 +49,29 @@ class Migration(Test):
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] 9+ messages in thread
end of thread, other threads:[~2019-09-18 3:57 UTC | newest]
Thread overview: 9+ 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 3/3] tests/acceptance/migration: test to migrate will all machine types Balamuruhan S
2019-09-16 14:50 ` Dr. David Alan Gilbert
2019-09-17 8:45 ` Balamuruhan S
2019-09-17 9:44 ` Dr. David Alan Gilbert
2019-09-18 0:46 ` David Gibson
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.