migration-test: rename parameter to parameter_int
We would need _str ones on the next patch. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Wei Yang <richardw.yang@linux.intel.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
8ebad0f7a7
commit
8f7798f191
@ -398,7 +398,8 @@ static char *migrate_get_socket_address(QTestState *who, const char *parameter)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long long migrate_get_parameter(QTestState *who, const char *parameter)
|
static long long migrate_get_parameter_int(QTestState *who,
|
||||||
|
const char *parameter)
|
||||||
{
|
{
|
||||||
QDict *rsp;
|
QDict *rsp;
|
||||||
long long result;
|
long long result;
|
||||||
@ -409,16 +410,16 @@ static long long migrate_get_parameter(QTestState *who, const char *parameter)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void migrate_check_parameter(QTestState *who, const char *parameter,
|
static void migrate_check_parameter_int(QTestState *who, const char *parameter,
|
||||||
long long value)
|
long long value)
|
||||||
{
|
{
|
||||||
long long result;
|
long long result;
|
||||||
|
|
||||||
result = migrate_get_parameter(who, parameter);
|
result = migrate_get_parameter_int(who, parameter);
|
||||||
g_assert_cmpint(result, ==, value);
|
g_assert_cmpint(result, ==, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void migrate_set_parameter(QTestState *who, const char *parameter,
|
static void migrate_set_parameter_int(QTestState *who, const char *parameter,
|
||||||
long long value)
|
long long value)
|
||||||
{
|
{
|
||||||
QDict *rsp;
|
QDict *rsp;
|
||||||
@ -429,7 +430,7 @@ static void migrate_set_parameter(QTestState *who, const char *parameter,
|
|||||||
parameter, value);
|
parameter, value);
|
||||||
g_assert(qdict_haskey(rsp, "return"));
|
g_assert(qdict_haskey(rsp, "return"));
|
||||||
qobject_unref(rsp);
|
qobject_unref(rsp);
|
||||||
migrate_check_parameter(who, parameter, value);
|
migrate_check_parameter_int(who, parameter, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void migrate_pause(QTestState *who)
|
static void migrate_pause(QTestState *who)
|
||||||
@ -681,7 +682,7 @@ static void deprecated_set_downtime(QTestState *who, const double value)
|
|||||||
" 'arguments': { 'value': %f } }", value);
|
" 'arguments': { 'value': %f } }", value);
|
||||||
g_assert(qdict_haskey(rsp, "return"));
|
g_assert(qdict_haskey(rsp, "return"));
|
||||||
qobject_unref(rsp);
|
qobject_unref(rsp);
|
||||||
migrate_check_parameter(who, "downtime-limit", value * 1000);
|
migrate_check_parameter_int(who, "downtime-limit", value * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deprecated_set_speed(QTestState *who, long long value)
|
static void deprecated_set_speed(QTestState *who, long long value)
|
||||||
@ -692,7 +693,7 @@ static void deprecated_set_speed(QTestState *who, long long value)
|
|||||||
"'arguments': { 'value': %lld } }", value);
|
"'arguments': { 'value': %lld } }", value);
|
||||||
g_assert(qdict_haskey(rsp, "return"));
|
g_assert(qdict_haskey(rsp, "return"));
|
||||||
qobject_unref(rsp);
|
qobject_unref(rsp);
|
||||||
migrate_check_parameter(who, "max-bandwidth", value);
|
migrate_check_parameter_int(who, "max-bandwidth", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deprecated_set_cache_size(QTestState *who, long long value)
|
static void deprecated_set_cache_size(QTestState *who, long long value)
|
||||||
@ -703,7 +704,7 @@ static void deprecated_set_cache_size(QTestState *who, long long value)
|
|||||||
"'arguments': { 'value': %lld } }", value);
|
"'arguments': { 'value': %lld } }", value);
|
||||||
g_assert(qdict_haskey(rsp, "return"));
|
g_assert(qdict_haskey(rsp, "return"));
|
||||||
qobject_unref(rsp);
|
qobject_unref(rsp);
|
||||||
migrate_check_parameter(who, "xbzrle-cache-size", value);
|
migrate_check_parameter_int(who, "xbzrle-cache-size", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_deprecated(void)
|
static void test_deprecated(void)
|
||||||
@ -738,8 +739,8 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
|
|||||||
* quickly, but that it doesn't complete precopy even on a slow
|
* quickly, but that it doesn't complete precopy even on a slow
|
||||||
* machine, so also set the downtime.
|
* machine, so also set the downtime.
|
||||||
*/
|
*/
|
||||||
migrate_set_parameter(from, "max-bandwidth", 100000000);
|
migrate_set_parameter_int(from, "max-bandwidth", 100000000);
|
||||||
migrate_set_parameter(from, "downtime-limit", 1);
|
migrate_set_parameter_int(from, "downtime-limit", 1);
|
||||||
|
|
||||||
/* Wait for the first serial output from the source */
|
/* Wait for the first serial output from the source */
|
||||||
wait_for_serial("src_serial");
|
wait_for_serial("src_serial");
|
||||||
@ -790,7 +791,7 @@ static void test_postcopy_recovery(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Turn postcopy speed down, 4K/s is slow enough on any machines */
|
/* Turn postcopy speed down, 4K/s is slow enough on any machines */
|
||||||
migrate_set_parameter(from, "max-postcopy-bandwidth", 4096);
|
migrate_set_parameter_int(from, "max-postcopy-bandwidth", 4096);
|
||||||
|
|
||||||
/* Now we start the postcopy */
|
/* Now we start the postcopy */
|
||||||
migrate_postcopy_start(from, to);
|
migrate_postcopy_start(from, to);
|
||||||
@ -831,7 +832,7 @@ static void test_postcopy_recovery(void)
|
|||||||
g_free(uri);
|
g_free(uri);
|
||||||
|
|
||||||
/* Restore the postcopy bandwidth to unlimited */
|
/* Restore the postcopy bandwidth to unlimited */
|
||||||
migrate_set_parameter(from, "max-postcopy-bandwidth", 0);
|
migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0);
|
||||||
|
|
||||||
migrate_postcopy_complete(from, to);
|
migrate_postcopy_complete(from, to);
|
||||||
}
|
}
|
||||||
@ -877,9 +878,9 @@ static void test_precopy_unix(void)
|
|||||||
* machine, so also set the downtime.
|
* machine, so also set the downtime.
|
||||||
*/
|
*/
|
||||||
/* 1 ms should make it not converge*/
|
/* 1 ms should make it not converge*/
|
||||||
migrate_set_parameter(from, "downtime-limit", 1);
|
migrate_set_parameter_int(from, "downtime-limit", 1);
|
||||||
/* 1GB/s */
|
/* 1GB/s */
|
||||||
migrate_set_parameter(from, "max-bandwidth", 1000000000);
|
migrate_set_parameter_int(from, "max-bandwidth", 1000000000);
|
||||||
|
|
||||||
/* Wait for the first serial output from the source */
|
/* Wait for the first serial output from the source */
|
||||||
wait_for_serial("src_serial");
|
wait_for_serial("src_serial");
|
||||||
@ -889,7 +890,7 @@ static void test_precopy_unix(void)
|
|||||||
wait_for_migration_pass(from);
|
wait_for_migration_pass(from);
|
||||||
|
|
||||||
/* 300 ms should converge */
|
/* 300 ms should converge */
|
||||||
migrate_set_parameter(from, "downtime-limit", 300);
|
migrate_set_parameter_int(from, "downtime-limit", 300);
|
||||||
|
|
||||||
if (!got_stop) {
|
if (!got_stop) {
|
||||||
qtest_qmp_eventwait(from, "STOP");
|
qtest_qmp_eventwait(from, "STOP");
|
||||||
@ -956,11 +957,11 @@ static void test_xbzrle(const char *uri)
|
|||||||
* machine, so also set the downtime.
|
* machine, so also set the downtime.
|
||||||
*/
|
*/
|
||||||
/* 1 ms should make it not converge*/
|
/* 1 ms should make it not converge*/
|
||||||
migrate_set_parameter(from, "downtime-limit", 1);
|
migrate_set_parameter_int(from, "downtime-limit", 1);
|
||||||
/* 1GB/s */
|
/* 1GB/s */
|
||||||
migrate_set_parameter(from, "max-bandwidth", 1000000000);
|
migrate_set_parameter_int(from, "max-bandwidth", 1000000000);
|
||||||
|
|
||||||
migrate_set_parameter(from, "xbzrle-cache-size", 33554432);
|
migrate_set_parameter_int(from, "xbzrle-cache-size", 33554432);
|
||||||
|
|
||||||
migrate_set_capability(from, "xbzrle", "true");
|
migrate_set_capability(from, "xbzrle", "true");
|
||||||
migrate_set_capability(to, "xbzrle", "true");
|
migrate_set_capability(to, "xbzrle", "true");
|
||||||
@ -972,7 +973,7 @@ static void test_xbzrle(const char *uri)
|
|||||||
wait_for_migration_pass(from);
|
wait_for_migration_pass(from);
|
||||||
|
|
||||||
/* 300ms should converge */
|
/* 300ms should converge */
|
||||||
migrate_set_parameter(from, "downtime-limit", 300);
|
migrate_set_parameter_int(from, "downtime-limit", 300);
|
||||||
|
|
||||||
if (!got_stop) {
|
if (!got_stop) {
|
||||||
qtest_qmp_eventwait(from, "STOP");
|
qtest_qmp_eventwait(from, "STOP");
|
||||||
@ -1008,9 +1009,9 @@ static void test_precopy_tcp(void)
|
|||||||
* machine, so also set the downtime.
|
* machine, so also set the downtime.
|
||||||
*/
|
*/
|
||||||
/* 1 ms should make it not converge*/
|
/* 1 ms should make it not converge*/
|
||||||
migrate_set_parameter(from, "downtime-limit", 1);
|
migrate_set_parameter_int(from, "downtime-limit", 1);
|
||||||
/* 1GB/s */
|
/* 1GB/s */
|
||||||
migrate_set_parameter(from, "max-bandwidth", 1000000000);
|
migrate_set_parameter_int(from, "max-bandwidth", 1000000000);
|
||||||
|
|
||||||
/* Wait for the first serial output from the source */
|
/* Wait for the first serial output from the source */
|
||||||
wait_for_serial("src_serial");
|
wait_for_serial("src_serial");
|
||||||
@ -1022,7 +1023,7 @@ static void test_precopy_tcp(void)
|
|||||||
wait_for_migration_pass(from);
|
wait_for_migration_pass(from);
|
||||||
|
|
||||||
/* 300ms should converge */
|
/* 300ms should converge */
|
||||||
migrate_set_parameter(from, "downtime-limit", 300);
|
migrate_set_parameter_int(from, "downtime-limit", 300);
|
||||||
|
|
||||||
if (!got_stop) {
|
if (!got_stop) {
|
||||||
qtest_qmp_eventwait(from, "STOP");
|
qtest_qmp_eventwait(from, "STOP");
|
||||||
@ -1054,9 +1055,9 @@ static void test_migrate_fd_proto(void)
|
|||||||
* machine, so also set the downtime.
|
* machine, so also set the downtime.
|
||||||
*/
|
*/
|
||||||
/* 1 ms should make it not converge */
|
/* 1 ms should make it not converge */
|
||||||
migrate_set_parameter(from, "downtime-limit", 1);
|
migrate_set_parameter_int(from, "downtime-limit", 1);
|
||||||
/* 1GB/s */
|
/* 1GB/s */
|
||||||
migrate_set_parameter(from, "max-bandwidth", 1000000000);
|
migrate_set_parameter_int(from, "max-bandwidth", 1000000000);
|
||||||
|
|
||||||
/* Wait for the first serial output from the source */
|
/* Wait for the first serial output from the source */
|
||||||
wait_for_serial("src_serial");
|
wait_for_serial("src_serial");
|
||||||
@ -1090,7 +1091,7 @@ static void test_migrate_fd_proto(void)
|
|||||||
wait_for_migration_pass(from);
|
wait_for_migration_pass(from);
|
||||||
|
|
||||||
/* 300ms should converge */
|
/* 300ms should converge */
|
||||||
migrate_set_parameter(from, "downtime-limit", 300);
|
migrate_set_parameter_int(from, "downtime-limit", 300);
|
||||||
|
|
||||||
if (!got_stop) {
|
if (!got_stop) {
|
||||||
qtest_qmp_eventwait(from, "STOP");
|
qtest_qmp_eventwait(from, "STOP");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user