aboutsummaryrefslogtreecommitdiff
path: root/tests/spapr-phb-test.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>2018-08-17 13:35:12 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-07 17:28:46 +0100
commitdca063065a5687cbcc2118f5d5bce8f7654cae54 (patch)
tree3ea0a43564e04f40003315f537c7d9d1af6a8923 /tests/spapr-phb-test.c
parent96900e1610a6429ee5c1a84b663543a12c9ecae1 (diff)
qos-test: spapr-phb test node
Convert tests/spapr-phb-test to a qgraph test node, spapr-phb-test. This test adds another spapr-pci-host-bridge device in the ppc64/pseries machine Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/spapr-phb-test.c')
-rw-r--r--tests/spapr-phb-test.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
index d3522ea093..39b5766710 100644
--- a/tests/spapr-phb-test.c
+++ b/tests/spapr-phb-test.c
@@ -7,29 +7,25 @@
* 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 "qemu/osdep.h"
#include "libqtest.h"
+#include "libqos/qgraph.h"
-#define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge"
-
-/* Tests only initialization so far. TODO: Replace with functional tests */
-static void test_phb_device(void)
+/* Tests only initialization so far. TODO: Replace with functional tests,
+ * for example by producing pci-bus.
+ */
+static void test_phb_device(void *obj, void *data, QGuestAllocator *alloc)
{
}
-int main(int argc, char **argv)
+static void register_phb_test(void)
{
- int ret;
-
- g_test_init(&argc, &argv, NULL);
- qtest_add_func("/spapr-phb/device", test_phb_device);
-
- qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=30");
-
- ret = g_test_run();
-
- qtest_end();
-
- return ret;
+ qos_add_test("spapr-phb-test", "ppc64/pseries",
+ test_phb_device, &(QOSGraphTestOptions) {
+ .edge.before_cmd_line = "-device spapr-pci-host-bridge"
+ ",index=30",
+ });
}
+
+libqos_init(register_phb_test);