[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 05/11] tests/qtest: Use EXIT_FAILURE instead of magic numb
From: |
Juan Quintela |
Subject: |
Re: [PATCH v6 05/11] tests/qtest: Use EXIT_FAILURE instead of magic number |
Date: |
Fri, 28 Oct 2022 14:31:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) |
Bin Meng <bin.meng@windriver.com> wrote:
> 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>
Reviewed-by: Juan Quintela <quintela@redhat.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);
- [PATCH v6 00/11] tests/qtest: Enable running qtest on Windows, Bin Meng, 2022/10/28
- [PATCH v6 02/11] tests/qtest: Use send/recv for socket communication, Bin Meng, 2022/10/28
- [PATCH v6 03/11] tests/qtest: Support libqtest to build and run on Windows, Bin Meng, 2022/10/28
- [PATCH v6 04/11] tests/qtest: device-plug-test: Reverse the usage of double/single quotes, Bin Meng, 2022/10/28
- [PATCH v6 01/11] accel/qtest: Support qtest accelerator for Windows, Bin Meng, 2022/10/28
- [PATCH v6 05/11] tests/qtest: Use EXIT_FAILURE instead of magic number, Bin Meng, 2022/10/28
- [PATCH v6 06/11] tests/qtest: libqtest: Introduce qtest_wait_qemu(), Bin Meng, 2022/10/28
- [PATCH v6 07/11] tests/qtest: migration-test: Make sure QEMU process "to" exited after migration is canceled, Bin Meng, 2022/10/28
- [PATCH v6 08/11] tests/qtest: libqos: Do not build virtio-9p unconditionally, Bin Meng, 2022/10/28
- [PATCH v6 09/11] tests/qtest: libqtest: Correct the timeout unit of blocking receive calls for win32, Bin Meng, 2022/10/28