[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/53] tests: acpi: dump table with failed checksum
From: |
Igor Mammedov |
Subject: |
[PATCH 01/53] tests: acpi: dump table with failed checksum |
Date: |
Fri, 25 Jun 2021 05:17:25 -0400 |
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
CC: mst@redhat.com
CC: thuth@redhat.com
CC: lvivier@redhat.com
---
tests/qtest/acpi-utils.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tests/qtest/acpi-utils.c b/tests/qtest/acpi-utils.c
index d2a202efca..766c48e3a6 100644
--- a/tests/qtest/acpi-utils.c
+++ b/tests/qtest/acpi-utils.c
@@ -98,6 +98,20 @@ void acpi_fetch_table(QTestState *qts, uint8_t **aml,
uint32_t *aml_len,
ACPI_ASSERT_CMP(**aml, sig);
}
if (verify_checksum) {
+ if (acpi_calc_checksum(*aml, *aml_len)) {
+ gint fd, ret;
+ char *fname = NULL;
+ GError *error = NULL;
+
+ fprintf(stderr, "Invalid '%.4s'(%d)\n", *aml, *aml_len);
+ fd = g_file_open_tmp("malformed-XXXXXX.dat", &fname, &error);
+ g_assert_no_error(error);
+ fprintf(stderr, "Dumping invalid table into '%s'\n", fname);
+ ret = qemu_write_full(fd, *aml, *aml_len);
+ g_assert(ret == *aml_len);
+ close(fd);
+ g_free(fname);
+ }
g_assert(!acpi_calc_checksum(*aml, *aml_len));
}
}
--
2.27.0
- [PATCH 00/53] acpi: refactor error prone build_header() and packed structures usage in ACPI tables, Igor Mammedov, 2021/06/25
- [PATCH 03/53] tests: acpi: whitelist expected tables for acpi/q35/numamem testcase, Igor Mammedov, 2021/06/25
- [PATCH 01/53] tests: acpi: dump table with failed checksum,
Igor Mammedov <=
- [PATCH 04/53] tests: acpi: q35: test for x2APIC entries in SRAT, Igor Mammedov, 2021/06/25
- [PATCH 06/53] tests: acpi: whitelist new expected table tests/data/acpi/q35/DMAR.dmar, Igor Mammedov, 2021/06/25
- [PATCH 02/53] tests: qtest: add qtest_has_accel() to check if tested binary supports accelerator, Igor Mammedov, 2021/06/25
- [PATCH 07/53] tests: acpi: add testcase for intel_iommu (DMAR table), Igor Mammedov, 2021/06/25
- [PATCH 08/53] tests: acpi: add expected blob for DMAR table, Igor Mammedov, 2021/06/25
- [PATCH 05/53] tests: acpi: update expected tables blobs, Igor Mammedov, 2021/06/25
- [PATCH 09/53] tests: acpi: whitelist expected blobs for new acpi/q35/ivrs testcase, Igor Mammedov, 2021/06/25
- [PATCH 10/53] tests: acpi: add testcase for amd-iommu (IVRS table), Igor Mammedov, 2021/06/25
- [PATCH 15/53] tests: acpi: add expected IORT table blob, Igor Mammedov, 2021/06/25