aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-09-26 14:23:58 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-09-26 14:23:58 +0100
commiteb13d1cf4a0478fc29f80abfbac8209479325f35 (patch)
treee556d4854ffdf592440878cd8b862c3752f2759e /tests
parentd4e536f336d3d26c9fafa2a2549aaa0b014f5b6b (diff)
parent3748fef9b95a9bc1602f3c4ed2a329d8ef47e63c (diff)
downloadqemu-eb13d1cf4a0478fc29f80abfbac8209479325f35.zip
qemu-eb13d1cf4a0478fc29f80abfbac8209479325f35.tar.gz
qemu-eb13d1cf4a0478fc29f80abfbac8209479325f35.tar.bz2
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20190925a' into staging
Migration pull 2019-09-25 me: test fixes from (should stop hangs in postcopy tests). me: An RDMA cleanup hang fix Wei: Tidy ups around postcopy Marc-Andre: mem leak fix # gpg: Signature made Wed 25 Sep 2019 15:59:41 BST # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20190925a: migration/postcopy: Recognise the recovery states as 'in_postcopy' tests/migration/postcopy: trim migration bandwidth tests/migration: Fail on unexpected migration states migration/rdma.c: Swap synchronize_rcu for call_rcu migration/rdma: Don't moan about disconnects at the end migration: remove sent parameter in get_queued_page_not_dirty migration/postcopy: unsentmap is not necessary for postcopy migration/postcopy: not necessary to do discard when canonicalizing bitmap migration: fix vmdesc leak on vmstate_save() error Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/migration-test.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/migration-test.c b/tests/migration-test.c
index 258aa06..221a33d 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -255,15 +255,19 @@ static void read_blocktime(QTestState *who)
}
static void wait_for_migration_status(QTestState *who,
- const char *goal)
+ const char *goal,
+ const char **ungoals)
{
while (true) {
bool completed;
char *status;
+ const char **ungoal;
status = migrate_query_status(who);
completed = strcmp(status, goal) == 0;
- g_assert_cmpstr(status, !=, "failed");
+ for (ungoal = ungoals; *ungoal; ungoal++) {
+ g_assert_cmpstr(status, !=, *ungoal);
+ }
g_free(status);
if (completed) {
return;
@@ -274,7 +278,8 @@ static void wait_for_migration_status(QTestState *who,
static void wait_for_migration_complete(QTestState *who)
{
- wait_for_migration_status(who, "completed");
+ wait_for_migration_status(who, "completed",
+ (const char * []) { "failed", NULL });
}
static void wait_for_migration_pass(QTestState *who)
@@ -748,7 +753,7 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
* quickly, but that it doesn't complete precopy even on a slow
* machine, so also set the downtime.
*/
- migrate_set_parameter_int(from, "max-bandwidth", 100000000);
+ migrate_set_parameter_int(from, "max-bandwidth", 30000000);
migrate_set_parameter_int(from, "downtime-limit", 1);
/* Wait for the first serial output from the source */
@@ -809,7 +814,9 @@ static void test_postcopy_recovery(void)
* Wait until postcopy is really started; we can only run the
* migrate-pause command during a postcopy
*/
- wait_for_migration_status(from, "postcopy-active");
+ wait_for_migration_status(from, "postcopy-active",
+ (const char * []) { "failed",
+ "completed", NULL });
/*
* Manually stop the postcopy migration. This emulates a network
@@ -822,7 +829,9 @@ static void test_postcopy_recovery(void)
* migrate-recover command can only succeed if destination machine
* is in the paused state
*/
- wait_for_migration_status(to, "postcopy-paused");
+ wait_for_migration_status(to, "postcopy-paused",
+ (const char * []) { "failed", "active",
+ "completed", NULL });
/*
* Create a new socket to emulate a new channel that is different
@@ -836,7 +845,9 @@ static void test_postcopy_recovery(void)
* Try to rebuild the migration channel using the resume flag and
* the newly created channel
*/
- wait_for_migration_status(from, "postcopy-paused");
+ wait_for_migration_status(from, "postcopy-paused",
+ (const char * []) { "failed", "active",
+ "completed", NULL });
migrate(from, uri, "{'resume': true}");
g_free(uri);