[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 47/71] qos-test: virtio-rng test node
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 47/71] qos-test: virtio-rng test node |
Date: |
Mon, 3 Dec 2018 16:33:00 +0100 |
From: Emanuele Giuseppe Esposito <address@hidden>
Convert tests/virtio-rng-test in qgraph test node,
virtio-rng-test. This test consumes a virtio-rng interface
and checks that its function return the expected values.
Some functions are implemented only for virtio-rng-pci, so they
don't consume virtio-rng, but virtio-rng-pci
Note that this test does not allocate any virtio-rng structure,
it's all done by the qtest walking graph mechanism
Signed-off-by: Emanuele Giuseppe Esposito <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
tests/Makefile.include | 3 +--
tests/virtio-rng-test.c | 27 +++++++--------------------
2 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 00ca6e8..a7c01a3 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -145,7 +145,6 @@ check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
-check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
check-qtest-pci-y += tests/e1000-test$(EXESUF)
@@ -690,6 +689,7 @@ qos-test-obj-y += tests/pci-test.o
qos-test-obj-y += tests/sdhci-test.o
qos-test-obj-y += tests/virtio-test.o
qos-test-obj-y += tests/virtio-9p-test.o
+qos-test-obj-y += tests/virtio-rng-test.o
qos-test-obj-y += tests/virtio-serial-test.o
check-unit-y += tests/test-qgraph$(EXESUF)
@@ -738,7 +738,6 @@ tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y)
tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y)
tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o
tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y)
$(libqos-virtio-obj-y)
-tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y)
tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
$(libqos-virtio-obj-y)
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/display-vga-test$(EXESUF): tests/display-vga-test.o
diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c
index 657d9a4..5309c7c 100644
--- a/tests/virtio-rng-test.c
+++ b/tests/virtio-rng-test.c
@@ -9,16 +9,12 @@
#include "qemu/osdep.h"
#include "libqtest.h"
-#include "libqos/pci.h"
+#include "libqos/qgraph.h"
+#include "libqos/virtio-rng.h"
#define PCI_SLOT_HP 0x06
-/* Tests only initialization so far. TODO: Replace with functional tests */
-static void pci_nop(void)
-{
-}
-
-static void hotplug(void)
+static void rng_hotplug(void *obj, void *data, QGuestAllocator *alloc)
{
const char *arch = qtest_get_arch();
@@ -30,18 +26,9 @@ static void hotplug(void)
}
}
-int main(int argc, char **argv)
+static void register_virtio_rng_test(void)
{
- 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_start("-device virtio-rng-pci");
- ret = g_test_run();
-
- qtest_end();
-
- return ret;
+ qos_add_test("hotplug", "virtio-rng-pci", rng_hotplug, NULL);
}
+
+libqos_init(register_virtio_rng_test);
--
1.8.3.1
- [Qemu-devel] [PATCH 38/71] tests/libqos: arm/virt machine node, (continued)
- [Qemu-devel] [PATCH 38/71] tests/libqos: arm/virt machine node, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 36/71] tests/libqos: remove global_qtest from virtio endianness checks, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 34/71] qos-test: e1000e test node, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 39/71] tests/qgraph: add generic virtio testcases, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 41/71] qos-test: virtio-console and virtio-serial test node, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 42/71] tests/libqos: virtio-9p driver and interface nodes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 40/71] tests/libqos: virtio-serial driver and interface nodes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 44/71] tests/libqos: virtio-balloon driver and interface nodes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 43/71] qos-test: virtio-9p test node, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 45/71] tests/qgraph: remove virtio-balloon-test, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 47/71] qos-test: virtio-rng test node,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 46/71] tests/libqos: virtio-rng driver and interface nodes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 48/71] tests/libqos: virtio-blk driver and interface nodes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 49/71] qos-test: virtio-blk test node, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 51/71] qos-test: virtio-net test node, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 50/71] tests/libqos: virtio-net driver and interface nodes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 52/71] tests/libqos: support multiqueue for virtio-net, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 53/71] vhost-user-test: always use 256 MiB of guest memory, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 54/71] qos-test: vhost-user test node, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 55/71] tests/libqos: virtio-scsi driver and interface nodes, Paolo Bonzini, 2018/12/03
- [Qemu-devel] [PATCH 56/71] qos-test: virtio-scsi test node, Paolo Bonzini, 2018/12/03