[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/56] tests: boot_sector_test: avoid crashing if status is not av
From: |
Michael S. Tsirkin |
Subject: |
[PULL 23/56] tests: boot_sector_test: avoid crashing if status is not available yet |
Date: |
Mon, 30 Jan 2023 15:19:58 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
If test case was started in paused mode (-S CLI option) and then
allowed to continue via QMP, boot_sector_test could assert on
transient state with following error:
assertion failed (qdict_get_try_str(qret, "status") == "running"): (NULL ==
"running")
Instead of crashing test if 'status' is not available yet, skip check
and repeat iteration again after TEST_DELAY has elapsed.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20230112140312.3096331-14-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/qtest/boot-sector.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/boot-sector.c b/tests/qtest/boot-sector.c
index 44a109abd8..d3f68018e7 100644
--- a/tests/qtest/boot-sector.c
+++ b/tests/qtest/boot-sector.c
@@ -160,7 +160,9 @@ void boot_sector_test(QTestState *qts)
qrsp = qtest_qmp(qts, "{ 'execute': 'query-status' }");
qret = qdict_get_qdict(qrsp, "return");
g_assert_nonnull(qret);
- g_assert_cmpstr(qdict_get_try_str(qret, "status"), ==, "running");
+ if (qdict_get_try_str(qret, "status")) {
+ g_assert_cmpstr(qdict_get_try_str(qret, "status"), ==, "running");
+ }
qobject_unref(qrsp);
g_usleep(TEST_DELAY);
--
MST
- [PULL 14/56] tests: acpi: extend pcihp with nested bridges, (continued)
- [PULL 14/56] tests: acpi: extend pcihp with nested bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 15/56] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/01/30
- [PULL 17/56] pci_bridge: remove whitespace, Michael S. Tsirkin, 2023/01/30
- [PULL 16/56] tests: acpi: cleanup use_uefi argument usage, Michael S. Tsirkin, 2023/01/30
- [PULL 20/56] pcihp: piix4: do not call acpi_pcihp_reset() when ACPI PCI hotplug is disabled, Michael S. Tsirkin, 2023/01/30
- [PULL 01/56] shpc: disallow unplug when power indicator is blinking, Michael S. Tsirkin, 2023/01/30
- [PULL 18/56] x86: acpi: pcihp: clean up duplicate bridge_in_acpi assignment, Michael S. Tsirkin, 2023/01/30
- [PULL 19/56] pci: acpi hotplug: rename x-native-hotplug to x-do-not-expose-native-hotplug-cap, Michael S. Tsirkin, 2023/01/30
- [PULL 24/56] tests: acpi: extend bridge tests with hotplugged bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 22/56] x86: pcihp: fix invalid AML PCNT calls to hotplugged bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 23/56] tests: boot_sector_test: avoid crashing if status is not available yet,
Michael S. Tsirkin <=
- [PULL 11/56] tests: qtest: print device_add error before failing test, Michael S. Tsirkin, 2023/01/30
- [PULL 28/56] pcihp: drop pcihp_bridge_en dependency when composing PCNT method, Michael S. Tsirkin, 2023/01/30
- [PULL 27/56] tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinery, Michael S. Tsirkin, 2023/01/30
- [PULL 29/56] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/01/30
- [PULL 21/56] pci: acpihp: assign BSEL only to coldplugged bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 30/56] tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinery, Michael S. Tsirkin, 2023/01/30
- [PULL 31/56] pcihp: compose PCNT callchain right before its user _GPE._E01, Michael S. Tsirkin, 2023/01/30
- [PULL 33/56] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/01/30
- [PULL 38/56] pci: acpi: wire up AcpiDevAmlIf interface to generic bridge, Michael S. Tsirkin, 2023/01/30
- [PULL 35/56] tests: acpi: add endpoint devices to bridges, Michael S. Tsirkin, 2023/01/30