On Thu, Apr 15, 2021 at 6:52 PM Cleber Rosa <cr...@redhat.com> wrote: > > FIXME: check if there's a way to query migration support before > actually requesting migration. > > Some targets/machines contain devices that do not support migration. > Let's acknowledge that and cancel the test as early as possible. > > Signed-off-by: Cleber Rosa <cr...@redhat.com> > --- > tests/acceptance/migration.py | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py > index 792639cb69..25ee55f36a 100644 > --- a/tests/acceptance/migration.py > +++ b/tests/acceptance/migration.py > @@ -53,7 +53,11 @@ def do_migrate(self, dest_uri, src_uri=None): > source_vm = self.get_vm() > source_vm.add_args('-nodefaults') > source_vm.launch() > - source_vm.qmp('migrate', uri=src_uri) > + response = source_vm.qmp('migrate', uri=src_uri) > + if 'error' in response: > + if 'desc' in response['error']: > + msg = response['error']['desc'] > + self.cancel('Migration does not seem to be supported: %s' % msg)
I agree with Phil that a generic function would be reusable when needed, but as it is not needed yet, this looks good to me: Reviewed-by: Willian Rampazzo <willi...@redhat.com>