From: Bin Meng <bin.meng@windriver.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>
Subject: [PATCH v6 05/11] tests/qtest: Use EXIT_FAILURE instead of magic number
Date: Fri, 28 Oct 2022 12:57:30 +0800 [thread overview]
Message-ID: <20221028045736.679903-6-bin.meng@windriver.com> (raw)
In-Reply-To: <20221028045736.679903-1-bin.meng@windriver.com>
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>
---
Changes in v6:
- new patch: "tests/qtest: Use EXIT_FAILURE instead of magic number"
tests/qtest/dbus-vmstate-test.c | 2 +-
tests/qtest/migration-test.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/qtest/dbus-vmstate-test.c b/tests/qtest/dbus-vmstate-test.c
index 74ede651f6..6c990864e3 100644
--- a/tests/qtest/dbus-vmstate-test.c
+++ b/tests/qtest/dbus-vmstate-test.c
@@ -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);
}
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index aa1ba179fa..28a06d8170 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -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);
--
2.25.1
next prev parent reply other threads:[~2022-10-28 5:04 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 4:57 [PATCH v6 00/11] tests/qtest: Enable running qtest on Windows Bin Meng
2022-10-28 4:57 ` [PATCH v6 01/11] accel/qtest: Support qtest accelerator for Windows Bin Meng
2022-10-28 4:57 ` [PATCH v6 02/11] tests/qtest: Use send/recv for socket communication Bin Meng
2022-10-28 4:57 ` [PATCH v6 03/11] tests/qtest: Support libqtest to build and run on Windows Bin Meng
2022-10-28 4:57 ` [PATCH v6 04/11] tests/qtest: device-plug-test: Reverse the usage of double/single quotes Bin Meng
2022-10-28 7:49 ` Thomas Huth
2022-10-28 4:57 ` Bin Meng [this message]
2022-10-28 8:02 ` [PATCH v6 05/11] tests/qtest: Use EXIT_FAILURE instead of magic number Thomas Huth
2022-10-28 12:31 ` Juan Quintela
2022-10-28 4:57 ` [PATCH v6 06/11] tests/qtest: libqtest: Introduce qtest_wait_qemu() Bin Meng
2022-10-28 8:05 ` Thomas Huth
2022-10-28 4:57 ` [PATCH v6 07/11] tests/qtest: migration-test: Make sure QEMU process "to" exited after migration is canceled Bin Meng
2022-10-28 13:34 ` Juan Quintela
2022-10-28 4:57 ` [PATCH v6 08/11] tests/qtest: libqos: Do not build virtio-9p unconditionally Bin Meng
2022-10-28 7:56 ` Thomas Huth
2022-10-28 12:59 ` Christian Schoenebeck
2022-10-28 13:09 ` Thomas Huth
2022-10-28 13:34 ` Christian Schoenebeck
2022-10-28 4:57 ` [PATCH v6 09/11] tests/qtest: libqtest: Correct the timeout unit of blocking receive calls for win32 Bin Meng
2022-10-28 4:57 ` [PATCH v6 10/11] .gitlab-ci.d/windows.yml: Increase the timeout to 90 minutes Bin Meng
2022-10-28 4:57 ` [PATCH v6 11/11] tests/qtest: Enable qtest build on Windows Bin Meng
2022-11-23 14:13 ` Marc-André Lureau
2022-11-23 14:19 ` Thomas Huth
2022-11-24 11:17 ` Marc-André Lureau
2022-11-24 11:49 ` Thomas Huth
2022-11-24 12:00 ` Marc-André Lureau
2022-11-25 10:04 ` Bin Meng
2022-10-28 8:06 ` [PATCH v6 00/11] tests/qtest: Enable running qtest " Marc-André Lureau
2022-10-28 9:20 ` Bin Meng
2022-10-28 9:40 ` Marc-André Lureau
2022-10-28 9:43 ` Bin Meng
2022-10-28 11:49 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221028045736.679903-6-bin.meng@windriver.com \
--to=bin.meng@windriver.com \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).