[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/29] tests: acpi: dump table with failed checksum
From: |
Michael S. Tsirkin |
Subject: |
[PULL 01/29] tests: acpi: dump table with failed checksum |
Date: |
Tue, 19 Oct 2021 07:19:40 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20210902113551.461632-2-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@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));
}
}
--
MST
- [PULL 00/29] pc,pci,virtio: features, fixes, Michael S. Tsirkin, 2021/10/19
- [PULL 01/29] tests: acpi: dump table with failed checksum,
Michael S. Tsirkin <=
- [PULL 02/29] tests: qtest: add qtest_has_accel() to check if tested binary supports accelerator, Michael S. Tsirkin, 2021/10/19
- [PULL 03/29] tests: acpi: whitelist expected tables for acpi/q35/xapic testcase, Michael S. Tsirkin, 2021/10/19
- [PULL 04/29] tests: acpi: q35: test for x2APIC entries in SRAT, Michael S. Tsirkin, 2021/10/19
- [PULL 06/29] tests: acpi: whitelist new expected table tests/data/acpi/q35/DMAR.dmar, Michael S. Tsirkin, 2021/10/19
- [PULL 11/29] tests: acpi: update expected blobs, Michael S. Tsirkin, 2021/10/19
- [PULL 07/29] tests: acpi: add testcase for intel_iommu (DMAR table), Michael S. Tsirkin, 2021/10/19
- [PULL 09/29] tests: acpi: whitelist expected blobs for new acpi/q35/ivrs testcase, Michael S. Tsirkin, 2021/10/19
- [PULL 08/29] tests: acpi: add expected blob for DMAR table, Michael S. Tsirkin, 2021/10/19
- [PULL 13/29] tests: arm-cpu-features: use qtest_has_kvm() API, Michael S. Tsirkin, 2021/10/19
- [PULL 19/29] virtio-iommu: Remove the non transitional name, Michael S. Tsirkin, 2021/10/19