diff options
author | Oksana Vohchana <ovoshcha@redhat.com> | 2020-02-03 13:16:30 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-02-07 15:12:48 +0100 |
commit | d7c9a83344d955300262bba3d7c455a8cfd6f6e0 (patch) | |
tree | 6183b7682a66760957d4510c9aaac1c6d95c2768 /tests | |
parent | b79e55f09b0b7c23517a3224b0e6953849e1b889 (diff) | |
download | qemu-d7c9a83344d955300262bba3d7c455a8cfd6f6e0.zip qemu-d7c9a83344d955300262bba3d7c455a8cfd6f6e0.tar.gz qemu-d7c9a83344d955300262bba3d7c455a8cfd6f6e0.tar.bz2 |
tests/acceptance/migration: Factor out assert_migration()
We are going to reuse this code when testing different transport
methods, so factor it out first
Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200203111631.18796-2-ovoshcha@redhat.com>
[PMD: Split patch in 2, reworded subject and description]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/migration.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py index a44c1ae..3db733b 100644 --- a/tests/acceptance/migration.py +++ b/tests/acceptance/migration.py @@ -24,6 +24,16 @@ class Migration(Test): def migration_finished(vm): return vm.command('query-migrate')['status'] in ('completed', 'failed') + def assert_migration(self, src_vm, dst_vm): + wait.wait_for(self.migration_finished, + timeout=self.timeout, + step=0.1, + args=(src_vm,)) + self.assertEqual(src_vm.command('query-migrate')['status'], 'completed') + self.assertEqual(dst_vm.command('query-migrate')['status'], 'completed') + self.assertEqual(dst_vm.command('query-status')['status'], 'running') + self.assertEqual(src_vm.command('query-status')['status'],'postmigrate') + def _get_free_port(self): port = network.find_free_port() if port is None: @@ -38,13 +48,4 @@ class Migration(Test): 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(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') + self.assert_migration(source_vm, dest_vm) |