acpi: unit test

This just adds a unit test for previously merged functionality.
 A bit unusual, but we have a contribitor under a deadline,
 let's be nice and merge the unit test right away - does no harm.
 Hopefully this won't be a beginning of a trend ...
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAl90PhkPHG1zdEByZWRo
 YXQuY29tAAoJECgfDbjSjVRp6MIH/isej+gtqmq/N6RTV6cixf/5NYOgWXpIK1aC
 RxA/x979yQKM5FM9doa0LbzPlg+ljPI9rizM0KIqH3tTtAmtpmPbvxVcqlCQI6Uc
 iPLFMbKaBoxkxGKKudGkGxAwfDi27vum2xYggm2iQiDsTsZkn/fIMpgpXmxNnvP4
 PI3XceMs26lRRdNGICVmp7PKlI8wyvXzFPhAwsBo5CCdpr90CgSuFIpthRnrfCID
 usVvoEY9nMItnJ2/6FQZLT2/P9vDVFfpndmslz8Ky1ZcythgxBshdigYfAy2FIAU
 PVcN0a9toCPS5185tIvvCT/LbjfgtwKgB/FawJGM1ScxXWvdgHk=
 =vr3O
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

acpi: unit test

This just adds a unit test for previously merged functionality.
A bit unusual, but we have a contribitor under a deadline,
let's be nice and merge the unit test right away - does no harm.
Hopefully this won't be a beginning of a trend ...

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Wed 30 Sep 2020 09:13:13 BST
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  tests/acpi: add DSDT.hpbrroot DSDT table blob to test global i440fx hotplug
  tests/acpi: unit test exercising global pci hotplug off for i440fx

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-09-30 11:40:38 +01:00
commit cbba3dc6ea
2 changed files with 17 additions and 0 deletions

Binary file not shown.

View File

@ -770,6 +770,21 @@ static void test_acpi_piix4_no_bridge_hotplug(void)
free_test_data(&data);
}
static void test_acpi_piix4_no_acpi_pci_hotplug(void)
{
test_data data;
memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".hpbrroot";
data.required_struct_types = base_required_struct_types;
data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
test_acpi_one("-global PIIX4_PM.acpi-root-pci-hotplug=off "
"-global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off "
"-device pci-bridge,chassis_nr=1", &data);
free_test_data(&data);
}
static void test_acpi_q35_tcg(void)
{
test_data data;
@ -1192,6 +1207,8 @@ int main(int argc, char *argv[])
test_acpi_piix4_no_root_hotplug);
qtest_add_func("acpi/piix4/pci-hotplug/no_bridge_hotplug",
test_acpi_piix4_no_bridge_hotplug);
qtest_add_func("acpi/piix4/pci-hotplug/off",
test_acpi_piix4_no_acpi_pci_hotplug);
qtest_add_func("acpi/q35", test_acpi_q35_tcg);
qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);
qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);