[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/46] tests/acceptance/migration: Factor out do_migrate()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 26/46] tests/acceptance/migration: Factor out do_migrate() |
Date: |
Thu, 6 Feb 2020 22:19:16 +0100 |
From: Oksana Vohchana <address@hidden>
We are going to reuse this code when testing different transport
methods, so factor it out first.
Signed-off-by: Oksana Vohchana <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
[PMD: Split patch in 2, reworded subject and description]
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/acceptance/migration.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 3db733b1ce..03686d7de3 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -34,6 +34,16 @@ class Migration(Test):
self.assertEqual(dst_vm.command('query-status')['status'], 'running')
self.assertEqual(src_vm.command('query-status')['status'],'postmigrate')
+ def do_migrate(self, dest_uri, src_uri=None):
+ source_vm = self.get_vm()
+ dest_vm = self.get_vm('-incoming', dest_uri)
+ dest_vm.launch()
+ if src_uri is None:
+ src_uri = dest_uri
+ source_vm.launch()
+ source_vm.qmp('migrate', uri=src_uri)
+ self.assert_migration(source_vm, dest_vm)
+
def _get_free_port(self):
port = network.find_free_port()
if port is None:
@@ -42,10 +52,5 @@ class Migration(Test):
def test_migration_with_tcp_localhost(self):
- source_vm = self.get_vm()
dest_uri = 'tcp:localhost:%u' % self._get_free_port()
- dest_vm = self.get_vm('-incoming', dest_uri)
- dest_vm.launch()
- source_vm.launch()
- source_vm.qmp('migrate', uri=dest_uri)
- self.assert_migration(source_vm, dest_vm)
+ self.do_migrate(dest_uri)
--
2.21.1
- [PULL 18/46] tests: rename virtio_seg_max_adjust to virtio_check_params, (continued)
- [PULL 18/46] tests: rename virtio_seg_max_adjust to virtio_check_params, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 17/46] tests/acceptance: Add boot tests for some of the QEMU advent calendar images, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 20/46] tests/acceptance/virtio_check_params: List machine being tested, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 24/46] tests/acceptance/version: Default to -nodefaults, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 23/46] tests/acceptance/boot_linux_console: Do not use VGA on Clipper machine, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 21/46] tests/acceptance/virtio_check_params: Default to -nodefaults, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 19/46] tests/acceptance/virtio_check_params: Improve exception logging, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 22/46] tests/acceptance/virtio_check_params: Disable the test, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 25/46] tests/acceptance/migration: Factor out assert_migration(), Philippe Mathieu-Daudé, 2020/02/06
- [PULL 27/46] tests/acceptance/migration: Test UNIX transport when migrating, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 26/46] tests/acceptance/migration: Factor out do_migrate(),
Philippe Mathieu-Daudé <=
- [PULL 28/46] tests/acceptance/migration: Test EXEC transport when migrating, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 29/46] tests/acceptance/migration: Add the 'migration' tag, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 30/46] tests/acceptance/migration: Default to -nodefaults, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 31/46] scripts/checkpatch.pl: Only allow Python 3 interpreter, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 32/46] tests/qemu-iotests/check: Allow use of python3 interpreter, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 33/46] tests/qemu-iotests: Explicit usage of Python 3 (scripts with __main__), Philippe Mathieu-Daudé, 2020/02/06
- [PULL 34/46] tests: Explicit usage of Python 3, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 36/46] scripts/minikconf: Explicit usage of Python 3, Philippe Mathieu-Daudé, 2020/02/06
- [PULL 35/46] scripts: Explicit usage of Python 3 (scripts with __main__), Philippe Mathieu-Daudé, 2020/02/06
- [PULL 37/46] scripts/tracetool: Remove shebang header, Philippe Mathieu-Daudé, 2020/02/06