[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/8] tests/acceptance/migration.py: cancel test if migration
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 4/8] tests/acceptance/migration.py: cancel test if migration is not supported |
Date: |
Fri, 16 Apr 2021 07:11:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
On 4/15/21 11:51 PM, Cleber Rosa 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 <crosa@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)
> self.assert_migration(source_vm, dest_vm)
It would be better to have this done as a generic check_requisites()
method. First because we could reuse it (also at the class level),
second because we could account the time spent for checking separately
from the time spent for the actual testing.
[PATCH 4/8] tests/acceptance/migration.py: cancel test if migration is not supported, Cleber Rosa, 2021/04/15
[PATCH 5/8] tests/acceptance/cpu_queries.py: use the proper logging channels, Cleber Rosa, 2021/04/15
[PATCH 6/8] Acceptance tests: prevent shutdown on non-specific target tests, Cleber Rosa, 2021/04/15