All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Ani Sinha <ani@anisinha.ca>,
	Peter Maydell <peter.maydell@linaro.org>,
	Igor Mammedov <imammedo@redhat.com>
Subject: [PULL v2 03/24] tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for test_oem_fields() test
Date: Sun, 6 Feb 2022 04:37:52 -0500	[thread overview]
Message-ID: <20220206093702.1282676-4-mst@redhat.com> (raw)
In-Reply-To: <20220206093702.1282676-1-mst@redhat.com>

From: Igor Mammedov <imammedo@redhat.com>

The next commit will revert OEM fields padding with whitespace to
padding with '\0' as it was before [1]. As result test_oem_fields() will
fail due to unexpectedly smaller ID sizes read from QEMU ACPI tables.

Pad OEM_ID/OEM_TABLE_ID manually with spaces so that values the test
puts on QEMU CLI and expected values match.

1) 602b458201 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20220112130332.1648664-2-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/qtest/bios-tables-test.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index e6b72d9026..90c9f6a0a2 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -71,9 +71,10 @@
 
 #define ACPI_REBUILD_EXPECTED_AML "TEST_ACPI_REBUILD_AML"
 
-#define OEM_ID             "TEST"
-#define OEM_TABLE_ID       "OEM"
-#define OEM_TEST_ARGS      "-machine x-oem-id="OEM_ID",x-oem-table-id="OEM_TABLE_ID
+#define OEM_ID             "TEST  "
+#define OEM_TABLE_ID       "OEM     "
+#define OEM_TEST_ARGS      "-machine x-oem-id='" OEM_ID "',x-oem-table-id='" \
+                           OEM_TABLE_ID "'"
 
 typedef struct {
     bool tcg_only;
@@ -1519,11 +1520,7 @@ static void test_acpi_q35_slic(void)
 static void test_oem_fields(test_data *data)
 {
     int i;
-    char oem_id[6];
-    char oem_table_id[8];
 
-    strpadcpy(oem_id, sizeof oem_id, OEM_ID, ' ');
-    strpadcpy(oem_table_id, sizeof oem_table_id, OEM_TABLE_ID, ' ');
     for (i = 0; i < data->tables->len; ++i) {
         AcpiSdtTable *sdt;
 
@@ -1533,8 +1530,8 @@ static void test_oem_fields(test_data *data)
             continue;
         }
 
-        g_assert(memcmp(sdt->aml + 10, oem_id, 6) == 0);
-        g_assert(memcmp(sdt->aml + 16, oem_table_id, 8) == 0);
+        g_assert(memcmp(sdt->aml + 10, OEM_ID, 6) == 0);
+        g_assert(memcmp(sdt->aml + 16, OEM_TABLE_ID, 8) == 0);
     }
 }
 
-- 
MST



  parent reply	other threads:[~2022-02-06  9:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-06  9:37 [PULL v2 00/24] virtio,pc: features, cleanups, fixes Michael S. Tsirkin
2022-02-06  9:37 ` [PULL v2 01/24] cpuid: use unsigned for max cpuid Michael S. Tsirkin
2022-02-06  9:37 ` [PULL v2 02/24] hw/i386: Add the possibility to disable the 'isapc' machine Michael S. Tsirkin
2022-02-06  9:37 ` Michael S. Tsirkin [this message]
2022-02-06  9:37 ` [PULL v2 04/24] tests: acpi: whitelist nvdimm's SSDT and FACP.slic expected blobs Michael S. Tsirkin
2022-02-06  9:37 ` [PULL v2 05/24] acpi: fix OEM ID/OEM Table ID padding Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 06/24] tests: acpi: update expected blobs Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 07/24] tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields() Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 08/24] libvhost-user: Add vu_rem_mem_reg input validation Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 09/24] libvhost-user: Add vu_add_mem_reg " Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 10/24] libvhost-user: Simplify VHOST_USER_REM_MEM_REG Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 11/24] libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 12/24] libvhost-user: prevent over-running max RAM slots Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 13/24] libvhost-user: handle removal of identical regions Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 14/24] libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 15/24] ACPI ERST: bios-tables-test.c steps 1 and 2 Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 16/24] ACPI ERST: PCI device_id for ERST Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 17/24] ACPI ERST: header file " Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 18/24] ACPI ERST: support for ACPI ERST feature Michael S. Tsirkin
2022-05-12 16:29   ` Peter Maydell
2022-05-13  7:34     ` Ani Sinha
2022-02-06  9:38 ` [PULL v2 19/24] ACPI ERST: build the ACPI ERST table Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 20/24] ACPI ERST: create ACPI ERST table for pc/x86 machines Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 21/24] ACPI ERST: qtest for ERST Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 22/24] ACPI ERST: bios-tables-test testcase Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 23/24] ACPI ERST: step 6 of bios-tables-test.c Michael S. Tsirkin
2022-02-06  9:38 ` [PULL v2 24/24] util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() Michael S. Tsirkin
2022-02-06 18:02 ` [PULL v2 00/24] virtio,pc: features, cleanups, fixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220206093702.1282676-4-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=imammedo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.