aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-02-14 17:57:15 +0000
committerPeter Maydell <peter.maydell@linaro.org>2020-02-14 17:57:15 +0000
commitb29c3e23f64938784c42ef9fca896829e3c19120 (patch)
tree3291d595c1b03c7588a7d7a0fd33249071d1236a /tests
parent71cd1bccf3bfc4a77434595c3e987daa4e8ff574 (diff)
parent1a920d2b633e13df8961328b3b3e128989a34570 (diff)
Merge remote-tracking branch 'remotes/juanquintela/tags/pull-migration-pull-request' into staging
Migration pull request # gpg: Signature made Thu 13 Feb 2020 13:04:43 GMT # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full] # gpg: aka "Juan Quintela <quintela@trasno.org>" [full] # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * remotes/juanquintela/tags/pull-migration-pull-request: git: Make submodule check only needed modules migration-test: fix some memleaks in migration-test tests/migration: Add some slack to auto converge migration/rdma: rdma_accept_incoming_migration fix error handling migration: Optimization about wait-unplug migration state migration: Maybe VM is paused when migration is cancelled Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/migration-test.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index cf27ebbc9d..ccf313f288 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -498,11 +498,13 @@ static int test_migrate_start(QTestState **from, QTestState **to,
const char *arch = qtest_get_arch();
const char *machine_opts = NULL;
const char *memory_size;
+ int ret = 0;
if (args->use_shmem) {
if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) {
g_test_skip("/dev/shm is not supported");
- return -1;
+ ret = -1;
+ goto out;
}
}
@@ -611,8 +613,9 @@ static int test_migrate_start(QTestState **from, QTestState **to,
g_free(shmem_path);
}
+out:
migrate_start_destroy(args);
- return 0;
+ return ret;
}
static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
@@ -1134,6 +1137,8 @@ static void test_validate_uuid(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_source);
+ g_free(args->opts_target);
args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
args->opts_target = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
do_test_validate_uuid(args, false);
@@ -1143,6 +1148,8 @@ static void test_validate_uuid_error(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_source);
+ g_free(args->opts_target);
args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
args->opts_target = g_strdup("-uuid 22222222-2222-2222-2222-222222222222");
args->hide_stderr = true;
@@ -1153,6 +1160,7 @@ static void test_validate_uuid_src_not_set(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_target);
args->opts_target = g_strdup("-uuid 22222222-2222-2222-2222-222222222222");
args->hide_stderr = true;
do_test_validate_uuid(args, false);
@@ -1162,6 +1170,7 @@ static void test_validate_uuid_dst_not_set(void)
{
MigrateStart *args = migrate_start_new();
+ g_free(args->opts_source);
args->opts_source = g_strdup("-uuid 11111111-1111-1111-1111-111111111111");
args->hide_stderr = true;
do_test_validate_uuid(args, false);
@@ -1237,7 +1246,8 @@ static void test_migrate_auto_converge(void)
g_assert_cmpint(percentage, <=, max_pct);
remaining = read_ram_property_int(from, "remaining");
- g_assert_cmpint(remaining, <, expected_threshold);
+ g_assert_cmpint(remaining, <,
+ (expected_threshold + expected_threshold / 100));
migrate_continue(from, "pre-switchover");
@@ -1379,6 +1389,7 @@ static void test_multifd_tcp_cancel(void)
" 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}");
qobject_unref(rsp);
+ g_free(uri);
uri = migrate_get_socket_address(to2, "socket-address");
wait_for_migration_status(from, "cancelled", NULL);