* [Qemu-devel] [PATCH qom-next v3 01/15] tests: Clean up IndustryPack TCPI200 gcov paths
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 02/15] tests: Add virtio-blk qtest Andreas Färber
` (13 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile b/tests/Makefile
index e146f81..1dc24c8 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -87,9 +87,9 @@ gcov-files-pci-y += hw/net/ne2000.c
check-qtest-pci-y += $(check-qtest-virtio-y)
gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c
check-qtest-pci-y += tests/tpci200-test$(EXESUF)
-gcov-files-pci-y += hw/char/tpci200.c
+gcov-files-pci-y += hw/ipack/tpci200.c
check-qtest-pci-y += $(check-qtest-ipack-y)
-gcov-files-pci-y += $(gcov-files-ipack-y) hw/ipack/tpci200.c
+gcov-files-pci-y += $(gcov-files-ipack-y)
check-qtest-i386-y = tests/endianness-test$(EXESUF)
check-qtest-i386-y += tests/fdc-test$(EXESUF)
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 02/15] tests: Add virtio-blk qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 01/15] tests: Clean up IndustryPack TCPI200 gcov paths Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 03/15] tests: Add virtio-balloon qtest Andreas Färber
` (12 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Andreas Färber
Cc: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/virtio-blk-test.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
create mode 100644 tests/virtio-blk-test.c
diff --git a/tests/Makefile b/tests/Makefile
index 1dc24c8..d5a3f10 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,6 +72,8 @@ gcov-files-ipack-y += hw/char/ipoctal232.c
gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c
check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
+check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
+gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
check-qtest-pci-y += tests/e1000-test$(EXESUF)
gcov-files-pci-y += hw/net/e1000.c
@@ -239,6 +241,7 @@ tests/pcnet-test$(EXESUF): tests/pcnet-test.o
tests/eepro100-test$(EXESUF): tests/eepro100-test.o
tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
tests/ne2000-test$(EXESUF): tests/ne2000-test.o
+tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
new file mode 100644
index 0000000..d53f875
--- /dev/null
+++ b/tests/virtio-blk-test.c
@@ -0,0 +1,34 @@
+/*
+ * QTest testcase for VirtIO Block Device
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void pci_nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/virtio/blk/pci/nop", pci_nop);
+
+ qtest_start("-drive id=drv0,if=none,file=/dev/null "
+ "-device virtio-blk-pci,drive=drv0");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 03/15] tests: Add virtio-balloon qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 01/15] tests: Clean up IndustryPack TCPI200 gcov paths Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 02/15] tests: Add virtio-blk qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 04/15] tests: Add virtio-rng qtest Andreas Färber
` (11 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Michael S. Tsirkin
Cc: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/virtio-balloon-test.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
create mode 100644 tests/virtio-balloon-test.c
diff --git a/tests/Makefile b/tests/Makefile
index d5a3f10..d4f23df 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,6 +72,8 @@ gcov-files-ipack-y += hw/char/ipoctal232.c
gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c
check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
+check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
+gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c
check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
@@ -241,6 +243,7 @@ tests/pcnet-test$(EXESUF): tests/pcnet-test.o
tests/eepro100-test$(EXESUF): tests/eepro100-test.o
tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
tests/ne2000-test$(EXESUF): tests/ne2000-test.o
+tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
diff --git a/tests/virtio-balloon-test.c b/tests/virtio-balloon-test.c
new file mode 100644
index 0000000..becebb5
--- /dev/null
+++ b/tests/virtio-balloon-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for VirtIO Balloon
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void pci_nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/virtio/balloon/pci/nop", pci_nop);
+
+ qtest_start("-device virtio-balloon-pci");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 04/15] tests: Add virtio-rng qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (2 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 03/15] tests: Add virtio-balloon qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 05/15] tests: Add virtio-scsi qtest Andreas Färber
` (10 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber, Michael S. Tsirkin
Cc: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/virtio-rng-test.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
create mode 100644 tests/virtio-rng-test.c
diff --git a/tests/Makefile b/tests/Makefile
index d4f23df..308a5a2 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -76,6 +76,8 @@ check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio-balloon.c
check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
+check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
+gcov-files-virtio-y += hw/virtio/virtio-rng.c
check-qtest-pci-y += tests/e1000-test$(EXESUF)
gcov-files-pci-y += hw/net/e1000.c
@@ -246,6 +248,7 @@ tests/ne2000-test$(EXESUF): tests/ne2000-test.o
tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
+tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/qom-test$(EXESUF): tests/qom-test.o
diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c
new file mode 100644
index 0000000..402c206
--- /dev/null
+++ b/tests/virtio-rng-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for VirtIO RNG
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void pci_nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/virtio/rng/pci/nop", pci_nop);
+
+ qtest_start("-device virtio-rng-pci");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 05/15] tests: Add virtio-scsi qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (3 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 04/15] tests: Add virtio-rng qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:31 ` Paolo Bonzini
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest Andreas Färber
` (9 subsequent siblings)
14 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Andreas Färber
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/virtio-scsi-test.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 tests/virtio-scsi-test.c
diff --git a/tests/Makefile b/tests/Makefile
index 308a5a2..75b4659 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -78,6 +78,8 @@ check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
gcov-files-virtio-y += hw/virtio/virtio-rng.c
+check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
+gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
check-qtest-pci-y += tests/e1000-test$(EXESUF)
gcov-files-pci-y += hw/net/e1000.c
@@ -249,6 +251,7 @@ tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
+tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/qom-test$(EXESUF): tests/qom-test.o
diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
new file mode 100644
index 0000000..3230908
--- /dev/null
+++ b/tests/virtio-scsi-test.c
@@ -0,0 +1,35 @@
+/*
+ * QTest testcase for VirtIO SCSI
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void pci_nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/virtio/scsi/pci/nop", pci_nop);
+
+ qtest_start("-drive id=drv0,if=none,file=/dev/null "
+ "-device virtio-scsi-pci,id=vscsi0 "
+ "-device scsi-hd,bus=vscsi0.0,drive=drv0");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 05/15] tests: Add virtio-scsi qtest
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 05/15] tests: Add virtio-scsi qtest Andreas Färber
@ 2014-03-12 18:31 ` Paolo Bonzini
0 siblings, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2014-03-12 18:31 UTC (permalink / raw)
To: Andreas Färber, qemu-devel
Il 12/03/2014 19:28, Andreas Färber ha scritto:
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> tests/Makefile | 3 +++
> tests/virtio-scsi-test.c | 35 +++++++++++++++++++++++++++++++++++
> 2 files changed, 38 insertions(+)
> create mode 100644 tests/virtio-scsi-test.c
>
> diff --git a/tests/Makefile b/tests/Makefile
> index 308a5a2..75b4659 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -78,6 +78,8 @@ check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
> gcov-files-virtio-y += i386-softmmu/hw/block/virtio-blk.c
> check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
> gcov-files-virtio-y += hw/virtio/virtio-rng.c
> +check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
> +gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
>
> check-qtest-pci-y += tests/e1000-test$(EXESUF)
> gcov-files-pci-y += hw/net/e1000.c
> @@ -249,6 +251,7 @@ tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o
> tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
> tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
> tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
> +tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
> tests/tpci200-test$(EXESUF): tests/tpci200-test.o
> tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
> tests/qom-test$(EXESUF): tests/qom-test.o
> diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c
> new file mode 100644
> index 0000000..3230908
> --- /dev/null
> +++ b/tests/virtio-scsi-test.c
> @@ -0,0 +1,35 @@
> +/*
> + * QTest testcase for VirtIO SCSI
> + *
> + * Copyright (c) 2014 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 <glib.h>
> +#include <string.h>
> +#include "libqtest.h"
> +#include "qemu/osdep.h"
> +
> +/* Tests only initialization so far. TODO: Replace with functional tests */
> +static void pci_nop(void)
> +{
> +}
> +
> +int main(int argc, char **argv)
> +{
> + int ret;
> +
> + g_test_init(&argc, &argv, NULL);
> + qtest_add_func("/virtio/scsi/pci/nop", pci_nop);
> +
> + qtest_start("-drive id=drv0,if=none,file=/dev/null "
> + "-device virtio-scsi-pci,id=vscsi0 "
> + "-device scsi-hd,bus=vscsi0.0,drive=drv0");
> + ret = g_test_run();
> +
> + qtest_end();
> +
> + return ret;
> +}
>
ACK
If we get a summer of code student, we could aim at making these tests
work on all PCI platforms.
Paolo
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (4 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 05/15] tests: Add virtio-scsi qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-27 16:01 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 07/15] tests: Add virtio-serial qtest Andreas Färber
` (8 subsequent siblings)
14 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Make it conditional to 9p availability.
Create a temporary directory to share.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 6 ++++++
tests/virtio-9p-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
create mode 100644 tests/virtio-9p-test.c
diff --git a/tests/Makefile b/tests/Makefile
index 75b4659..117e606 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -80,6 +80,11 @@ check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
gcov-files-virtio-y += hw/virtio/virtio-rng.c
check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
+ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
+check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
+gcov-files-virtio-y += hw/9pfs/virtio-9p.c
+gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
+endif
check-qtest-pci-y += tests/e1000-test$(EXESUF)
gcov-files-pci-y += hw/net/e1000.c
@@ -252,6 +257,7 @@ tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
+tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/qom-test$(EXESUF): tests/qom-test.o
diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
new file mode 100644
index 0000000..1fae477
--- /dev/null
+++ b/tests/virtio-9p-test.c
@@ -0,0 +1,46 @@
+/*
+ * QTest testcase for VirtIO 9P
+ *
+ * Copyright (c) 2014 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 <stdlib.h>
+#include <string.h>
+#include <glib.h>
+#include "libqtest.h"
+#include "qemu-common.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void pci_nop(void)
+{
+}
+
+static char test_share[] = "/tmp/qtest.XXXXXX";
+
+int main(int argc, char **argv)
+{
+ char *args;
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/virtio/9p/pci/nop", pci_nop);
+
+ g_assert(mkdtemp(test_share));
+
+ args = g_strdup_printf("-fsdev local,id=fsdev0,security_model=none,path=%s "
+ "-device virtio-9p-pci,fsdev=fsdev0,mount_tag=qtest",
+ test_share);
+ qtest_start(args);
+ g_free(args);
+
+ ret = g_test_run();
+
+ qtest_end();
+ rmdir(test_share);
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest Andreas Färber
@ 2014-03-27 16:01 ` Andreas Färber
2014-03-27 16:29 ` Paolo Bonzini
0 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-27 16:01 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Aneesh Kumar K.V, Stefan Hajnoczi
Am 12.03.2014 19:28, schrieb Andreas Färber:
> Make it conditional to 9p availability.
> Create a temporary directory to share.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> tests/Makefile | 6 ++++++
> tests/virtio-9p-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 52 insertions(+)
> create mode 100644 tests/virtio-9p-test.c
Ping! Any objections to applying this first conditional test case? This
would complete the virtio tests, I believe.
Thanks,
Andreas
>
> diff --git a/tests/Makefile b/tests/Makefile
> index 75b4659..117e606 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -80,6 +80,11 @@ check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
> gcov-files-virtio-y += hw/virtio/virtio-rng.c
> check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
> gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
> +ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
> +check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
> +gcov-files-virtio-y += hw/9pfs/virtio-9p.c
> +gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
> +endif
>
> check-qtest-pci-y += tests/e1000-test$(EXESUF)
> gcov-files-pci-y += hw/net/e1000.c
> @@ -252,6 +257,7 @@ tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
> tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
> tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
> tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
> +tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
> tests/tpci200-test$(EXESUF): tests/tpci200-test.o
> tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
> tests/qom-test$(EXESUF): tests/qom-test.o
> diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
> new file mode 100644
> index 0000000..1fae477
> --- /dev/null
> +++ b/tests/virtio-9p-test.c
> @@ -0,0 +1,46 @@
> +/*
> + * QTest testcase for VirtIO 9P
> + *
> + * Copyright (c) 2014 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 <stdlib.h>
> +#include <string.h>
> +#include <glib.h>
> +#include "libqtest.h"
> +#include "qemu-common.h"
> +#include "qemu/osdep.h"
> +
> +/* Tests only initialization so far. TODO: Replace with functional tests */
> +static void pci_nop(void)
> +{
> +}
> +
> +static char test_share[] = "/tmp/qtest.XXXXXX";
> +
> +int main(int argc, char **argv)
> +{
> + char *args;
> + int ret;
> +
> + g_test_init(&argc, &argv, NULL);
> + qtest_add_func("/virtio/9p/pci/nop", pci_nop);
> +
> + g_assert(mkdtemp(test_share));
> +
> + args = g_strdup_printf("-fsdev local,id=fsdev0,security_model=none,path=%s "
> + "-device virtio-9p-pci,fsdev=fsdev0,mount_tag=qtest",
> + test_share);
> + qtest_start(args);
> + g_free(args);
> +
> + ret = g_test_run();
> +
> + qtest_end();
> + rmdir(test_share);
> +
> + return ret;
> +}
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest
2014-03-27 16:01 ` Andreas Färber
@ 2014-03-27 16:29 ` Paolo Bonzini
0 siblings, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2014-03-27 16:29 UTC (permalink / raw)
To: Andreas Färber, qemu-devel; +Cc: Aneesh Kumar K.V, Stefan Hajnoczi
Il 27/03/2014 17:01, Andreas Färber ha scritto:
> Am 12.03.2014 19:28, schrieb Andreas Färber:
>> Make it conditional to 9p availability.
>> Create a temporary directory to share.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> tests/Makefile | 6 ++++++
>> tests/virtio-9p-test.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 52 insertions(+)
>> create mode 100644 tests/virtio-9p-test.c
>
> Ping! Any objections to applying this first conditional test case? This
> would complete the virtio tests, I believe.
>
> Thanks,
> Andreas
>
>>
>> diff --git a/tests/Makefile b/tests/Makefile
>> index 75b4659..117e606 100644
>> --- a/tests/Makefile
>> +++ b/tests/Makefile
>> @@ -80,6 +80,11 @@ check-qtest-virtio-y += tests/virtio-rng-test$(EXESUF)
>> gcov-files-virtio-y += hw/virtio/virtio-rng.c
>> check-qtest-virtio-y += tests/virtio-scsi-test$(EXESUF)
>> gcov-files-virtio-y += i386-softmmu/hw/scsi/virtio-scsi.c
>> +ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
>> +check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
>> +gcov-files-virtio-y += hw/9pfs/virtio-9p.c
>> +gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
>> +endif
>>
>> check-qtest-pci-y += tests/e1000-test$(EXESUF)
>> gcov-files-pci-y += hw/net/e1000.c
>> @@ -252,6 +257,7 @@ tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o
>> tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
>> tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
>> tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
>> +tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
>> tests/tpci200-test$(EXESUF): tests/tpci200-test.o
>> tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
>> tests/qom-test$(EXESUF): tests/qom-test.o
>> diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
>> new file mode 100644
>> index 0000000..1fae477
>> --- /dev/null
>> +++ b/tests/virtio-9p-test.c
>> @@ -0,0 +1,46 @@
>> +/*
>> + * QTest testcase for VirtIO 9P
>> + *
>> + * Copyright (c) 2014 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 <stdlib.h>
>> +#include <string.h>
>> +#include <glib.h>
>> +#include "libqtest.h"
>> +#include "qemu-common.h"
>> +#include "qemu/osdep.h"
>> +
>> +/* Tests only initialization so far. TODO: Replace with functional tests */
>> +static void pci_nop(void)
>> +{
>> +}
>> +
>> +static char test_share[] = "/tmp/qtest.XXXXXX";
>> +
>> +int main(int argc, char **argv)
>> +{
>> + char *args;
>> + int ret;
>> +
>> + g_test_init(&argc, &argv, NULL);
>> + qtest_add_func("/virtio/9p/pci/nop", pci_nop);
>> +
>> + g_assert(mkdtemp(test_share));
>> +
>> + args = g_strdup_printf("-fsdev local,id=fsdev0,security_model=none,path=%s "
>> + "-device virtio-9p-pci,fsdev=fsdev0,mount_tag=qtest",
>> + test_share);
>> + qtest_start(args);
>> + g_free(args);
>> +
>> + ret = g_test_run();
>> +
>> + qtest_end();
>> + rmdir(test_share);
>> +
>> + return ret;
>> +}
>>
>
>
Fine by me.
Paolo
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 07/15] tests: Add virtio-serial qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (5 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 06/15] tests: Add virtio-9p qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 08/15] tests: Add virtio-console qtest Andreas Färber
` (7 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/virtio-serial-test.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
create mode 100644 tests/virtio-serial-test.c
diff --git a/tests/Makefile b/tests/Makefile
index 117e606..5c402d5 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -85,6 +85,8 @@ check-qtest-virtio-y += tests/virtio-9p-test$(EXESUF)
gcov-files-virtio-y += hw/9pfs/virtio-9p.c
gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
endif
+check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF)
+gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c
check-qtest-pci-y += tests/e1000-test$(EXESUF)
gcov-files-pci-y += hw/net/e1000.c
@@ -258,6 +260,7 @@ tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
+tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/qom-test$(EXESUF): tests/qom-test.o
diff --git a/tests/virtio-serial-test.c b/tests/virtio-serial-test.c
new file mode 100644
index 0000000..e743875
--- /dev/null
+++ b/tests/virtio-serial-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for VirtIO Serial
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void pci_nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/virtio/serial/pci/nop", pci_nop);
+
+ qtest_start("-device virtio-serial-pci");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 08/15] tests: Add virtio-console qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (6 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 07/15] tests: Add virtio-serial qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 09/15] tests: Add pvpanic qtest Andreas Färber
` (6 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 6 ++++++
tests/virtio-console-test.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)
create mode 100644 tests/virtio-console-test.c
diff --git a/tests/Makefile b/tests/Makefile
index 5c402d5..e13e98a 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -69,6 +69,9 @@ gcov-files-ipack-y += hw/ipack/ipack.c
check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
gcov-files-ipack-y += hw/char/ipoctal232.c
+check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF)
+gcov-files-virtioserial-y += hw/char/virtio-console.c
+
gcov-files-virtio-y += i386-softmmu/hw/virtio/virtio.c
check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/net/virtio-net.c
@@ -87,6 +90,8 @@ gcov-files-virtio-y += i386-softmmu/hw/9pfs/virtio-9p-device.c
endif
check-qtest-virtio-y += tests/virtio-serial-test$(EXESUF)
gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c
+check-qtest-virtio-y += $(check-qtest-virtioserial-y)
+gcov-files-virtio-y += $(gcov-files-virtioserial-y)
check-qtest-pci-y += tests/e1000-test$(EXESUF)
gcov-files-pci-y += hw/net/e1000.c
@@ -261,6 +266,7 @@ tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o
tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o
tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o
tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o
+tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o
tests/tpci200-test$(EXESUF): tests/tpci200-test.o
tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/qom-test$(EXESUF): tests/qom-test.o
diff --git a/tests/virtio-console-test.c b/tests/virtio-console-test.c
new file mode 100644
index 0000000..f98f5af2
--- /dev/null
+++ b/tests/virtio-console-test.c
@@ -0,0 +1,34 @@
+/*
+ * QTest testcase for VirtIO Console
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void pci_nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/virtio/console/pci/nop", pci_nop);
+
+ qtest_start("-device virtio-serial-pci,id=vser0 "
+ "-device virtconsole,bus=vser0.0");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 09/15] tests: Add pvpanic qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (7 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 08/15] tests: Add virtio-console qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 10/15] qtest: Factor out qtest_qmp_receive() Andreas Färber
` (5 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/pvpanic-test.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
create mode 100644 tests/pvpanic-test.c
diff --git a/tests/Makefile b/tests/Makefile
index e13e98a..23e764d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -130,6 +130,8 @@ check-qtest-i386-y += tests/vmxnet3-test$(EXESUF)
gcov-files-i386-y += hw/net/vmxnet3.c
gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c
gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c
+check-qtest-i386-y += tests/pvpanic-test$(EXESUF)
+gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c
check-qtest-x86_64-y = $(check-qtest-i386-y)
gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c
gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
@@ -272,6 +274,7 @@ tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o
tests/qom-test$(EXESUF): tests/qom-test.o
tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y)
+tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
# QTest rules
diff --git a/tests/pvpanic-test.c b/tests/pvpanic-test.c
new file mode 100644
index 0000000..7bb4d06
--- /dev/null
+++ b/tests/pvpanic-test.c
@@ -0,0 +1,38 @@
+/*
+ * QTest testcase for PV Panic
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+static void test_panic(void)
+{
+ uint8_t val;
+
+ val = inb(0x505);
+ g_assert_cmpuint(val, ==, 1);
+
+ outb(0x505, 0x1);
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/pvpanic/panic", test_panic);
+
+ qtest_start("-device pvpanic");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 10/15] qtest: Factor out qtest_qmp_receive()
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (8 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 09/15] tests: Add pvpanic qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 11/15] pvpanic-test: Assert pause event Andreas Färber
` (4 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/libqtest.c | 15 ++++++++++-----
tests/libqtest.h | 18 ++++++++++++++++++
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index f587d36..fe96005 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -309,14 +309,10 @@ static void qmp_response(JSONMessageParser *parser, QList *tokens)
qmp->response = (QDict *)obj;
}
-QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
+QDict *qtest_qmp_receive(QTestState *s)
{
QMPResponseParser qmp;
- /* Send QMP request */
- socket_sendf(s->qmp_fd, fmt, ap);
-
- /* Receive reply */
qmp.response = NULL;
json_message_parser_init(&qmp.parser, qmp_response);
while (!qmp.response) {
@@ -340,6 +336,15 @@ QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
return qmp.response;
}
+QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
+{
+ /* Send QMP request */
+ socket_sendf(s->qmp_fd, fmt, ap);
+
+ /* Receive reply */
+ return qtest_qmp_receive(s);
+}
+
QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
{
va_list ap;
diff --git a/tests/libqtest.h b/tests/libqtest.h
index 9deebdc..cc947a0 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -83,6 +83,14 @@ void qtest_qmpv_discard_response(QTestState *s, const char *fmt, va_list ap);
QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap);
/**
+ * qtest_receive:
+ * @s: #QTestState instance to operate on.
+ *
+ * Reads a QMP message from QEMU and returns the response.
+ */
+QDict *qtest_qmp_receive(QTestState *s);
+
+/**
* qtest_get_irq:
* @s: #QTestState instance to operate on.
* @num: Interrupt to observe.
@@ -383,6 +391,16 @@ static inline void qmp_discard_response(const char *fmt, ...)
}
/**
+ * qmp_receive:
+ *
+ * Reads a QMP message from QEMU and returns the response.
+ */
+static inline QDict *qmp_receive(void)
+{
+ return qtest_qmp_receive(global_qtest);
+}
+
+/**
* get_irq:
* @num: Interrupt to observe.
*
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 11/15] pvpanic-test: Assert pause event
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (9 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 10/15] qtest: Factor out qtest_qmp_receive() Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices Andreas Färber
` (3 subsequent siblings)
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/pvpanic-test.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tests/pvpanic-test.c b/tests/pvpanic-test.c
index 7bb4d06..a7ad6b3 100644
--- a/tests/pvpanic-test.c
+++ b/tests/pvpanic-test.c
@@ -15,11 +15,20 @@
static void test_panic(void)
{
uint8_t val;
+ QDict *response, *data;
val = inb(0x505);
g_assert_cmpuint(val, ==, 1);
outb(0x505, 0x1);
+
+ response = qmp_receive();
+ g_assert(qdict_haskey(response, "event"));
+ g_assert_cmpstr(qdict_get_str(response, "event"), ==, "GUEST_PANICKED");
+ g_assert(qdict_haskey(response, "data"));
+ data = qdict_get_qdict(response, "data");
+ g_assert(qdict_haskey(data, "action"));
+ g_assert_cmpstr(qdict_get_str(data, "action"), ==, "pause");
}
int main(int argc, char **argv)
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (10 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 11/15] pvpanic-test: Assert pause event Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-12 19:13 ` Keith Busch
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 13/15] tests: Add nvme qtest Andreas Färber
` (2 subsequent siblings)
14 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Keith Busch, Kevin Wolf, Andreas Färber, Stefan Hajnoczi
It may not be sensible for normal use cases, but it allows to use
/dev/null in QTest.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/block/nvme.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 2882ffe..5fd8f89 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -752,8 +752,8 @@ static int nvme_init(PCIDevice *pci_dev)
return -1;
}
- bs_size = bdrv_getlength(n->conf.bs);
- if (bs_size <= 0) {
+ bs_size = bdrv_getlength(n->conf.bs);
+ if (bs_size < 0) {
return -1;
}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices Andreas Färber
@ 2014-03-12 19:13 ` Keith Busch
2014-03-12 19:20 ` Andreas Färber
0 siblings, 1 reply; 26+ messages in thread
From: Keith Busch @ 2014-03-12 19:13 UTC (permalink / raw)
To: Andreas Färber; +Cc: Keith Busch, Kevin Wolf, qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: TEXT/PLAIN, Size: 999 bytes --]
On Wed, 12 Mar 2014, Andreas Färber wrote:
> It may not be sensible for normal use cases, but it allows to use
> /dev/null in QTest.
Thanks! Sounds useful despite not being usable as storage. :)
I applied to my nvme tree here:
http://git.infradead.org/users/kbusch/qemu-nvme.git
It's quite a bit ahead of the upstream on 'nvme features'. I often hear
from people in various orgs using this, so might be time I roll it into
a pull request.
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> hw/block/nvme.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 2882ffe..5fd8f89 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -752,8 +752,8 @@ static int nvme_init(PCIDevice *pci_dev)
> return -1;
> }
>
> - bs_size = bdrv_getlength(n->conf.bs);
> - if (bs_size <= 0) {
> + bs_size = bdrv_getlength(n->conf.bs);
> + if (bs_size < 0) {
> return -1;
> }
>
> --
> 1.8.4.5
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
2014-03-12 19:13 ` Keith Busch
@ 2014-03-12 19:20 ` Andreas Färber
2014-03-12 20:13 ` Keith Busch
0 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 19:20 UTC (permalink / raw)
To: Keith Busch; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
Am 12.03.2014 20:13, schrieb Keith Busch:
> On Wed, 12 Mar 2014, Andreas Färber wrote:
>> It may not be sensible for normal use cases, but it allows to use
>> /dev/null in QTest.
>
> Thanks! Sounds useful despite not being usable as storage. :)
Thanks for the quick review!
> I applied to my nvme tree here:
>
> http://git.infradead.org/users/kbusch/qemu-nvme.git
>
> It's quite a bit ahead of the upstream on 'nvme features'. I often hear
> from people in various orgs using this, so might be time I roll it into
> a pull request.
Tonight is Hard Freeze for 2.0. If you could also review the matching
test case http://patchwork.ozlabs.org/patch/329627/ I would put both in
my pull. I guess you'll need to submit your queue for review first? Hard
to see in a non-rebased tree.
Thanks,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
2014-03-12 19:20 ` Andreas Färber
@ 2014-03-12 20:13 ` Keith Busch
2014-03-27 16:35 ` Andreas Färber
0 siblings, 1 reply; 26+ messages in thread
From: Keith Busch @ 2014-03-12 20:13 UTC (permalink / raw)
To: Andreas Färber; +Cc: Keith Busch, Kevin Wolf, qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1779 bytes --]
On Wed, 12 Mar 2014, Andreas Färber wrote:
> Tonight is Hard Freeze for 2.0. If you could also review the matching
> test case http://patchwork.ozlabs.org/patch/329627/ I would put both in
> my pull.
Looks great! I'd apply the new test case, but it won't without the
previous "pvpanic-test" patch in your series.
> I guess you'll need to submit your queue for review first? Hard
> to see in a non-rebased tree.
For sure. I pushed a new rebased branch to my repo so it could be more
easily observed. My first commit below really ought to have been split
into a dozen or so individuals, so my own fault if it fails review for
that or any other reason. I have no concerns about waiting for the next
window if I need to split it up better and fix anything.
A pull request at this point would look like this:
The following changes since commit 750036a848ea913ba6343718ffa70da98f7eef6b:
Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-upstream' into staging (2014-03-12 17:53:37 +0000)
are available in the git repository at:
git://git.infradead.org/users/kbusch/qemu-nvme.git v2.0-updates
for you to fetch changes up to 9323763f1b9db24c575a5f8afc13e460a63cac22:
nvme: Permit zero-length block devices (2014-03-12 13:17:58 -0600)
----------------------------------------------------------------
Andreas Färber (1):
nvme: Permit zero-length block devices
Keith Busch (4):
NVMe: Implement remainder from spec
NVMe: Clear allocated bitmap after format
NVMe: Use aio flush
NVMe: completion queue coalescing
default-configs/pci.mak | 1 +
hw/block/nvme.c | 1640 +++++++++++++++++++++++++++++++++++++++++++----
hw/block/nvme.h | 114 ++++
3 files changed, 1621 insertions(+), 134 deletions(-)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
2014-03-12 20:13 ` Keith Busch
@ 2014-03-27 16:35 ` Andreas Färber
2014-03-27 19:00 ` Keith Busch
0 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-27 16:35 UTC (permalink / raw)
To: Keith Busch; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
Hi Keith,
Am 12.03.2014 21:13, schrieb Keith Busch:
> On Wed, 12 Mar 2014, Andreas Färber wrote:
>> Tonight is Hard Freeze for 2.0. If you could also review the matching
>> test case http://patchwork.ozlabs.org/patch/329627/ I would put both in
>> my pull.
>
> Looks great! I'd apply the new test case, but it won't without the
> previous "pvpanic-test" patch in your series.
I had held off putting them in my pull for -rc0, but not seeing
patches/pull from your side I am queuing them now for -rc1. Can I
formalize your review as an Acked-by of both, if not turn your
Signed-off-by into a Reviewed-by for this patch here?
Thanks,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices
2014-03-27 16:35 ` Andreas Färber
@ 2014-03-27 19:00 ` Keith Busch
0 siblings, 0 replies; 26+ messages in thread
From: Keith Busch @ 2014-03-27 19:00 UTC (permalink / raw)
To: Andreas Färber; +Cc: Keith Busch, Kevin Wolf, qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: TEXT/PLAIN, Size: 743 bytes --]
On Thu, 27 Mar 2014, Andreas Färber wrote:
> Am 12.03.2014 21:13, schrieb Keith Busch:
>> On Wed, 12 Mar 2014, Andreas Färber wrote:
>>> Tonight is Hard Freeze for 2.0. If you could also review the matching
>>> test case http://patchwork.ozlabs.org/patch/329627/ I would put both in
>>> my pull.
>>
>> Looks great! I'd apply the new test case, but it won't without the
>> previous "pvpanic-test" patch in your series.
>
> I had held off putting them in my pull for -rc0, but not seeing
> patches/pull from your side I am queuing them now for -rc1. Can I
> formalize your review as an Acked-by of both, if not turn your
> Signed-off-by into a Reviewed-by for this patch here?
Sounds good to me.
Acked-by: Keith Busch <keith.busch@intel.com>
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 13/15] tests: Add nvme qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (11 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 12/15] nvme: Permit zero-length block devices Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-27 16:40 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 14/15] tests: Add i82801b11 qtest Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 15/15] tests: Add spapr-pci-host-bridge qtest Andreas Färber
14 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/nvme-test.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
create mode 100644 tests/nvme-test.c
diff --git a/tests/Makefile b/tests/Makefile
index 23e764d..c8b4060 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -104,6 +104,8 @@ check-qtest-pci-y += tests/eepro100-test$(EXESUF)
gcov-files-pci-y += hw/net/eepro100.c
check-qtest-pci-y += tests/ne2000-test$(EXESUF)
gcov-files-pci-y += hw/net/ne2000.c
+check-qtest-pci-y += tests/nvme-test$(EXESUF)
+gcov-files-pci-y += hw/block/nvme.c
check-qtest-pci-y += $(check-qtest-virtio-y)
gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c
check-qtest-pci-y += tests/tpci200-test$(EXESUF)
@@ -275,6 +277,7 @@ tests/qom-test$(EXESUF): tests/qom-test.o
tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y)
tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
+tests/nvme-test$(EXESUF): tests/nvme-test.o
tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
# QTest rules
diff --git a/tests/nvme-test.c b/tests/nvme-test.c
new file mode 100644
index 0000000..85768e8
--- /dev/null
+++ b/tests/nvme-test.c
@@ -0,0 +1,34 @@
+/*
+ * QTest testcase for NVMe
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/nvme/nop", nop);
+
+ qtest_start("-drive id=drv0,if=none,file=/dev/null "
+ "-device nvme,drive=drv0,serial=foo");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 13/15] tests: Add nvme qtest
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 13/15] tests: Add nvme qtest Andreas Färber
@ 2014-03-27 16:40 ` Andreas Färber
0 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-27 16:40 UTC (permalink / raw)
To: qemu-devel, Keith Busch
Am 12.03.2014 19:28, schrieb Andreas Färber:
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> tests/Makefile | 3 +++
> tests/nvme-test.c | 34 ++++++++++++++++++++++++++++++++++
> 2 files changed, 37 insertions(+)
> create mode 100644 tests/nvme-test.c
Squashing MAINTAINERS update:
diff --git a/MAINTAINERS b/MAINTAINERS
index 7d17f83..174c2c1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -648,6 +648,7 @@ nvme
M: Keith Busch <keith.busch@intel.com>
S: Supported
F: hw/block/nvme*
+F: tests/nvme-test.c
Xilinx EDK
M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 14/15] tests: Add i82801b11 qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (12 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 13/15] tests: Add nvme qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
2014-03-27 17:02 ` Andreas Färber
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 15/15] tests: Add spapr-pci-host-bridge qtest Andreas Färber
14 siblings, 1 reply; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/i82801b11-test.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
create mode 100644 tests/i82801b11-test.c
diff --git a/tests/Makefile b/tests/Makefile
index c8b4060..bf6c0a9 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -134,6 +134,8 @@ gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c
gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c
check-qtest-i386-y += tests/pvpanic-test$(EXESUF)
gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c
+check-qtest-i386-y += tests/i82801b11-test$(EXESUF)
+gcov-files-i386-y += hw/pci-bridge/i802801b11.c
check-qtest-x86_64-y = $(check-qtest-i386-y)
gcov-files-i386-y += i386-softmmu/hw/timer/mc146818rtc.c
gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
@@ -278,6 +280,7 @@ tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y)
tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o
tests/nvme-test$(EXESUF): tests/nvme-test.o
+tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o
tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
# QTest rules
diff --git a/tests/i82801b11-test.c b/tests/i82801b11-test.c
new file mode 100644
index 0000000..78d9ce0
--- /dev/null
+++ b/tests/i82801b11-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for i82801b11
+ *
+ * Copyright (c) 2014 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 <glib.h>
+#include <string.h>
+#include "libqtest.h"
+#include "qemu/osdep.h"
+
+/* Tests only initialization so far. TODO: Replace with functional tests */
+static void nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+ int ret;
+
+ g_test_init(&argc, &argv, NULL);
+ qtest_add_func("/i82801b11/nop", nop);
+
+ qtest_start("-machine q35 -device i82801b11-bridge,bus=pcie.0,addr=1e.0");
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next v3 14/15] tests: Add i82801b11 qtest
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 14/15] tests: Add i82801b11 qtest Andreas Färber
@ 2014-03-27 17:02 ` Andreas Färber
0 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-27 17:02 UTC (permalink / raw)
To: qemu-devel
Am 12.03.2014 19:28, schrieb Andreas Färber:
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> tests/Makefile | 3 +++
> tests/i82801b11-test.c | 33 +++++++++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
> create mode 100644 tests/i82801b11-test.c
>
> diff --git a/tests/Makefile b/tests/Makefile
> index c8b4060..bf6c0a9 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -134,6 +134,8 @@ gcov-files-i386-y += hw/net/vmxnet_rx_pkt.c
> gcov-files-i386-y += hw/net/vmxnet_tx_pkt.c
> check-qtest-i386-y += tests/pvpanic-test$(EXESUF)
> gcov-files-i386-y += i386-softmmu/hw/misc/pvpanic.c
> +check-qtest-i386-y += tests/i82801b11-test$(EXESUF)
> +gcov-files-i386-y += hw/pci-bridge/i802801b11.c
Typo fixed: i82801b11.c
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH qom-next v3 15/15] tests: Add spapr-pci-host-bridge qtest
2014-03-12 18:28 [Qemu-devel] [PATCH qom-next v3 00/15] qtest: Prepare virtio, other PCI tests Andreas Färber
` (13 preceding siblings ...)
2014-03-12 18:28 ` [Qemu-devel] [PATCH qom-next v3 14/15] tests: Add i82801b11 qtest Andreas Färber
@ 2014-03-12 18:28 ` Andreas Färber
14 siblings, 0 replies; 26+ messages in thread
From: Andreas Färber @ 2014-03-12 18:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Kardashevskiy, Andreas Färber
From: Alexey Kardashevskiy <aik@ozlabs.ru>
This adds a test whether sPAPR PHB can be added via the command line.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
tests/Makefile | 3 +++
tests/spapr-phb-test.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 tests/spapr-phb-test.c
diff --git a/tests/Makefile b/tests/Makefile
index bf6c0a9..8887512 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -155,6 +155,8 @@ check-qtest-arm-y = tests/tmp105-test$(EXESUF)
gcov-files-arm-y += hw/misc/tmp105.c
check-qtest-ppc-y += tests/boot-order-test$(EXESUF)
check-qtest-ppc64-y += tests/boot-order-test$(EXESUF)
+check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
+gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c
check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
@@ -251,6 +253,7 @@ libqos-omap-obj-y = $(libqos-obj-y) tests/libqos/i2c-omap.o
tests/rtc-test$(EXESUF): tests/rtc-test.o
tests/m48t59-test$(EXESUF): tests/m48t59-test.o
tests/endianness-test$(EXESUF): tests/endianness-test.o
+tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y)
tests/fdc-test$(EXESUF): tests/fdc-test.o
tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y)
tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o
diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
new file mode 100644
index 0000000..b629de4
--- /dev/null
+++ b/tests/spapr-phb-test.c
@@ -0,0 +1,35 @@
+/*
+ * QTest testcase for SPAPR PHB
+ *
+ * Authors:
+ * Alexey Kardashevskiy <aik@ozlabs.ru>
+ *
+ * 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 <glib.h>
+
+#include "libqtest.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)
+{
+}
+
+int main(int argc, char **argv)
+{
+ 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=100");
+
+ ret = g_test_run();
+
+ qtest_end();
+
+ return ret;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 26+ messages in thread