[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 15/65] unit-test: Add testcase for pxb
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 15/65] unit-test: Add testcase for pxb |
Date: |
Wed, 9 Dec 2020 13:07:52 -0500 |
From: Yubo Miao <miaoyubo@huawei.com>
Add testcase for pxb to make sure the ACPI table is correct for guest.
Signed-off-by: Yubo Miao <miaoyubo@huawei.com>
Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
Message-Id: <20201119014841.7298-9-cenjiahui@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/qtest/bios-tables-test.c | 58 ++++++++++++++++++++++++++++++----
1 file changed, 52 insertions(+), 6 deletions(-)
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index f23a5335a8..64a9a772ee 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -671,12 +671,21 @@ static void test_acpi_one(const char *params, test_data
*data)
* TODO: convert '-drive if=pflash' to new syntax (see e33763be7cd3)
* when arm/virt boad starts to support it.
*/
- args = g_strdup_printf("-machine %s %s -accel tcg -nodefaults
-nographic "
- "-drive if=pflash,format=raw,file=%s,readonly "
- "-drive if=pflash,format=raw,file=%s,snapshot=on -cdrom %s %s",
- data->machine, data->tcg_only ? "" : "-accel kvm",
- data->uefi_fl1, data->uefi_fl2, data->cd, params ? params : "");
-
+ if (data->cd) {
+ args = g_strdup_printf("-machine %s %s -accel tcg "
+ "-nodefaults -nographic "
+ "-drive if=pflash,format=raw,file=%s,readonly "
+ "-drive if=pflash,format=raw,file=%s,snapshot=on -cdrom %s %s",
+ data->machine, data->tcg_only ? "" : "-accel kvm",
+ data->uefi_fl1, data->uefi_fl2, data->cd, params ? params :
"");
+ } else {
+ args = g_strdup_printf("-machine %s %s -accel tcg "
+ "-nodefaults -nographic "
+ "-drive if=pflash,format=raw,file=%s,readonly "
+ "-drive if=pflash,format=raw,file=%s,snapshot=on %s",
+ data->machine, data->tcg_only ? "" : "-accel kvm",
+ data->uefi_fl1, data->uefi_fl2, params ? params : "");
+ }
} else {
args = g_strdup_printf("-machine %s %s -accel tcg "
"-net none -display none %s "
@@ -1176,6 +1185,40 @@ static void test_acpi_virt_tcg_numamem(void)
}
+#ifdef CONFIG_PXB
+static void test_acpi_virt_tcg_pxb(void)
+{
+ test_data data = {
+ .machine = "virt",
+ .tcg_only = true,
+ .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
+ .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
+ .ram_start = 0x40000000ULL,
+ .scan_len = 128ULL * 1024 * 1024,
+ };
+ /*
+ * While using -cdrom, the cdrom would auto plugged into pxb-pcie,
+ * the reason is the bus of pxb-pcie is also root bus, it would lead
+ * to the error only PCI/PCIE bridge could plug onto pxb.
+ * Therefore,thr cdrom is defined and plugged onto the scsi controller
+ * to solve the conflicts.
+ */
+ data.variant = ".pxb";
+ test_acpi_one(" -device pcie-root-port,chassis=1,id=pci.1"
+ " -device virtio-scsi-pci,id=scsi0,bus=pci.1"
+ " -drive file="
+
"tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2,"
+ "if=none,media=cdrom,id=drive-scsi0-0-0-1,readonly=on"
+ " -device scsi-cd,bus=scsi0.0,scsi-id=0,"
+ "drive=drive-scsi0-0-0-1,id=scsi0-0-0-1,bootindex=1"
+ " -cpu cortex-a57"
+ " -device pxb-pcie,bus_nr=128",
+ &data);
+
+ free_test_data(&data);
+}
+#endif
+
static void test_acpi_tcg_acpi_hmat(const char *machine)
{
test_data data;
@@ -1287,6 +1330,9 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/virt", test_acpi_virt_tcg);
qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
+#ifdef CONFIG_PXB
+ qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);
+#endif
}
ret = g_test_run();
boot_sector_cleanup(disk);
--
MST
- [PULL v2 08/65] acpi/gpex: Extract two APIs from acpi_dsdt_add_pci, (continued)
- [PULL v2 08/65] acpi/gpex: Extract two APIs from acpi_dsdt_add_pci, Michael S. Tsirkin, 2020/12/09
- [PULL v2 09/65] fw_cfg: Refactor extra pci roots addition, Michael S. Tsirkin, 2020/12/09
- [PULL v2 10/65] hw/arm/virt: Write extra pci roots into fw_cfg, Michael S. Tsirkin, 2020/12/09
- [PULL v2 12/65] acpi/gpex: Build tables for pxb, Michael S. Tsirkin, 2020/12/09
- [PULL v2 11/65] acpi: Extract crs build form acpi_build.c, Michael S. Tsirkin, 2020/12/09
- [PULL v2 13/65] acpi: Align the size to 128k, Michael S. Tsirkin, 2020/12/09
- [PULL v2 14/65] unit-test: The files changed., Michael S. Tsirkin, 2020/12/09
- [PULL v2 16/65] unit-test: Add the binary file and clear diff.h, Michael S. Tsirkin, 2020/12/09
- [PULL v2 17/65] failover: fix indentantion, Michael S. Tsirkin, 2020/12/09
- [PULL v2 18/65] failover: Use always atomics for primary_should_be_hidden, Michael S. Tsirkin, 2020/12/09
- [PULL v2 15/65] unit-test: Add testcase for pxb,
Michael S. Tsirkin <=
- [PULL v2 20/65] failover: Remove unused parameter, Michael S. Tsirkin, 2020/12/09
- [PULL v2 19/65] failover: primary bus is only used once, and where it is set, Michael S. Tsirkin, 2020/12/09
- [PULL v2 22/65] failover: qdev_device_add() returns err or dev set, Michael S. Tsirkin, 2020/12/09
- [PULL v2 21/65] failover: Remove external partially_hotplugged property, Michael S. Tsirkin, 2020/12/09
- [PULL v2 23/65] failover: Rename bool to failover_primary_hidden, Michael S. Tsirkin, 2020/12/09
- [PULL v2 24/65] failover: g_strcmp0() knows how to handle NULL, Michael S. Tsirkin, 2020/12/09
- [PULL v2 25/65] failover: Remove primary_device_opts, Michael S. Tsirkin, 2020/12/09
- [PULL v2 26/65] failover: remove standby_id variable, Michael S. Tsirkin, 2020/12/09
- [PULL v2 27/65] failover: Remove primary_device_dict, Michael S. Tsirkin, 2020/12/09
- [PULL v2 28/65] failover: Remove memory leak, Michael S. Tsirkin, 2020/12/09