tests: Remove deprecated migration tests commands

We move to use migration_set_parameter() for everything.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Juan Quintela 2017-11-30 21:12:03 +01:00 committed by Dr. David Alan Gilbert
parent 7faccdc3e7
commit 1f90d79711

View File

@ -369,37 +369,20 @@ static void migrate_check_parameter(QTestState *who, const char *parameter,
QDECREF(rsp);
}
static void migrate_set_downtime(QTestState *who, const double value)
{
QDict *rsp;
gchar *cmd;
char *expected;
int64_t result_int;
cmd = g_strdup_printf("{ 'execute': 'migrate_set_downtime',"
"'arguments': { 'value': %g } }", value);
rsp = qtest_qmp(who, cmd);
g_free(cmd);
g_assert(qdict_haskey(rsp, "return"));
QDECREF(rsp);
result_int = value * 1000L;
expected = g_strdup_printf("%" PRId64, result_int);
migrate_check_parameter(who, "downtime-limit", expected);
g_free(expected);
}
static void migrate_set_speed(QTestState *who, const char *value)
static void migrate_set_parameter(QTestState *who, const char *parameter,
const char *value)
{
QDict *rsp;
gchar *cmd;
cmd = g_strdup_printf("{ 'execute': 'migrate_set_speed',"
"'arguments': { 'value': %s } }", value);
cmd = g_strdup_printf("{ 'execute': 'migrate-set-parameters',"
"'arguments': { '%s': %s } }",
parameter, value);
rsp = qtest_qmp(who, cmd);
g_free(cmd);
g_assert(qdict_haskey(rsp, "return"));
QDECREF(rsp);
migrate_check_parameter(who, "max-bandwidth", value);
migrate_check_parameter(who, parameter, value);
}
static void migrate_set_capability(QTestState *who, const char *capability,
@ -530,8 +513,8 @@ static void test_migrate(void)
* quickly, but that it doesn't complete precopy even on a slow
* machine, so also set the downtime.
*/
migrate_set_speed(from, "100000000");
migrate_set_downtime(from, 0.001);
migrate_set_parameter(from, "max-bandwidth", "100000000");
migrate_set_parameter(from, "downtime-limit", "1");
/* Wait for the first serial output from the source */
wait_for_serial("src_serial");