]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
tests/qtest: cleanup the testcase for bug 1878642
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Mar 2021 08:44:42 +0000 (04:44 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Mar 2021 14:37:46 +0000 (10:37 -0400)
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>
tests/qtest/fuzz-test.c [deleted file]
tests/qtest/lpc-ich9-test.c [new file with mode: 0644]
tests/qtest/meson.build

diff --git a/tests/qtest/fuzz-test.c b/tests/qtest/fuzz-test.c
deleted file mode 100644 (file)
index 00149ab..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * QTest testcase for fuzz 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, 0x8400f841);
-    qtest_outl(s, 0xcfc, 0xebed205d);
-    qtest_outl(s, 0x5d02, 0xebed205d);
-    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("fuzz/test_lp1878642_pci_bus_get_irq_level_assert",
-                       test_lp1878642_pci_bus_get_irq_level_assert);
-    }
-
-    return g_test_run();
-}
diff --git a/tests/qtest/lpc-ich9-test.c b/tests/qtest/lpc-ich9-test.c
new file mode 100644 (file)
index 0000000..fe0bef9
--- /dev/null
@@ -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();
+}
index 6e871077c18a633548f8678f6afc56b70d5c1763..9731606c3154fd2c64ca24e66a1674031aaf3fe9 100644 (file)
@@ -57,6 +57,7 @@ qtests_i386 = \
   (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) +                    \
   (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) +             \
   (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) +                  \
+  (config_all_devices.has_key('CONFIG_LPC_ICH9') ? ['lpc-ich9-test'] : []) +              \
   (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_USB_UHCI') and                                        \
    config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) +            \
@@ -74,7 +75,6 @@ qtests_i386 = \
    'bios-tables-test',
    'rtc-test',
    'i440fx-test',
-   'fuzz-test',
    'fw_cfg-test',
    'device-plug-test',
    'drive_del-test',