[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/6] tests: Enable the simple virtio tests on s390x,
From: |
Thomas Huth |
Subject: |
[Qemu-devel] [PATCH 6/6] tests: Enable the simple virtio tests on s390x, too |
Date: |
Thu, 17 Aug 2017 08:25:13 +0200 |
Most of the simple virtio test can be used on virtio-ccw on
s390x, too, by simply using the bus-independent alias names
of the devices instead of the device names ending in "-pci".
Hot-plugging can also be tested here - we just have to use
the generic hot plug function instead of the PCI hot plug
function in the qvirtio_plug_device_test() function.
Signed-off-by: Thomas Huth <address@hidden>
---
tests/Makefile.include | 4 ++++
tests/libqos/virtio.c | 4 +++-
tests/virtio-balloon-test.c | 6 +++---
tests/virtio-console-test.c | 12 ++++++------
tests/virtio-rng-test.c | 10 +++++-----
tests/virtio-serial-test.c | 8 ++++----
6 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index e3acdff..ac24aa6 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -364,6 +364,10 @@ check-qtest-s390x-$(CONFIG_SLIRP) +=
tests/test-netfilter$(EXESUF)
check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF)
check-qtest-s390x-y += tests/drive_del-test$(EXESUF)
+check-qtest-s390x-y += tests/virtio-balloon-test$(EXESUF)
+check-qtest-s390x-y += tests/virtio-console-test$(EXESUF)
+check-qtest-s390x-y += tests/virtio-rng-test$(EXESUF)
+check-qtest-s390x-y += tests/virtio-serial-test$(EXESUF)
check-qtest-generic-y += tests/qom-test$(EXESUF)
check-qtest-generic-y += tests/test-hmp$(EXESUF)
diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c
index 87d2e65..5ff9ad6 100644
--- a/tests/libqos/virtio.c
+++ b/tests/libqos/virtio.c
@@ -349,6 +349,8 @@ void qvirtio_plug_device_test(const char *driver, const
char *id,
if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64") ||
g_str_equal(arch, "ppc64")) {
qpci_plug_device_test(driver, id, addr, opts);
+ } else if (g_str_equal(arch, "s390x")) {
+ qtest_hot_plug_device(driver, id, opts ? "%s" : NULL, opts);
} else {
g_assert_not_reached();
}
@@ -360,7 +362,7 @@ void qvirtio_unplug_device_test(const char *id, uint8_t
addr)
if (g_str_equal(arch, "i386") || g_str_equal(arch, "x86_64")) {
qpci_unplug_acpi_device_test(id, addr);
- } else if (g_str_equal(arch, "ppc64")) {
+ } else if (g_str_equal(arch, "ppc64") || g_str_equal(arch, "s390x")) {
qtest_hot_unplug_device(id);
} else {
g_assert_not_reached();
diff --git a/tests/virtio-balloon-test.c b/tests/virtio-balloon-test.c
index 0d0046b..45c95dd 100644
--- a/tests/virtio-balloon-test.c
+++ b/tests/virtio-balloon-test.c
@@ -11,7 +11,7 @@
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
-static void pci_nop(void)
+static void balloon_nop(void)
{
}
@@ -20,9 +20,9 @@ int main(int argc, char **argv)
int ret;
g_test_init(&argc, &argv, NULL);
- qtest_add_func("/virtio/balloon/pci/nop", pci_nop);
+ qtest_add_func("/virtio/balloon/nop", balloon_nop);
- qtest_start("-device virtio-balloon-pci");
+ qtest_start("-device virtio-balloon");
ret = g_test_run();
qtest_end();
diff --git a/tests/virtio-console-test.c b/tests/virtio-console-test.c
index 1c3de07..d15e182 100644
--- a/tests/virtio-console-test.c
+++ b/tests/virtio-console-test.c
@@ -11,16 +11,16 @@
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
-static void console_pci_nop(void)
+static void console_nop(void)
{
- qtest_start("-device virtio-serial-pci,id=vser0 "
+ qtest_start("-device virtio-serial,id=vser0 "
"-device virtconsole,bus=vser0.0");
qtest_end();
}
-static void serialport_pci_nop(void)
+static void serialport_nop(void)
{
- qtest_start("-device virtio-serial-pci,id=vser0 "
+ qtest_start("-device virtio-serial,id=vser0 "
"-device virtserialport,bus=vser0.0");
qtest_end();
}
@@ -28,8 +28,8 @@ static void serialport_pci_nop(void)
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
- qtest_add_func("/virtio/console/pci/nop", console_pci_nop);
- qtest_add_func("/virtio/serialport/pci/nop", serialport_pci_nop);
+ qtest_add_func("/virtio/console/nop", console_nop);
+ qtest_add_func("/virtio/serialport/nop", serialport_nop);
return g_test_run();
}
diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c
index 04c4279..b58352e 100644
--- a/tests/virtio-rng-test.c
+++ b/tests/virtio-rng-test.c
@@ -15,13 +15,13 @@
#define PCI_SLOT_HP 0x06
/* Tests only initialization so far. TODO: Replace with functional tests */
-static void pci_nop(void)
+static void rng_nop(void)
{
}
static void hotplug(void)
{
- qvirtio_plug_device_test("virtio-rng-pci", "rng1", PCI_SLOT_HP, NULL);
+ qvirtio_plug_device_test("virtio-rng", "rng1", PCI_SLOT_HP, NULL);
qvirtio_unplug_device_test("rng1", PCI_SLOT_HP);
}
@@ -31,10 +31,10 @@ int main(int argc, char **argv)
int ret;
g_test_init(&argc, &argv, NULL);
- qtest_add_func("/virtio/rng/pci/nop", pci_nop);
- qtest_add_func("/virtio/rng/pci/hotplug", hotplug);
+ qtest_add_func("/virtio/rng/nop", rng_nop);
+ qtest_add_func("/virtio/rng/hotplug", hotplug);
- qtest_start("-device virtio-rng-pci");
+ qtest_start("-device virtio-rng");
ret = g_test_run();
qtest_end();
diff --git a/tests/virtio-serial-test.c b/tests/virtio-serial-test.c
index 97f8f52..059f211 100644
--- a/tests/virtio-serial-test.c
+++ b/tests/virtio-serial-test.c
@@ -11,7 +11,7 @@
#include "libqtest.h"
/* Tests only initialization so far. TODO: Replace with functional tests */
-static void pci_nop(void)
+static void virtioserial_nop(void)
{
}
@@ -27,10 +27,10 @@ int main(int argc, char **argv)
int ret;
g_test_init(&argc, &argv, NULL);
- qtest_add_func("/virtio/serial/pci/nop", pci_nop);
- qtest_add_func("/virtio/serial/pci/hotplug", hotplug);
+ qtest_add_func("/virtio/serial/nop", virtioserial_nop);
+ qtest_add_func("/virtio/serial/hotplug", hotplug);
- qtest_start("-device virtio-serial-pci");
+ qtest_start("-device virtio-serial");
ret = g_test_run();
qtest_end();
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 3/6] tests: Enable the drive_del test also on s390x, (continued)
[Qemu-devel] [PATCH 4/6] tests: Introduce generic device hot-plug/hot-unplug functions, Thomas Huth, 2017/08/17
[Qemu-devel] [PATCH 5/6] tests: Add qvirtio_(un)plug_device_test wrapper functions, Thomas Huth, 2017/08/17
[Qemu-devel] [PATCH 6/6] tests: Enable the simple virtio tests on s390x, too,
Thomas Huth <=
Re: [Qemu-devel] [PATCH for-2.11 0/6] Enable more qtests for s390x, Cornelia Huck, 2017/08/17