diff --git a/tests/functional/migration.py b/tests/functional/migration.py index 49347a30bb..e995328e83 100644 --- a/tests/functional/migration.py +++ b/tests/functional/migration.py @@ -65,6 +65,11 @@ def _get_free_port(self, ports): self.skipTest('Failed to find a free port') return port + def migration_with_tcp_localhost_vms(self, dst_vm, src_vm): + with Ports() as ports: + uri = 'tcp:localhost:%u' % self._get_free_port(ports) + self.migrate_vms(uri, uri, dst_vm, src_vm) + def migration_with_tcp_localhost(self): with Ports() as ports: dst_uri = 'tcp:localhost:%u' % self._get_free_port(ports) diff --git a/tests/functional/ppc64/test_migration.py b/tests/functional/ppc64/test_migration.py index a3b819680b..7d49ee175b 100755 --- a/tests/functional/ppc64/test_migration.py +++ b/tests/functional/ppc64/test_migration.py @@ -22,17 +22,6 @@ def test_migration_with_exec(self): self.set_machine('mac99') self.migration_with_exec() - def do_migrate_ppc64_linux(self, source_vm, dest_vm): - with Ports() as ports: - port = ports.find_free_port() - if port is None: - self.skipTest('Failed to find a free port') - uri = 'tcp:localhost:%u' % port - - dest_vm.qmp('migrate-incoming', uri=uri) - source_vm.qmp('migrate', uri=uri) - self.assert_migration(source_vm, dest_vm) - if __name__ == '__main__': MigrationTest.main() diff --git a/tests/functional/ppc64/test_pseries.py b/tests/functional/ppc64/test_pseries.py index b45763c305..cb6d25dc81 100755 --- a/tests/functional/ppc64/test_pseries.py +++ b/tests/functional/ppc64/test_pseries.py @@ -7,11 +7,11 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. -from qemu_test import QemuSystemTest, Asset +from qemu_test import Asset from qemu_test import wait_for_console_pattern -from test_migration import PpcMigrationTest +from migration import MigrationTest -class PseriesMachine(QemuSystemTest): +class PseriesMachine(MigrationTest): timeout = 90 KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 console=hvc0 ' @@ -116,11 +116,11 @@ def test_ppc64_linux_migration(self): wait_for_console_pattern(self, console_pattern, self.panic_message, vm=source_vm) - PpcMigrationTest().do_migrate_ppc64_linux(source_vm, dest_vm); + self.migration_with_tcp_localhost_vms(dest_vm, source_vm) # ensure the boot proceeds after migration wait_for_console_pattern(self, self.good_message, self.panic_message, vm=dest_vm) if __name__ == '__main__': - QemuSystemTest.main() + MigrationTest.main()