[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/29] migration-test: introduce functions to handle string parame
From: |
Juan Quintela |
Subject: |
[PULL 04/29] migration-test: introduce functions to handle string parameters |
Date: |
Tue, 14 Jan 2020 10:25:41 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
---
tests/qtest/migration-test.c | 37 ++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index fb70214f44..b0580dd541 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -356,6 +356,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.24.1
- [PULL 00/29] Migration pull patches (second try), Juan Quintela, 2020/01/14
- [PULL 01/29] multifd: Initialize local variable, Juan Quintela, 2020/01/14
- [PULL 02/29] migration-test: Add migration multifd test, Juan Quintela, 2020/01/14
- [PULL 04/29] migration-test: introduce functions to handle string parameters,
Juan Quintela <=
- [PULL 03/29] migration: Make sure that we don't call write() in case of error, Juan Quintela, 2020/01/14
- [PULL 05/29] migration-test: ppc64: fix FORTH test program, Juan Quintela, 2020/01/14
- [PULL 06/29] runstate: ignore finishmigrate -> prelaunch transition, Juan Quintela, 2020/01/14
- [PULL 07/29] ram.c: remove unneeded labels, Juan Quintela, 2020/01/14
- [PULL 08/29] migration: Rate limit inside host pages, Juan Quintela, 2020/01/14
- [PULL 09/29] migration: Fix incorrect integer->float conversion caught by clang, Juan Quintela, 2020/01/14
- [PULL 10/29] migration: Fix the re-run check of the migrate-incoming command, Juan Quintela, 2020/01/14
- [PULL 11/29] misc: use QEMU_IS_ALIGNED, Juan Quintela, 2020/01/14
- [PULL 12/29] migration: add savevm_state_handler_remove(), Juan Quintela, 2020/01/14
- [PULL 13/29] migration: savevm_state_handler_insert: constant-time element insertion, Juan Quintela, 2020/01/14