tests/qtest: Use EXIT_FAILURE instead of magic number
When migration fails, QEMU exits with a status code EXIT_FAILURE. Change qtests to use the well-defined macro instead of magic number. Signed-off-by: Bin Meng <bin.meng@windriver.com> Message-Id: <20221028045736.679903-6-bin.meng@windriver.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
e4439e5280
commit
1b0f1b14fe
@ -233,7 +233,7 @@ test_dbus_vmstate(Test *test)
|
||||
test->src_qemu = src_qemu;
|
||||
if (test->migrate_fail) {
|
||||
wait_for_migration_fail(src_qemu, true);
|
||||
qtest_set_expected_status(dst_qemu, 1);
|
||||
qtest_set_expected_status(dst_qemu, EXIT_FAILURE);
|
||||
} else {
|
||||
wait_for_migration_complete(src_qemu);
|
||||
}
|
||||
|
@ -1342,7 +1342,7 @@ static void test_precopy_common(MigrateCommon *args)
|
||||
wait_for_migration_fail(from, allow_active);
|
||||
|
||||
if (args->result == MIG_TEST_FAIL_DEST_QUIT_ERR) {
|
||||
qtest_set_expected_status(to, 1);
|
||||
qtest_set_expected_status(to, EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
if (args->iterations) {
|
||||
@ -1738,7 +1738,7 @@ static void do_test_validate_uuid(MigrateStart *args, bool should_fail)
|
||||
migrate_qmp(from, uri, "{}");
|
||||
|
||||
if (should_fail) {
|
||||
qtest_set_expected_status(to, 1);
|
||||
qtest_set_expected_status(to, EXIT_FAILURE);
|
||||
wait_for_migration_fail(from, true);
|
||||
} else {
|
||||
wait_for_migration_complete(from);
|
||||
|
Loading…
Reference in New Issue
Block a user