diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-03-19 04:44:42 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-03-19 10:37:46 -0400 |
commit | af05ffffd7fa28010d4df9f5744514b16e71055d (patch) | |
tree | 87ad74379bd1c43d4edc1bbb4252caa08d22317e /tests/qtest/lpc-ich9-test.c | |
parent | 52ad57a9b68e215c4f5fa2cfd2412132b522bff5 (diff) | |
download | qemu-af05ffffd7fa28010d4df9f5744514b16e71055d.zip qemu-af05ffffd7fa28010d4df9f5744514b16e71055d.tar.gz qemu-af05ffffd7fa28010d4df9f5744514b16e71055d.tar.bz2 |
tests/qtest: cleanup the testcase for bug 1878642
Clean up the writes to the configuration space and the PM region, and
rename the test to lpc-ich9-test.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/qtest/lpc-ich9-test.c')
-rw-r--r-- | tests/qtest/lpc-ich9-test.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/qtest/lpc-ich9-test.c b/tests/qtest/lpc-ich9-test.c new file mode 100644 index 0000000..fe0bef9 --- /dev/null +++ b/tests/qtest/lpc-ich9-test.c @@ -0,0 +1,41 @@ +/* + * QTest testcases for ich9 case + * + * Copyright (c) 2020 Li Qiang <liq3ea@gmail.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" + +#include "libqos/libqtest.h" + +static void test_lp1878642_pci_bus_get_irq_level_assert(void) +{ + QTestState *s; + + s = qtest_init("-M pc-q35-5.0 " + "-nographic -monitor none -serial none"); + + qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */ + qtest_outl(s, 0xcfc, 0x5d00); + qtest_outl(s, 0xcf8, 0x8000f844); /* ACPI_CTRL */ + qtest_outl(s, 0xcfc, 0xeb); + qtest_outw(s, 0x5d02, 0x205d); + qtest_quit(s); +} + +int main(int argc, char **argv) +{ + const char *arch = qtest_get_arch(); + + g_test_init(&argc, &argv, NULL); + + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + qtest_add_func("ich9/test_lp1878642_pci_bus_get_irq_level_assert", + test_lp1878642_pci_bus_get_irq_level_assert); + } + + return g_test_run(); +} |