diff mbox

[1/2] tests: add precopy multifd migration test with unix

Message ID 20180705080017.31123-2-bala24@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Balamuruhan S July 5, 2018, 8 a.m. UTC
multifd migration feature is in with commit: 35374cbdff, this patch
adds test for it using unix socket.

Signed-off-by: Balamuruhan S <bala24@linux.vnet.ibm.com>
---
 tests/migration-test.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

Comments

Peter Xu July 5, 2018, 9:19 a.m. UTC | #1
On Thu, Jul 05, 2018 at 01:30:16PM +0530, Balamuruhan S wrote:
> multifd migration feature is in with commit: 35374cbdff, this patch
> adds test for it using unix socket.
> 
> Signed-off-by: Balamuruhan S <bala24@linux.vnet.ibm.com>

Reviewed-by: Peter Xu <peterx@redhat.com>
diff mbox

Patch

diff --git a/tests/migration-test.c b/tests/migration-test.c
index 3a85446f95..e2434e70ea 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -619,6 +619,36 @@  static void test_precopy_unix(void)
     g_free(uri);
 }
 
+static void test_multifd_unix(void)
+{
+    char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
+    QTestState *from, *to;
+    test_migrate_start(&from, &to, uri, false);
+
+    /* set multifd capability on source and target */
+    migrate_set_capability(from, "x-multifd", "true");
+    migrate_set_capability(to, "x-multifd", "true");
+
+    /* Wait for the first serial output from the source */
+    wait_for_serial("src_serial");
+
+    /* perform migration */
+    migrate(from, uri);
+
+    wait_for_migration_pass(from);
+
+    if (!got_stop) {
+        qtest_qmp_eventwait(from, "STOP");
+    }
+
+    qtest_qmp_eventwait(to, "RESUME");
+
+    wait_for_serial("dest_serial");
+    wait_for_migration_complete(from);
+    test_migrate_end(from, to, true);
+    g_free(uri);
+}
+
 int main(int argc, char **argv)
 {
     char template[] = "/tmp/migration-test-XXXXXX";
@@ -642,6 +672,7 @@  int main(int argc, char **argv)
     qtest_add_func("/migration/deprecated", test_deprecated);
     qtest_add_func("/migration/bad_dest", test_baddest);
     qtest_add_func("/migration/precopy/unix", test_precopy_unix);
+    qtest_add_func("/migration/multifd/unix", test_multifd_unix);
 
     ret = g_test_run();