[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/40] tests: boot_sector_test: avoid crashing if status is not a
From: |
Igor Mammedov |
Subject: |
[PATCH 13/40] tests: boot_sector_test: avoid crashing if status is not available yet |
Date: |
Thu, 12 Jan 2023 15:02:45 +0100 |
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>
---
CC: Thomas Huth <thuth@redhat.com>
CC: Laurent Vivier <lvivier@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);
--
2.31.1
- [PATCH 20/40] tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinery, (continued)
- [PATCH 20/40] tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinery, Igor Mammedov, 2023/01/12
- [PATCH 25/40] tests: acpi: add endpoint devices to bridges, Igor Mammedov, 2023/01/12
- [PATCH 30/40] pci: make sure pci_bus_is_express() won't error out with "discards ‘const’ qualifier", Igor Mammedov, 2023/01/12
- [PATCH 36/40] pcihp: acpi: ignore coldplugged bridges when composing hotpluggable slots, Igor Mammedov, 2023/01/12
- [PATCH 26/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 32/40] tests: acpi: whitelist DSDT before decoupling PCI hotplug code from basic slots description, Igor Mammedov, 2023/01/12
- [PATCH 37/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 39/40] pcihp: generate populated non-hotpluggble slot descriptions on non-hotplug path, Igor Mammedov, 2023/01/12
- [PATCH 16/40] tests: acpi: add reboot cycle to bridge test, Igor Mammedov, 2023/01/12
- [PATCH 23/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 13/40] tests: boot_sector_test: avoid crashing if status is not available yet,
Igor Mammedov <=
- [PATCH 28/40] pci: acpi: wire up AcpiDevAmlIf interface to generic bridge, Igor Mammedov, 2023/01/12
- [PATCH 21/40] pcihp: compose PCNT callchain right before its user _GPE._E01, Igor Mammedov, 2023/01/12
- [PATCH 07/40] pci_bridge: remove whitespace, Igor Mammedov, 2023/01/12
- [PATCH 04/40] tests: acpi: extend pcihp with nested bridges, Igor Mammedov, 2023/01/12
- [PATCH 31/40] pcihp: isolate rule whether slot should be described in DSDT, Igor Mammedov, 2023/01/12
- [PATCH 24/40] whitelist DSDT before adding endpoint devices to bridge testcases, Igor Mammedov, 2023/01/12
- [PATCH 35/40] tests: acpi: whitelist DSDT blobs before removing dynamic _DSM on coldplugged bridges, Igor Mammedov, 2023/01/12
- [PATCH 33/40] pcihp: acpi: decouple hotplug and generic slots description, Igor Mammedov, 2023/01/12
- [PATCH 34/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 38/40] tests: acpi: whitelist DSDT before moving non-hotpluggble slots description from hotplug path, Igor Mammedov, 2023/01/12