tests/qtest: drop 'fuzz-' prefix from virtio-balloon test
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 29 Nov 2024 13:55:06 +0000 (13:55 +0000)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 3 Dec 2024 11:26:24 +0000 (12:26 +0100)
This test file is expected to be extended for arbitrary virtio-balloon
related tests, not merely those discovered by fuzzing.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20241129135507.699030-3-berrange@redhat.com>
[PMD: Update MAINTAINERS]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
MAINTAINERS
tests/qtest/fuzz-virtio-balloon-test.c [deleted file]
tests/qtest/meson.build
tests/qtest/virtio-balloon-test.c [new file with mode: 0644]

index f92be0477565ac73b0a4a8b66f4343f909e19488..aaf0505a21466f839f38b8acec09d4fba94c1711 100644 (file)
@@ -2228,6 +2228,7 @@ F: hw/virtio/virtio-balloon*.c
 F: include/hw/virtio/virtio-balloon.h
 F: system/balloon.c
 F: include/sysemu/balloon.h
+F: tests/qtest/virtio-balloon-test.c
 
 virtio-9p
 M: Greg Kurz <groug@kaod.org>
diff --git a/tests/qtest/fuzz-virtio-balloon-test.c b/tests/qtest/fuzz-virtio-balloon-test.c
deleted file mode 100644 (file)
index ecb597f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * QTest fuzzer-generated testcase for virtio balloon device
- *
- * Copyright (c) 2024 Gao Shiyuan <gaoshiyuan@baidu.com>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#include "qemu/osdep.h"
-#include "libqtest.h"
-
-/*
- * https://gitlab.com/qemu-project/qemu/-/issues/2576
- * Used to trigger:
- *   virtio_address_space_lookup: Assertion `mrs.mr' failed.
- */
-static void oss_fuzz_71649(void)
-{
-    QTestState *s = qtest_init("-device virtio-balloon -machine q35"
-                               " -nodefaults");
-
-    qtest_outl(s, 0xcf8, 0x80000890);
-    qtest_outl(s, 0xcfc, 0x2);
-    qtest_outl(s, 0xcf8, 0x80000891);
-    qtest_inl(s, 0xcfc);
-    qtest_quit(s);
-}
-
-int main(int argc, char **argv)
-{
-    g_test_init(&argc, &argv, NULL);
-
-    qtest_add_func("fuzz/virtio/oss_fuzz_71649", oss_fuzz_71649);
-
-    return g_test_run();
-}
-
index f2f35367ae7c11abeb3c38ed1e30a20426295fb5..bd41c9da5fd96db206a8f9c6f4772796b983111c 100644 (file)
@@ -88,7 +88,7 @@ qtests_i386 = \
   (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) +    \
   (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) +     \
   (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) +     \
-  (config_all_devices.has_key('CONFIG_VIRTIO_BALLOON') ? ['fuzz-virtio-balloon-test'] : []) + \
+  (config_all_devices.has_key('CONFIG_VIRTIO_BALLOON') ? ['virtio-balloon-test'] : []) + \
   (config_all_devices.has_key('CONFIG_Q35') ? ['q35-test'] : []) +                          \
   (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) +                   \
   (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) +            \
diff --git a/tests/qtest/virtio-balloon-test.c b/tests/qtest/virtio-balloon-test.c
new file mode 100644 (file)
index 0000000..6bea33b
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * QTest test cases for virtio balloon device
+ *
+ * Copyright (c) 2024 Gao Shiyuan <gaoshiyuan@baidu.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "libqtest.h"
+
+/*
+ * https://gitlab.com/qemu-project/qemu/-/issues/2576
+ * Used to trigger:
+ *   virtio_address_space_lookup: Assertion `mrs.mr' failed.
+ */
+static void oss_fuzz_71649(void)
+{
+    QTestState *s = qtest_init("-device virtio-balloon -machine q35"
+                               " -nodefaults");
+
+    qtest_outl(s, 0xcf8, 0x80000890);
+    qtest_outl(s, 0xcfc, 0x2);
+    qtest_outl(s, 0xcf8, 0x80000891);
+    qtest_inl(s, 0xcfc);
+    qtest_quit(s);
+}
+
+int main(int argc, char **argv)
+{
+    g_test_init(&argc, &argv, NULL);
+
+    qtest_add_func("virtio-balloon/oss_fuzz_71649", oss_fuzz_71649);
+
+    return g_test_run();
+}
+