qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Oksana Vohchana <ovoshcha@redhat.com>
To: qemu-devel@nongnu.org
Cc: philmd@redhat.com, wainersm@redhat.com, crosa@redhat.com
Subject: [PATCH v3 1/2] Acceptance test: provides to use different transport for migration
Date: Mon,  3 Feb 2020 12:52:32 +0200	[thread overview]
Message-ID: <20200203105233.15692-2-ovoshcha@redhat.com> (raw)
In-Reply-To: <20200203105233.15692-1-ovoshcha@redhat.com>

Along with VM migration via TCP, we can use migration through EXEC
and UNIX transport protocol

Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>

---
v2:
  - Removes unnecessary symbols and unused method

v3:
 - Makes refactoring and split into 2 patches
Signed-off-by: Oksana Vohchana <ovoshcha@redhat.com>
---
 tests/acceptance/migration.py | 36 ++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index a44c1ae58f..34263d8eeb 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -24,6 +24,26 @@ class Migration(Test):
     def migration_finished(vm):
         return vm.command('query-migrate')['status'] in ('completed', 'failed')
 
+    def assert_migration(self, source_vm, dest_vm):
+        wait.wait_for(self.migration_finished,
+                      timeout=self.timeout,
+                      step=0.1,
+                      args=(source_vm,))
+        self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
+        self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
+        self.assertEqual(dest_vm.command('query-status')['status'], 'running')
+        self.assertEqual(source_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:
@@ -32,19 +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)
-        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.do_migrate(dest_uri)
-- 
2.21.1



  reply	other threads:[~2020-02-03 10:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 10:52 [PATCH v3 0/2] Acceptance test: provides to use different transport for migration Oksana Vohchana
2020-02-03 10:52 ` Oksana Vohchana [this message]
2020-02-03 10:52 ` [PATCH v3 2/2] " Oksana Vohchana
  -- strict thread matches above, loose matches on Subject: below --
2020-02-03 11:16 [PATCH v3 0/2] " Oksana Vohchana
2020-02-03 11:16 ` [PATCH v3 1/2] " Oksana Vohchana
2020-02-04 14:09   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200203105233.15692-2-ovoshcha@redhat.com \
    --to=ovoshcha@redhat.com \
    --cc=crosa@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).