qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [FYI 3/3] qtest: Add virtio-ccw test case


From: Andreas Färber
Subject: [Qemu-ppc] [FYI 3/3] qtest: Add virtio-ccw test case
Date: Wed, 23 Jan 2013 11:01:54 +0100

Signed-off-by: Andreas Färber <address@hidden>
---
 tests/Makefile          |    2 ++
 tests/virtio-ccw-test.c |   38 ++++++++++++++++++++++++++++++++++++++
 2 Dateien geändert, 40 Zeilen hinzugefügt(+)
 create mode 100644 tests/virtio-ccw-test.c

diff --git a/tests/Makefile b/tests/Makefile
index d86e95a..6ab4610 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -62,6 +62,7 @@ check-qtest-sparc64-y = tests/m48t59-test$(EXESUF)
 gcov-files-sparc-y += hw/m48t59.c
 check-qtest-arm-y = tests/tmp105-test$(EXESUF)
 qcov-files-arm-y += hw/tmp105.c
+check-qtest-s390x-y = tests/virtio-ccw-test$(EXESUF)
 
 GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h 
tests/test-qmp-commands.h
 
@@ -111,6 +112,7 @@ tests/m48t59-test$(EXESUF): tests/m48t59-test.o
 tests/fdc-test$(EXESUF): tests/fdc-test.o
 tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
 tests/tmp105-test$(EXESUF): tests/tmp105-test.o
+tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o
 
 # QTest rules
 
diff --git a/tests/virtio-ccw-test.c b/tests/virtio-ccw-test.c
new file mode 100644
index 0000000..8abf8d9
--- /dev/null
+++ b/tests/virtio-ccw-test.c
@@ -0,0 +1,38 @@
+/*
+ * QTest testcase for virtio-ccw
+ *
+ * Copyright (c) 2013 SUSE LINUX Products GmbH
+ *
+ * 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 "libqtest.h"
+
+#include <glib.h>
+
+#define KVM_S390_VIRTIO_RESET           1
+
+static void test(void)
+{
+    hypercall(KVM_S390_VIRTIO_RESET, 1, 128 * 1024 * 1024);
+}
+
+int main(int argc, char **argv)
+{
+    QTestState *s = NULL;
+    int ret;
+
+    g_test_init(&argc, &argv, NULL);
+
+    s = qtest_start("-display none -m 128M");
+
+    qtest_add_func("/virtio-ccw/dummy", test);
+
+    ret = g_test_run();
+
+    if (s) {
+        qtest_quit(s);
+    }
+
+    return ret;
+}
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]