[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 03/10] migration-test: introduce functions to handle string pa
From: |
Juan Quintela |
Subject: |
[PATCH v2 03/10] migration-test: introduce functions to handle string parameters |
Date: |
Wed, 18 Dec 2019 03:01:12 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
tests/migration-test.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/tests/migration-test.c b/tests/migration-test.c
index 1c9f2c4e6a..fc221f172a 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -460,6 +460,43 @@ static void migrate_set_parameter_int(QTestState *who,
const char *parameter,
migrate_check_parameter_int(who, parameter, value);
}
+static char *migrate_get_parameter_str(QTestState *who,
+ const char *parameter)
+{
+ QDict *rsp;
+ char *result;
+
+ rsp = wait_command(who, "{ 'execute': 'query-migrate-parameters' }");
+ result = g_strdup(qdict_get_str(rsp, parameter));
+ qobject_unref(rsp);
+ return result;
+}
+
+static void migrate_check_parameter_str(QTestState *who, const char *parameter,
+ const char *value)
+{
+ char *result;
+
+ result = migrate_get_parameter_str(who, parameter);
+ g_assert_cmpstr(result, ==, value);
+ g_free(result);
+}
+
+__attribute__((unused))
+static void migrate_set_parameter_str(QTestState *who, const char *parameter,
+ const char *value)
+{
+ QDict *rsp;
+
+ rsp = qtest_qmp(who,
+ "{ 'execute': 'migrate-set-parameters',"
+ "'arguments': { %s: %s } }",
+ parameter, value);
+ g_assert(qdict_haskey(rsp, "return"));
+ qobject_unref(rsp);
+ migrate_check_parameter_str(who, parameter, value);
+}
+
static void migrate_pause(QTestState *who)
{
QDict *rsp;
--
2.23.0
- [PATCH v2 00/10] Multifd Migration Compression, Juan Quintela, 2019/12/17
- [PATCH v2 02/10] migration-test: Add migration multifd test, Juan Quintela, 2019/12/17
- [PATCH v2 01/10] migration: Increase default number of multifd channels to 16, Juan Quintela, 2019/12/17
- [PATCH v2 03/10] migration-test: introduce functions to handle string parameters,
Juan Quintela <=
- [PATCH v2 05/10] migration: Make multifd_load_setup() get an Error parameter, Juan Quintela, 2019/12/17
- [PATCH v2 04/10] migration: Make multifd_save_setup() get an Error parameter, Juan Quintela, 2019/12/17
- [PATCH v2 07/10] migration: Make no compression operations into its own structure, Juan Quintela, 2019/12/17
- [PATCH v2 06/10] migration: Add multifd-compress parameter, Juan Quintela, 2019/12/17
- [PATCH v2 08/10] migration: Add zlib compression multifd support, Juan Quintela, 2019/12/17
- [PATCH v2 09/10] configure: Enable test and libs for zstd, Juan Quintela, 2019/12/17
- [PATCH v2 10/10] migration: Add zstd compression multifd support, Juan Quintela, 2019/12/17