All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests
@ 2014-02-09 11:57 Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 01/12] tests: Add e1000 qtest Andreas Färber
                   ` (14 more replies)
  0 siblings, 15 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Stefan Hajnoczi, Michael S. Tsirkin,
	Alexey Kardashevskiy, Alberto Garcia, Anthony Liguori,
	Paolo Bonzini, Andreas Färber

Hello Stefan and Michael,

This series starts preparing tests to cover optional PCI devices. They don't do
any functional tests but assure that QOM/PCI/VMState refactorings don't break
the basic usage of devices not covered by qom-test.

pcnet-test.c is intended to handle sparc's lance as well.

v2 starts to cover virtio devices and covers ipack.

NB that the Makefile is being prepared for testing ...
* PCI devices on different architectures and
* VirtIO devices on different transports and
* IndustryPack devices on different bridges,
but the tests themselves will need some follow-up for choosing the right -machine
or adding the required bus -device. My focus for now is on testing devices at all.

I'd like to include the IndustryPack tests in my upcoming pull (Monday) and am
hoping I can do so on top of the original set of NIC tests for convenience.

Regards,
Andreas

v1 -> v2:
* Reordered includes (stefanha)
* Used qtest_end() where applicable
* Added qtest for tpci200 and ipoctal232 (for my IndustryPack refactoring series)
* Added qtests for ne2000, virtio-net, virtio-blk, virtio-balloon, virtio-rng

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Alberto Garcia <agarcia@igalia.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>

Andreas Färber (12):
  tests: Add e1000 qtest
  tests: Add vmxnet3 qtest
  tests: Add rtl8139 qtest
  tests: Add pcnet qtest
  tests: Add eepro100 qtest
  tests: Add tpci200 qtest
  tests: Add ne2000 qtest
  tests: Add virtio-net qtest
  tests: Add virtio-blk qtest
  tests: Add virtio-balloon qtest
  tests: Add virtio-rng qtest
  tests: Add ipoctal232 qtest

 tests/Makefile              | 49 +++++++++++++++++++++++++++++++++++
 tests/e1000-test.c          | 33 ++++++++++++++++++++++++
 tests/eepro100-test.c       | 63 +++++++++++++++++++++++++++++++++++++++++++++
 tests/ipoctal232-test.c     | 33 ++++++++++++++++++++++++
 tests/ne2000-test.c         | 33 ++++++++++++++++++++++++
 tests/pcnet-test.c          | 33 ++++++++++++++++++++++++
 tests/rtl8139-test.c        | 33 ++++++++++++++++++++++++
 tests/tpci200-test.c        | 33 ++++++++++++++++++++++++
 tests/virtio-balloon-test.c | 33 ++++++++++++++++++++++++
 tests/virtio-blk-test.c     | 34 ++++++++++++++++++++++++
 tests/virtio-net-test.c     | 33 ++++++++++++++++++++++++
 tests/virtio-rng-test.c     | 33 ++++++++++++++++++++++++
 tests/vmxnet3-test.c        | 33 ++++++++++++++++++++++++
 13 files changed, 476 insertions(+)
 create mode 100644 tests/e1000-test.c
 create mode 100644 tests/eepro100-test.c
 create mode 100644 tests/ipoctal232-test.c
 create mode 100644 tests/ne2000-test.c
 create mode 100644 tests/pcnet-test.c
 create mode 100644 tests/rtl8139-test.c
 create mode 100644 tests/tpci200-test.c
 create mode 100644 tests/virtio-balloon-test.c
 create mode 100644 tests/virtio-blk-test.c
 create mode 100644 tests/virtio-net-test.c
 create mode 100644 tests/virtio-rng-test.c
 create mode 100644 tests/vmxnet3-test.c

-- 
1.8.4.5

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 01/12] tests: Add e1000 qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 02/12] tests: Add vmxnet3 qtest Andreas Färber
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi, Michael S. Tsirkin

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile     |  7 +++++++
 tests/e1000-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 tests/e1000-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 42a52ff..57e21fc 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -64,6 +64,10 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
 # All QTests for now are POSIX-only, but the dependencies are
 # really in libqtest, not in the testcases themselves.
+
+check-qtest-pci-y += tests/e1000-test$(EXESUF)
+gcov-files-pci-y += hw/net/e1000.c
+
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
 check-qtest-i386-y += tests/fdc-test$(EXESUF)
 gcov-files-i386-y = hw/fdc.c
@@ -77,6 +81,8 @@ check-qtest-i386-y += tests/i440fx-test$(EXESUF)
 check-qtest-i386-y += tests/fw_cfg-test$(EXESUF)
 check-qtest-i386-y += tests/blockdev-test$(EXESUF)
 check-qtest-i386-y += tests/qdev-monitor-test$(EXESUF)
+check-qtest-i386-y += $(check-qtest-pci-y)
+gcov-files-i386-y += $(gcov-files-pci-y)
 check-qtest-x86_64-y = $(check-qtest-i386-y)
 gcov-files-i386-y += i386-softmmu/hw/mc146818rtc.c
 gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
@@ -196,6 +202,7 @@ tests/acpi-test$(EXESUF): tests/acpi-test.o $(libqos-obj-y)
 tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
 tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
 tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
+tests/e1000-test$(EXESUF): tests/e1000-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)
diff --git a/tests/e1000-test.c b/tests/e1000-test.c
new file mode 100644
index 0000000..a8ba2fc
--- /dev/null
+++ b/tests/e1000-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for e1000 NIC
+ *
+ * Copyright (c) 2013-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("/e1000/nop", nop);
+
+    qtest_start("-device e1000");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 02/12] tests: Add vmxnet3 qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 01/12] tests: Add e1000 qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-10  6:56   ` Dmitry Fleytman
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 03/12] tests: Add rtl8139 qtest Andreas Färber
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dmitry Fleytman, Andreas Färber, Stefan Hajnoczi

Note that this will emit a warning:
[vmxnet3][WR][vmxnet3_peer_has_vnet_hdr]: Peer has no virtio extension.
Task offloads will be emulated.

Cc: Dmitry Fleytman <dmitry@daynix.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile       |  5 +++++
 tests/vmxnet3-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 tests/vmxnet3-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 57e21fc..323c600 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -83,6 +83,10 @@ check-qtest-i386-y += tests/blockdev-test$(EXESUF)
 check-qtest-i386-y += tests/qdev-monitor-test$(EXESUF)
 check-qtest-i386-y += $(check-qtest-pci-y)
 gcov-files-i386-y += $(gcov-files-pci-y)
+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-x86_64-y = $(check-qtest-i386-y)
 gcov-files-i386-y += i386-softmmu/hw/mc146818rtc.c
 gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
@@ -203,6 +207,7 @@ tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
 tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
 tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
 tests/e1000-test$(EXESUF): tests/e1000-test.o
+tests/vmxnet3-test$(EXESUF): tests/vmxnet3-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)
diff --git a/tests/vmxnet3-test.c b/tests/vmxnet3-test.c
new file mode 100644
index 0000000..a2ebed3
--- /dev/null
+++ b/tests/vmxnet3-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for vmxnet3 NIC
+ *
+ * Copyright (c) 2013-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("/vmxnet3/nop", nop);
+
+    qtest_start("-device vmxnet3");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 03/12] tests: Add rtl8139 qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 01/12] tests: Add e1000 qtest Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 02/12] tests: Add vmxnet3 qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 04/12] tests: Add pcnet qtest Andreas Färber
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile       |  3 +++
 tests/rtl8139-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 tests/rtl8139-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 323c600..eabdf98 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -67,6 +67,8 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
 check-qtest-pci-y += tests/e1000-test$(EXESUF)
 gcov-files-pci-y += hw/net/e1000.c
+check-qtest-pci-y += tests/rtl8139-test$(EXESUF)
+gcov-files-pci-y += hw/net/rtl8139.c
 
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
 check-qtest-i386-y += tests/fdc-test$(EXESUF)
@@ -207,6 +209,7 @@ tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
 tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
 tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
 tests/e1000-test$(EXESUF): tests/e1000-test.o
+tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o
 tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
 tests/qom-test$(EXESUF): tests/qom-test.o
 tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
diff --git a/tests/rtl8139-test.c b/tests/rtl8139-test.c
new file mode 100644
index 0000000..f6a1be3
--- /dev/null
+++ b/tests/rtl8139-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for Realtek 8139 NIC
+ *
+ * Copyright (c) 2013-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("/rtl8139/nop", nop);
+
+    qtest_start("-device rtl8139");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 04/12] tests: Add pcnet qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (2 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 03/12] tests: Add rtl8139 qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 05/12] tests: Add eepro100 qtest Andreas Färber
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Test PCI only for now.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile     |  4 ++++
 tests/pcnet-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 tests/pcnet-test.c

diff --git a/tests/Makefile b/tests/Makefile
index eabdf98..867d931 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -69,6 +69,9 @@ check-qtest-pci-y += tests/e1000-test$(EXESUF)
 gcov-files-pci-y += hw/net/e1000.c
 check-qtest-pci-y += tests/rtl8139-test$(EXESUF)
 gcov-files-pci-y += hw/net/rtl8139.c
+check-qtest-pci-y += tests/pcnet-test$(EXESUF)
+gcov-files-pci-y += hw/net/pcnet.c
+gcov-files-pci-y += hw/net/pcnet-pci.c
 
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
 check-qtest-i386-y += tests/fdc-test$(EXESUF)
@@ -210,6 +213,7 @@ tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
 tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
 tests/e1000-test$(EXESUF): tests/e1000-test.o
 tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o
+tests/pcnet-test$(EXESUF): tests/pcnet-test.o
 tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o
 tests/qom-test$(EXESUF): tests/qom-test.o
 tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
diff --git a/tests/pcnet-test.c b/tests/pcnet-test.c
new file mode 100644
index 0000000..84af4f3
--- /dev/null
+++ b/tests/pcnet-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for PC-Net NIC
+ *
+ * Copyright (c) 2013-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("/pcnet/pci/nop", pci_nop);
+
+    qtest_start("-device pcnet");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 05/12] tests: Add eepro100 qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (3 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 04/12] tests: Add pcnet qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 06/12] tests: Add tpci200 qtest Andreas Färber
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile        |  3 +++
 tests/eepro100-test.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 tests/eepro100-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 867d931..4f9dd6d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,6 +72,8 @@ gcov-files-pci-y += hw/net/rtl8139.c
 check-qtest-pci-y += tests/pcnet-test$(EXESUF)
 gcov-files-pci-y += hw/net/pcnet.c
 gcov-files-pci-y += hw/net/pcnet-pci.c
+check-qtest-pci-y += tests/eepro100-test$(EXESUF)
+gcov-files-pci-y += hw/net/eepro100.c
 
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
 check-qtest-i386-y += tests/fdc-test$(EXESUF)
@@ -214,6 +216,7 @@ tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
 tests/e1000-test$(EXESUF): tests/e1000-test.o
 tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o
 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/qom-test$(EXESUF): tests/qom-test.o
 tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
diff --git a/tests/eepro100-test.c b/tests/eepro100-test.c
new file mode 100644
index 0000000..bf82526
--- /dev/null
+++ b/tests/eepro100-test.c
@@ -0,0 +1,63 @@
+/*
+ * QTest testcase for eepro100 NIC
+ *
+ * Copyright (c) 2013-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_device(gconstpointer data)
+{
+    const char *model = data;
+    QTestState *s;
+    char *args;
+
+    args = g_strdup_printf("-device %s", model);
+    s = qtest_start(args);
+
+    /* Tests only initialization so far. TODO: Implement functional tests */
+
+    if (s) {
+        qtest_quit(s);
+    }
+    g_free(args);
+}
+
+static const char *models[] = {
+    "i82550",
+    "i82551",
+    "i82557a",
+    "i82557b",
+    "i82557c",
+    "i82558a",
+    "i82558b",
+    "i82559a",
+    "i82559b",
+    "i82559c",
+    "i82559er",
+    "i82562",
+    "i82801",
+};
+
+int main(int argc, char **argv)
+{
+    int i;
+
+    g_test_init(&argc, &argv, NULL);
+
+    for (i = 0; i < ARRAY_SIZE(models); i++) {
+        char *path;
+
+        path = g_strdup_printf("/%s/eepro100/%s",
+                               qtest_get_arch(), models[i]);
+        g_test_add_data_func(path, models[i], test_device);
+    }
+
+    return g_test_run();
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 06/12] tests: Add tpci200 qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (4 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 05/12] tests: Add eepro100 qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 07/12] tests: Add ne2000 qtest Andreas Färber
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber

Cc: Alberto Garcia <agarcia@igalia.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile       |  3 +++
 tests/tpci200-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 tests/tpci200-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 4f9dd6d..407b883 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -74,6 +74,8 @@ gcov-files-pci-y += hw/net/pcnet.c
 gcov-files-pci-y += hw/net/pcnet-pci.c
 check-qtest-pci-y += tests/eepro100-test$(EXESUF)
 gcov-files-pci-y += hw/net/eepro100.c
+check-qtest-pci-y += tests/tpci200-test$(EXESUF)
+gcov-files-pci-y += hw/char/tpci200.c
 
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
 check-qtest-i386-y += tests/fdc-test$(EXESUF)
@@ -218,6 +220,7 @@ tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o
 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/tpci200-test$(EXESUF): tests/tpci200-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)
diff --git a/tests/tpci200-test.c b/tests/tpci200-test.c
new file mode 100644
index 0000000..9ae0127
--- /dev/null
+++ b/tests/tpci200-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for tpci200 PCI-IndustryPack bridge
+ *
+ * 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("/tpci200/nop", nop);
+
+    qtest_start("-device tpci200");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 07/12] tests: Add ne2000 qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (5 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 06/12] tests: Add tpci200 qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 08/12] tests: Add virtio-net qtest Andreas Färber
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile      |  1 +
 tests/ne2000-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 tests/ne2000-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 407b883..2bb484f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -220,6 +220,7 @@ tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o
 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/tpci200-test$(EXESUF): tests/tpci200-test.o
 tests/qom-test$(EXESUF): tests/qom-test.o
 tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
diff --git a/tests/ne2000-test.c b/tests/ne2000-test.c
new file mode 100644
index 0000000..61a678a
--- /dev/null
+++ b/tests/ne2000-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for ne2000 NIC
+ *
+ * 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("/ne2000/pci/nop", pci_nop);
+
+    qtest_start("-device ne2k_pci");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 08/12] tests: Add virtio-net qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (6 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 07/12] tests: Add ne2000 qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 09/12] tests: Add virtio-blk qtest Andreas Färber
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi, Michael S. Tsirkin

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile          |  7 +++++++
 tests/virtio-net-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 tests/virtio-net-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 2bb484f..e52a4b9 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -65,6 +65,10 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 # All QTests for now are POSIX-only, but the dependencies are
 # really in libqtest, not in the testcases themselves.
 
+gcov-files-virtio-y += hw/virtio/virtio.c
+check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
+gcov-files-virtio-y += hw/net/virtio-net.c
+
 check-qtest-pci-y += tests/e1000-test$(EXESUF)
 gcov-files-pci-y += hw/net/e1000.c
 check-qtest-pci-y += tests/rtl8139-test$(EXESUF)
@@ -76,6 +80,8 @@ check-qtest-pci-y += tests/eepro100-test$(EXESUF)
 gcov-files-pci-y += hw/net/eepro100.c
 check-qtest-pci-y += tests/tpci200-test$(EXESUF)
 gcov-files-pci-y += hw/char/tpci200.c
+check-qtest-pci-y += $(check-qtest-virtio-y)
+gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c
 
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
 check-qtest-i386-y += tests/fdc-test$(EXESUF)
@@ -221,6 +227,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-net-test$(EXESUF): tests/virtio-net-test.o
 tests/tpci200-test$(EXESUF): tests/tpci200-test.o
 tests/qom-test$(EXESUF): tests/qom-test.o
 tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
new file mode 100644
index 0000000..df99343
--- /dev/null
+++ b/tests/virtio-net-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for VirtIO NIC
+ *
+ * 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/net/pci/nop", pci_nop);
+
+    qtest_start("-device virtio-net-pci");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 09/12] tests: Add virtio-blk qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (7 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 08/12] tests: Add virtio-net qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 10/12] tests: Add virtio-balloon qtest Andreas Färber
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Andreas Färber, Stefan Hajnoczi

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: 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 e52a4b9..e24c49d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -68,6 +68,8 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 gcov-files-virtio-y += hw/virtio/virtio.c
 check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
 gcov-files-virtio-y += hw/net/virtio-net.c
+check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
+gcov-files-virtio-y += hw/block/virtio-blk.c
 
 check-qtest-pci-y += tests/e1000-test$(EXESUF)
 gcov-files-pci-y += hw/net/e1000.c
@@ -227,6 +229,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/qom-test$(EXESUF): tests/qom-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] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 10/12] tests: Add virtio-balloon qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (8 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 09/12] tests: Add virtio-blk qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 11/12] tests: Add virtio-rng qtest Andreas Färber
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Michael S. Tsirkin

Cc: Michael S. Tsirkin <mst@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 e24c49d..8a35c3c 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -68,6 +68,8 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 gcov-files-virtio-y += hw/virtio/virtio.c
 check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
 gcov-files-virtio-y += hw/net/virtio-net.c
+check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
+gcov-files-virtio-y += hw/virtio/virtio-balloon.c
 check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
 gcov-files-virtio-y += hw/block/virtio-blk.c
 
@@ -229,6 +231,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] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 11/12] tests: Add virtio-rng qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (9 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 10/12] tests: Add virtio-balloon qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 12/12] tests: Add ipoctal232 qtest Andreas Färber
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Michael S. Tsirkin

Cc: Michael S. Tsirkin <mst@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 8a35c3c..2a7e104 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,6 +72,8 @@ check-qtest-virtio-y += tests/virtio-balloon-test$(EXESUF)
 gcov-files-virtio-y += hw/virtio/virtio-balloon.c
 check-qtest-virtio-y += tests/virtio-blk-test$(EXESUF)
 gcov-files-virtio-y += 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
@@ -234,6 +236,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/qom-test$(EXESUF): tests/qom-test.o
 tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y)
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] 31+ messages in thread

* [Qemu-devel] [PATCH qom-next v2 12/12] tests: Add ipoctal232 qtest
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (10 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 11/12] tests: Add virtio-rng qtest Andreas Färber
@ 2014-02-09 11:57 ` Andreas Färber
  2014-02-10  3:46 ` [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Alexey Kardashevskiy
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-09 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber

Cc: Alberto Garcia <agarcia@igalia.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile          |  7 +++++++
 tests/ipoctal232-test.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 tests/ipoctal232-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 2a7e104..89cc4cc 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -65,6 +65,10 @@ check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 # All QTests for now are POSIX-only, but the dependencies are
 # really in libqtest, not in the testcases themselves.
 
+gcov-files-ipack-y += hw/char/ipack.c
+check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF)
+gcov-files-ipack-y += hw/char/ipoctal232.c
+
 gcov-files-virtio-y += hw/virtio/virtio.c
 check-qtest-virtio-y += tests/virtio-net-test$(EXESUF)
 gcov-files-virtio-y += hw/net/virtio-net.c
@@ -88,6 +92,8 @@ check-qtest-pci-y += tests/tpci200-test$(EXESUF)
 gcov-files-pci-y += hw/char/tpci200.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 += $(check-qtest-ipack-y)
+gcov-files-ipack-y += $(gcov-files-ipack-y) hw/char/tpci200.c
 
 check-qtest-i386-y = tests/endianness-test$(EXESUF)
 check-qtest-i386-y += tests/fdc-test$(EXESUF)
@@ -238,6 +244,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/tpci200-test$(EXESUF): tests/tpci200-test.o
+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)
diff --git a/tests/ipoctal232-test.c b/tests/ipoctal232-test.c
new file mode 100644
index 0000000..3ac1714
--- /dev/null
+++ b/tests/ipoctal232-test.c
@@ -0,0 +1,33 @@
+/*
+ * QTest testcase for IndustryPack Octal-RS232
+ *
+ * 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("/ipoctal232/tpci200/nop", nop);
+
+    qtest_start("-device tpci200,id=ipack0 -device ipoctal232,bus=ipack0.0");
+    ret = g_test_run();
+
+    qtest_end();
+
+    return ret;
+}
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (11 preceding siblings ...)
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 12/12] tests: Add ipoctal232 qtest Andreas Färber
@ 2014-02-10  3:46 ` Alexey Kardashevskiy
  2014-02-10  3:52 ` [Qemu-devel] [PATCH 0/2] tests-ppc64: add spapr phb test Alexey Kardashevskiy
  2014-02-10 16:07 ` [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Stefan Hajnoczi
  14 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-10  3:46 UTC (permalink / raw)
  To: Andreas Färber, qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Stefan Hajnoczi, Michael S. Tsirkin,
	Alberto Garcia, Anthony Liguori, Paolo Bonzini

On 02/09/2014 10:57 PM, Andreas Färber wrote:
> Hello Stefan and Michael,
> 
> This series starts preparing tests to cover optional PCI devices. They don't do
> any functional tests but assure that QOM/PCI/VMState refactorings don't break
> the basic usage of devices not covered by qom-test.
> 
> pcnet-test.c is intended to handle sparc's lance as well.
> 
> v2 starts to cover virtio devices and covers ipack.
> 
> NB that the Makefile is being prepared for testing ...
> * PCI devices on different architectures and
> * VirtIO devices on different transports and
> * IndustryPack devices on different bridges,
> but the tests themselves will need some follow-up for choosing the right -machine
> or adding the required bus -device. My focus for now is on testing devices at all.
> 
> I'd like to include the IndustryPack tests in my upcoming pull (Monday) and am
> hoping I can do so on top of the original set of NIC tests for convenience.


How to apply these patches? They are quoted printable and "git am" does not
parse them.

Besides that, I have a spapr-phb test which I posted here months ago but
nobody seems to notice it :) I'll post it in this thread, it could go
together with the other tests in this set.


> 
> Regards,
> Andreas
> 
> v1 -> v2:
> * Reordered includes (stefanha)
> * Used qtest_end() where applicable
> * Added qtest for tpci200 and ipoctal232 (for my IndustryPack refactoring series)
> * Added qtests for ne2000, virtio-net, virtio-blk, virtio-balloon, virtio-rng
> 
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Alberto Garcia <agarcia@igalia.com>
> Cc: Anthony Liguori <anthony@codemonkey.ws>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> 
> Andreas Färber (12):
>   tests: Add e1000 qtest
>   tests: Add vmxnet3 qtest
>   tests: Add rtl8139 qtest
>   tests: Add pcnet qtest
>   tests: Add eepro100 qtest
>   tests: Add tpci200 qtest
>   tests: Add ne2000 qtest
>   tests: Add virtio-net qtest
>   tests: Add virtio-blk qtest
>   tests: Add virtio-balloon qtest
>   tests: Add virtio-rng qtest
>   tests: Add ipoctal232 qtest
> 
>  tests/Makefile              | 49 +++++++++++++++++++++++++++++++++++
>  tests/e1000-test.c          | 33 ++++++++++++++++++++++++
>  tests/eepro100-test.c       | 63 +++++++++++++++++++++++++++++++++++++++++++++
>  tests/ipoctal232-test.c     | 33 ++++++++++++++++++++++++
>  tests/ne2000-test.c         | 33 ++++++++++++++++++++++++
>  tests/pcnet-test.c          | 33 ++++++++++++++++++++++++
>  tests/rtl8139-test.c        | 33 ++++++++++++++++++++++++
>  tests/tpci200-test.c        | 33 ++++++++++++++++++++++++
>  tests/virtio-balloon-test.c | 33 ++++++++++++++++++++++++
>  tests/virtio-blk-test.c     | 34 ++++++++++++++++++++++++
>  tests/virtio-net-test.c     | 33 ++++++++++++++++++++++++
>  tests/virtio-rng-test.c     | 33 ++++++++++++++++++++++++
>  tests/vmxnet3-test.c        | 33 ++++++++++++++++++++++++
>  13 files changed, 476 insertions(+)
>  create mode 100644 tests/e1000-test.c
>  create mode 100644 tests/eepro100-test.c
>  create mode 100644 tests/ipoctal232-test.c
>  create mode 100644 tests/ne2000-test.c
>  create mode 100644 tests/pcnet-test.c
>  create mode 100644 tests/rtl8139-test.c
>  create mode 100644 tests/tpci200-test.c
>  create mode 100644 tests/virtio-balloon-test.c
>  create mode 100644 tests/virtio-blk-test.c
>  create mode 100644 tests/virtio-net-test.c
>  create mode 100644 tests/virtio-rng-test.c
>  create mode 100644 tests/vmxnet3-test.c
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH 0/2] tests-ppc64: add spapr phb test
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (12 preceding siblings ...)
  2014-02-10  3:46 ` [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Alexey Kardashevskiy
@ 2014-02-10  3:52 ` Alexey Kardashevskiy
  2014-02-10  3:52   ` [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule Alexey Kardashevskiy
  2014-02-10  3:52   ` [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge Alexey Kardashevskiy
  2014-02-10 16:07 ` [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Stefan Hajnoczi
  14 siblings, 2 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-10  3:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf, Andreas Färber

This adds ppc64 to check-cleanup rule in tests/Makefile and adds
a test for SPAPR PHB.


Alexey Kardashevskiy (2):
  tests-ppc64: add to cleanup rule
  tests-ppc64: test for -device spapr-pci-host-bridge

 tests/Makefile         |  4 +++-
 tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 tests/spapr-phb-test.c

-- 
1.8.4.rc4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule
  2014-02-10  3:52 ` [Qemu-devel] [PATCH 0/2] tests-ppc64: add spapr phb test Alexey Kardashevskiy
@ 2014-02-10  3:52   ` Alexey Kardashevskiy
  2014-02-10 20:32     ` Andreas Färber
  2014-02-10  3:52   ` [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge Alexey Kardashevskiy
  1 sibling, 1 reply; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-10  3:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf, Andreas Färber

This adds $(check-qtest-ppc64-y) to the check-clean rule.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/Makefile b/tests/Makefile
index 0aaf657..3a00ea7 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -319,7 +319,7 @@ check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest
 check-clean:
 	$(MAKE) -C tests/tcg clean
-	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
+	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) $(check-qtest-ppc64-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
 
 clean: check-clean
 
-- 
1.8.4.rc4

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge
  2014-02-10  3:52 ` [Qemu-devel] [PATCH 0/2] tests-ppc64: add spapr phb test Alexey Kardashevskiy
  2014-02-10  3:52   ` [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule Alexey Kardashevskiy
@ 2014-02-10  3:52   ` Alexey Kardashevskiy
  2014-02-10 15:48     ` Andreas Färber
  1 sibling, 1 reply; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-10  3:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf, Andreas Färber

This adds a test if SPAPR PHB can be added via the command line.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 tests/Makefile         |  2 ++
 tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 tests/spapr-phb-test.c

diff --git a/tests/Makefile b/tests/Makefile
index 3a00ea7..303225e 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -117,6 +117,7 @@ check-qtest-s390x-y += tests/qom-test$(EXESUF)
 check-qtest-unicore32-y += tests/qom-test$(EXESUF)
 check-qtest-xtensa-y += tests/qom-test$(EXESUF)
 check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
+check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
 
 check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
         comments.json empty.json funny-char.json indented-expr.json \
@@ -203,6 +204,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..8cad354
--- /dev/null
+++ b/tests/spapr-phb-test.c
@@ -0,0 +1,28 @@
+/*
+ * QTest testcase for SPAPR PHB
+ *
+ * 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"
+
+static void test_phb_device(void)
+{
+    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
+
+    qtest_end();
+}
+
+int main(int argc, char **argv)
+{
+    g_test_init(&argc, &argv, NULL);
+
+    qtest_add_func("/qmp/phb_device", test_phb_device);
+
+    return g_test_run();
+}
+
-- 
1.8.4.rc4

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH qom-next v2 02/12] tests: Add vmxnet3 qtest
  2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 02/12] tests: Add vmxnet3 qtest Andreas Färber
@ 2014-02-10  6:56   ` Dmitry Fleytman
  0 siblings, 0 replies; 31+ messages in thread
From: Dmitry Fleytman @ 2014-02-10  6:56 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel, Stefan Hajnoczi


On Feb 9, 2014, at 13:57 PM, Andreas Färber <afaerber@suse.de> wrote:

> Note that this will emit a warning:
> [vmxnet3][WR][vmxnet3_peer_has_vnet_hdr]: Peer has no virtio extension.
> Task offloads will be emulated.
> 
> Cc: Dmitry Fleytman <dmitry@daynix.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> tests/Makefile       |  5 +++++
> tests/vmxnet3-test.c | 33 +++++++++++++++++++++++++++++++++
> 2 files changed, 38 insertions(+)
> create mode 100644 tests/vmxnet3-test.c

Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>

> 
> diff --git a/tests/Makefile b/tests/Makefile
> index 57e21fc..323c600 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -83,6 +83,10 @@ check-qtest-i386-y += tests/blockdev-test$(EXESUF)
> check-qtest-i386-y += tests/qdev-monitor-test$(EXESUF)
> check-qtest-i386-y += $(check-qtest-pci-y)
> gcov-files-i386-y += $(gcov-files-pci-y)
> +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-x86_64-y = $(check-qtest-i386-y)
> gcov-files-i386-y += i386-softmmu/hw/mc146818rtc.c
> gcov-files-x86_64-y = $(subst i386-softmmu/,x86_64-softmmu/,$(gcov-files-i386-y))
> @@ -203,6 +207,7 @@ tests/tmp105-test$(EXESUF): tests/tmp105-test.o $(libqos-omap-obj-y)
> tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y)
> tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y)
> tests/e1000-test$(EXESUF): tests/e1000-test.o
> +tests/vmxnet3-test$(EXESUF): tests/vmxnet3-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)
> diff --git a/tests/vmxnet3-test.c b/tests/vmxnet3-test.c
> new file mode 100644
> index 0000000..a2ebed3
> --- /dev/null
> +++ b/tests/vmxnet3-test.c
> @@ -0,0 +1,33 @@
> +/*
> + * QTest testcase for vmxnet3 NIC
> + *
> + * Copyright (c) 2013-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("/vmxnet3/nop", nop);
> +
> +    qtest_start("-device vmxnet3");
> +    ret = g_test_run();
> +
> +    qtest_end();
> +
> +    return ret;
> +}
> -- 
> 1.8.4.5
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge
  2014-02-10  3:52   ` [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge Alexey Kardashevskiy
@ 2014-02-10 15:48     ` Andreas Färber
  2014-02-14  4:05       ` Alexey Kardashevskiy
  0 siblings, 1 reply; 31+ messages in thread
From: Andreas Färber @ 2014-02-10 15:48 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-devel; +Cc: qemu-ppc, Alexander Graf

Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
> This adds a test if SPAPR PHB can be added via the command line.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  tests/Makefile         |  2 ++
>  tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
>  create mode 100644 tests/spapr-phb-test.c
> 
> diff --git a/tests/Makefile b/tests/Makefile
> index 3a00ea7..303225e 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -117,6 +117,7 @@ check-qtest-s390x-y += tests/qom-test$(EXESUF)
>  check-qtest-unicore32-y += tests/qom-test$(EXESUF)
>  check-qtest-xtensa-y += tests/qom-test$(EXESUF)
>  check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
> +check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
>  
>  check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
>          comments.json empty.json funny-char.json indented-expr.json \
> @@ -203,6 +204,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..8cad354
> --- /dev/null
> +++ b/tests/spapr-phb-test.c
> @@ -0,0 +1,28 @@
> +/*
> + * QTest testcase for SPAPR PHB
> + *

Missing some IBM or aik copyright?

> + * 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"
> +
> +static void test_phb_device(void)
> +{
> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
> +
> +    qtest_end();
> +}
> +
> +int main(int argc, char **argv)
> +{
> +    g_test_init(&argc, &argv, NULL);
> +
> +    qtest_add_func("/qmp/phb_device", test_phb_device);
> +
> +    return g_test_run();
> +}
> +

Trailing white line FWIW.

This is looking good, thanks for your work. Apart from the device
there's nothing ppc-specific in here, so I might take it through
qom-next. One nit here is the test name, which I think should rather be
/spapr-phb/device (nothing QMP-specific in there) - I could tweak that
for you.

Another question is, do you plan to test variations of the device?
Otherwise I would suggest to place the qtest_start() and qtest_end()
into main(), so that individual future tests can test certain
functionalities on the instantiated device rather than repeatedly
launching QEMU processes.

Regards,
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] 31+ messages in thread

* Re: [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests
  2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
                   ` (13 preceding siblings ...)
  2014-02-10  3:52 ` [Qemu-devel] [PATCH 0/2] tests-ppc64: add spapr phb test Alexey Kardashevskiy
@ 2014-02-10 16:07 ` Stefan Hajnoczi
  2014-02-10 16:54   ` Andreas Färber
  14 siblings, 1 reply; 31+ messages in thread
From: Stefan Hajnoczi @ 2014-02-10 16:07 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Kevin Wolf, Peter Maydell, Anthony Liguori, Michael S. Tsirkin,
	Alexey Kardashevskiy, Alberto Garcia, qemu-devel,
	Stefan Hajnoczi, Paolo Bonzini

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests
  2014-02-10 16:07 ` [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Stefan Hajnoczi
@ 2014-02-10 16:54   ` Andreas Färber
  0 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-02-10 16:54 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Kevin Wolf, Peter Maydell, Anthony Liguori, Michael S. Tsirkin,
	Alexey Kardashevskiy, Alberto Garcia, qemu-devel,
	Stefan Hajnoczi, Paolo Bonzini

Am 10.02.2014 17:07, schrieb Stefan Hajnoczi:
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Thanks, applied all NIC and IndustryPack patches to qom-next, reordered
so that NICs are together and IndustryPack tests come before
IndustryPack refactorings:

https://github.com/afaerber/qemu-cpu/commits/qom-next

Remaining virtio patches are left out for now for further review.

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] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule
  2014-02-10  3:52   ` [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule Alexey Kardashevskiy
@ 2014-02-10 20:32     ` Andreas Färber
  2014-02-14  4:03       ` Alexey Kardashevskiy
  0 siblings, 1 reply; 31+ messages in thread
From: Andreas Färber @ 2014-02-10 20:32 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-devel, Peter Maydell; +Cc: qemu-ppc, Alexander Graf

Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
> This adds $(check-qtest-ppc64-y) to the check-clean rule.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Nice catch!

> ---
>  tests/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/Makefile b/tests/Makefile
> index 0aaf657..3a00ea7 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -319,7 +319,7 @@ check-block: $(patsubst %,check-%, $(check-block-y))
>  check: check-qapi-schema check-unit check-qtest
>  check-clean:
>  	$(MAKE) -C tests/tcg clean
> -	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
> +	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) $(check-qtest-ppc64-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>  
>  clean: check-clean
>  

Can we use a $(foreach ...) for $(check-qtest-*-y) like Peter did for
adding qom-test?

http://patchwork.ozlabs.org/patch/313650/

Regards,
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] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule
  2014-02-10 20:32     ` Andreas Färber
@ 2014-02-14  4:03       ` Alexey Kardashevskiy
  2014-02-28  2:17         ` Alexey Kardashevskiy
                           ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-14  4:03 UTC (permalink / raw)
  To: Andreas Färber, qemu-devel, Peter Maydell; +Cc: qemu-ppc, Alexander Graf

On 02/11/2014 07:32 AM, Andreas Färber wrote:
> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>> This adds $(check-qtest-ppc64-y) to the check-clean rule.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> 
> Nice catch!
> 
>> ---
>>  tests/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tests/Makefile b/tests/Makefile
>> index 0aaf657..3a00ea7 100644
>> --- a/tests/Makefile
>> +++ b/tests/Makefile
>> @@ -319,7 +319,7 @@ check-block: $(patsubst %,check-%, $(check-block-y))
>>  check: check-qapi-schema check-unit check-qtest
>>  check-clean:
>>  	$(MAKE) -C tests/tcg clean
>> -	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>> +	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) $(check-qtest-ppc64-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>>  
>>  clean: check-clean
>>  
> 
> Can we use a $(foreach ...) for $(check-qtest-*-y) like Peter did for
> adding qom-test?
> 
> http://patchwork.ozlabs.org/patch/313650/

Like this? Against what should I rebase my patches and repost them?


diff --git a/tests/Makefile b/tests/Makefile
index 94b32b7..2577843 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -323,7 +323,9 @@ check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest
 check-clean:
        $(MAKE) -C tests/tcg clean
-       rm -rf $(check-unit-y) $(check-qtest-i386-y)
$(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) t
+       $(eval rmlist = $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y))
+       $(foreach target,$(SYSEMU_TARGET_LIST), $(eval rmlist +=
$(check-qtest-$(target)-y)))
+       rm -rf $(rmlist)

 clean: check-clean



-- 
Alexey

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge
  2014-02-10 15:48     ` Andreas Färber
@ 2014-02-14  4:05       ` Alexey Kardashevskiy
  2014-03-05 20:42         ` Andreas Färber
  0 siblings, 1 reply; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-14  4:05 UTC (permalink / raw)
  To: Andreas Färber, qemu-devel; +Cc: qemu-ppc, Alexander Graf

On 02/11/2014 02:48 AM, Andreas Färber wrote:
> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>> This adds a test if SPAPR PHB can be added via the command line.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>  tests/Makefile         |  2 ++
>>  tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
>>  2 files changed, 30 insertions(+)
>>  create mode 100644 tests/spapr-phb-test.c
>>
>> diff --git a/tests/Makefile b/tests/Makefile
>> index 3a00ea7..303225e 100644
>> --- a/tests/Makefile
>> +++ b/tests/Makefile
>> @@ -117,6 +117,7 @@ check-qtest-s390x-y += tests/qom-test$(EXESUF)
>>  check-qtest-unicore32-y += tests/qom-test$(EXESUF)
>>  check-qtest-xtensa-y += tests/qom-test$(EXESUF)
>>  check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
>> +check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
>>  
>>  check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
>>          comments.json empty.json funny-char.json indented-expr.json \
>> @@ -203,6 +204,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..8cad354
>> --- /dev/null
>> +++ b/tests/spapr-phb-test.c
>> @@ -0,0 +1,28 @@
>> +/*
>> + * QTest testcase for SPAPR PHB
>> + *
> 
> Missing some IBM or aik copyright?
> 
>> + * 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"
>> +
>> +static void test_phb_device(void)
>> +{
>> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
>> +
>> +    qtest_end();
>> +}
>> +
>> +int main(int argc, char **argv)
>> +{
>> +    g_test_init(&argc, &argv, NULL);
>> +
>> +    qtest_add_func("/qmp/phb_device", test_phb_device);
>> +
>> +    return g_test_run();
>> +}
>> +
> 
> Trailing white line FWIW.
> 
> This is looking good, thanks for your work. Apart from the device
> there's nothing ppc-specific in here, so I might take it through
> qom-next. One nit here is the test name, which I think should rather be
> /spapr-phb/device (nothing QMP-specific in there) - I could tweak that
> for you.
> 
> Another question is, do you plan to test variations of the device?
> Otherwise I would suggest to place the qtest_start() and qtest_end()
> into main(), so that individual future tests can test certain
> functionalities on the instantiated device rather than repeatedly
> launching QEMU processes.

Is this better? It does the job.

I am not quite sure what qtest_add_func() is for. Is there any good example
of calling such a function via json or whatever it is? Thanks.


diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
new file mode 100644
index 0000000..11f186c
--- /dev/null
+++ b/tests/spapr-phb-test.c
@@ -0,0 +1,24 @@
+/*
+ * 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"
+
+int main(int argc, char **argv)
+{
+    g_test_init(&argc, &argv, NULL);
+
+    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
+    qtest_end();
+
+    return g_test_run();
+}




-- 
Alexey

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule
  2014-02-14  4:03       ` Alexey Kardashevskiy
@ 2014-02-28  2:17         ` Alexey Kardashevskiy
  2014-03-05 20:48         ` Andreas Färber
  2014-04-07 16:08         ` Peter Maydell
  2 siblings, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-28  2:17 UTC (permalink / raw)
  To: Andreas Färber, qemu-devel, Peter Maydell; +Cc: qemu-ppc, Alexander Graf

On 02/14/2014 03:03 PM, Alexey Kardashevskiy wrote:
> On 02/11/2014 07:32 AM, Andreas Färber wrote:
>> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>>> This adds $(check-qtest-ppc64-y) to the check-clean rule.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>
>> Nice catch!
>>
>>> ---
>>>  tests/Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/Makefile b/tests/Makefile
>>> index 0aaf657..3a00ea7 100644
>>> --- a/tests/Makefile
>>> +++ b/tests/Makefile
>>> @@ -319,7 +319,7 @@ check-block: $(patsubst %,check-%, $(check-block-y))
>>>  check: check-qapi-schema check-unit check-qtest
>>>  check-clean:
>>>  	$(MAKE) -C tests/tcg clean
>>> -	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>>> +	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) $(check-qtest-ppc64-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>>>  
>>>  clean: check-clean
>>>  
>>
>> Can we use a $(foreach ...) for $(check-qtest-*-y) like Peter did for
>> adding qom-test?
>>
>> http://patchwork.ozlabs.org/patch/313650/
> 
> Like this? Against what should I rebase my patches and repost them?

Ping?


> 
> diff --git a/tests/Makefile b/tests/Makefile
> index 94b32b7..2577843 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -323,7 +323,9 @@ check-block: $(patsubst %,check-%, $(check-block-y))
>  check: check-qapi-schema check-unit check-qtest
>  check-clean:
>         $(MAKE) -C tests/tcg clean
> -       rm -rf $(check-unit-y) $(check-qtest-i386-y)
> $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) t
> +       $(eval rmlist = $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y))
> +       $(foreach target,$(SYSEMU_TARGET_LIST), $(eval rmlist +=
> $(check-qtest-$(target)-y)))
> +       rm -rf $(rmlist)
> 
>  clean: check-clean
> 
> 
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge
  2014-02-14  4:05       ` Alexey Kardashevskiy
@ 2014-03-05 20:42         ` Andreas Färber
  2014-03-06  1:59           ` Alexey Kardashevskiy
  0 siblings, 1 reply; 31+ messages in thread
From: Andreas Färber @ 2014-03-05 20:42 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-devel; +Cc: qemu-ppc, Alexander Graf

Am 14.02.2014 05:05, schrieb Alexey Kardashevskiy:
> On 02/11/2014 02:48 AM, Andreas Färber wrote:
>> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>>> This adds a test if SPAPR PHB can be added via the command line.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> ---
>>>  tests/Makefile         |  2 ++
>>>  tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
>>>  2 files changed, 30 insertions(+)
>>>  create mode 100644 tests/spapr-phb-test.c
>>>
>>> diff --git a/tests/Makefile b/tests/Makefile
>>> index 3a00ea7..303225e 100644
>>> --- a/tests/Makefile
>>> +++ b/tests/Makefile
>>> @@ -117,6 +117,7 @@ check-qtest-s390x-y += tests/qom-test$(EXESUF)
>>>  check-qtest-unicore32-y += tests/qom-test$(EXESUF)
>>>  check-qtest-xtensa-y += tests/qom-test$(EXESUF)
>>>  check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
>>> +check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
>>>  
>>>  check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
>>>          comments.json empty.json funny-char.json indented-expr.json \
>>> @@ -203,6 +204,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..8cad354
>>> --- /dev/null
>>> +++ b/tests/spapr-phb-test.c
>>> @@ -0,0 +1,28 @@
>>> +/*
>>> + * QTest testcase for SPAPR PHB
>>> + *
>>
>> Missing some IBM or aik copyright?
>>
>>> + * 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"
>>> +
>>> +static void test_phb_device(void)
>>> +{
>>> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
>>> +
>>> +    qtest_end();
>>> +}
>>> +
>>> +int main(int argc, char **argv)
>>> +{
>>> +    g_test_init(&argc, &argv, NULL);
>>> +
>>> +    qtest_add_func("/qmp/phb_device", test_phb_device);
>>> +
>>> +    return g_test_run();
>>> +}
>>> +
>>
>> Trailing white line FWIW.
>>
>> This is looking good, thanks for your work. Apart from the device
>> there's nothing ppc-specific in here, so I might take it through
>> qom-next. One nit here is the test name, which I think should rather be
>> /spapr-phb/device (nothing QMP-specific in there) - I could tweak that
>> for you.
>>
>> Another question is, do you plan to test variations of the device?
>> Otherwise I would suggest to place the qtest_start() and qtest_end()
>> into main(), so that individual future tests can test certain
>> functionalities on the instantiated device rather than repeatedly
>> launching QEMU processes.
> 
> Is this better? It does the job.

Hmm... ;)

> I am not quite sure what qtest_add_func() is for. Is there any good example
> of calling such a function via json or whatever it is? Thanks.

There are lots of other tests/*-test.c files, including the series you
replied to. I've tweaked your original patch so that it outputs:

$ make check-qtest-ppc64 V=1
[...]
TEST: tests/spapr-phb-test... (pid=3080)
  /ppc64/spapr-phb/device:                                            OK
PASS: tests/spapr-phb-test

"/spapr-phb/device" is the name of the unit test supplied to
qtest_add_func(), which then prepends the architecture for uniqueness.
Without calling it, there is no indication that the test was successful.

Individual tests reading/writing registers etc. will need the
qemu-system-ppc64 process running, so g_test_run() needs to go before
qtest_end(). Or if you want to launch it multiple times (e.g. with
different parameters) place it into the test function like originally.

Your test did not pass on qemu.git or qom-next - I picked up the
corresponding fix from ppc-next to reallow -device spapr-pci-host-bridge.

Further the patch was missing a line for gcov to pick up the .o file:

Gcov report for ppc64-softmmu/hw/ppc/spapr_pci.c:
File '/home/andreas/QEMU/qemu/hw/ppc/spapr_pci.c'
Lines executed:42.98% of 342

File '../trace/generated-tracers.h'
Lines executed:0.00% of 12

File '/usr/include/libfdt.h'
Lines executed:100.00% of 5

File '/usr/include/libfdt_env.h'
Lines executed:100.00% of 2

File '/home/andreas/QEMU/qemu/include/hw/pci-host/spapr.h'
Lines executed:0.00% of 2

File '/home/andreas/QEMU/qemu/include/hw/ppc/spapr.h'
Lines executed:22.22% of 9

File '/home/andreas/QEMU/qemu/include/hw/pci/pci.h'
Lines executed:0.00% of 4

File '/home/andreas/QEMU/qemu/include/hw/irq.h'
Lines executed:0.00% of 4

File '/home/andreas/QEMU/qemu/include/qemu/bitops.h'
Lines executed:100.00% of 5

File '/home/andreas/QEMU/qemu/include/qemu/bswap.h'
Lines executed:100.00% of 6

File '/usr/include/bits/byteswap.h'
Lines executed:100.00% of 4


Regards,
Andreas

> diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
> new file mode 100644
> index 0000000..11f186c
> --- /dev/null
> +++ b/tests/spapr-phb-test.c
> @@ -0,0 +1,24 @@
> +/*
> + * 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"
> +
> +int main(int argc, char **argv)
> +{
> +    g_test_init(&argc, &argv, NULL);
> +
> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
> +    qtest_end();
> +
> +    return g_test_run();
> +}

-- 
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] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule
  2014-02-14  4:03       ` Alexey Kardashevskiy
  2014-02-28  2:17         ` Alexey Kardashevskiy
@ 2014-03-05 20:48         ` Andreas Färber
  2014-04-07 16:08         ` Peter Maydell
  2 siblings, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-03-05 20:48 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-devel, Peter Maydell
  Cc: Paolo Bonzini, qemu-ppc, Alexander Graf, Markus Armbruster

Am 14.02.2014 05:03, schrieb Alexey Kardashevskiy:
> On 02/11/2014 07:32 AM, Andreas Färber wrote:
>> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>>> This adds $(check-qtest-ppc64-y) to the check-clean rule.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>
>> Nice catch!
>>
>>> ---
>>>  tests/Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/Makefile b/tests/Makefile
>>> index 0aaf657..3a00ea7 100644
>>> --- a/tests/Makefile
>>> +++ b/tests/Makefile
>>> @@ -319,7 +319,7 @@ check-block: $(patsubst %,check-%, $(check-block-y))
>>>  check: check-qapi-schema check-unit check-qtest
>>>  check-clean:
>>>  	$(MAKE) -C tests/tcg clean
>>> -	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>>> +	rm -rf $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) $(check-qtest-ppc64-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>>>  
>>>  clean: check-clean
>>>  
>>
>> Can we use a $(foreach ...) for $(check-qtest-*-y) like Peter did for
>> adding qom-test?
>>
>> http://patchwork.ozlabs.org/patch/313650/
> 
> Like this?

Maybe. Waiting for review from Peter (who did the foreach for qom-test)
or anyone.

> Against what should I rebase my patches and repost them?

Sorry, didn't see this question...

Pushed a new working branch:
https://github.com/afaerber/qemu-cpu/commits/qtest

Some more tests were already pulled in, queue for upstream is:
https://github.com/afaerber/qemu-cpu/commits/qom-next

Regards,
Andreas

> diff --git a/tests/Makefile b/tests/Makefile
> index 94b32b7..2577843 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -323,7 +323,9 @@ check-block: $(patsubst %,check-%, $(check-block-y))
>  check: check-qapi-schema check-unit check-qtest
>  check-clean:
>         $(MAKE) -C tests/tcg clean
> -       rm -rf $(check-unit-y) $(check-qtest-i386-y)
> $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) t
> +       $(eval rmlist = $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y))
> +       $(foreach target,$(SYSEMU_TARGET_LIST), $(eval rmlist +=
> $(check-qtest-$(target)-y)))
> +       rm -rf $(rmlist)
> 
>  clean: check-clean
> 

-- 
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] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge
  2014-03-05 20:42         ` Andreas Färber
@ 2014-03-06  1:59           ` Alexey Kardashevskiy
  2014-03-12  2:13             ` Alexey Kardashevskiy
  2014-03-13  2:13             ` Andreas Färber
  0 siblings, 2 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-03-06  1:59 UTC (permalink / raw)
  To: Andreas Färber, qemu-devel; +Cc: qemu-ppc, Alexander Graf

On 03/06/2014 07:42 AM, Andreas Färber wrote:
> Am 14.02.2014 05:05, schrieb Alexey Kardashevskiy:
>> On 02/11/2014 02:48 AM, Andreas Färber wrote:
>>> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>>>> This adds a test if SPAPR PHB can be added via the command line.
>>>>
>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> ---
>>>>  tests/Makefile         |  2 ++
>>>>  tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
>>>>  2 files changed, 30 insertions(+)
>>>>  create mode 100644 tests/spapr-phb-test.c
>>>>
>>>> diff --git a/tests/Makefile b/tests/Makefile
>>>> index 3a00ea7..303225e 100644
>>>> --- a/tests/Makefile
>>>> +++ b/tests/Makefile
>>>> @@ -117,6 +117,7 @@ check-qtest-s390x-y += tests/qom-test$(EXESUF)
>>>>  check-qtest-unicore32-y += tests/qom-test$(EXESUF)
>>>>  check-qtest-xtensa-y += tests/qom-test$(EXESUF)
>>>>  check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
>>>> +check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
>>>>  
>>>>  check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
>>>>          comments.json empty.json funny-char.json indented-expr.json \
>>>> @@ -203,6 +204,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..8cad354
>>>> --- /dev/null
>>>> +++ b/tests/spapr-phb-test.c
>>>> @@ -0,0 +1,28 @@
>>>> +/*
>>>> + * QTest testcase for SPAPR PHB
>>>> + *
>>>
>>> Missing some IBM or aik copyright?
>>>
>>>> + * 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"
>>>> +
>>>> +static void test_phb_device(void)
>>>> +{
>>>> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
>>>> +
>>>> +    qtest_end();
>>>> +}
>>>> +
>>>> +int main(int argc, char **argv)
>>>> +{
>>>> +    g_test_init(&argc, &argv, NULL);
>>>> +
>>>> +    qtest_add_func("/qmp/phb_device", test_phb_device);
>>>> +
>>>> +    return g_test_run();
>>>> +}
>>>> +
>>>
>>> Trailing white line FWIW.
>>>
>>> This is looking good, thanks for your work. Apart from the device
>>> there's nothing ppc-specific in here, so I might take it through
>>> qom-next. One nit here is the test name, which I think should rather be
>>> /spapr-phb/device (nothing QMP-specific in there) - I could tweak that
>>> for you.
>>>
>>> Another question is, do you plan to test variations of the device?
>>> Otherwise I would suggest to place the qtest_start() and qtest_end()
>>> into main(), so that individual future tests can test certain
>>> functionalities on the instantiated device rather than repeatedly
>>> launching QEMU processes.
>>
>> Is this better? It does the job.
> 
> Hmm... ;)
> 
>> I am not quite sure what qtest_add_func() is for. Is there any good example
>> of calling such a function via json or whatever it is? Thanks.
> 
> There are lots of other tests/*-test.c files, including the series you
> replied to. I've tweaked your original patch so that it outputs:
> 
> $ make check-qtest-ppc64 V=1
> [...]
> TEST: tests/spapr-phb-test... (pid=3080)
>   /ppc64/spapr-phb/device:                                            OK
> PASS: tests/spapr-phb-test
> 
> "/spapr-phb/device" is the name of the unit test supplied to
> qtest_add_func(), which then prepends the architecture for uniqueness.
> Without calling it, there is no indication that the test was successful.
> 
> Individual tests reading/writing registers etc. will need the
> qemu-system-ppc64 process running, so g_test_run() needs to go before
> qtest_end(). Or if you want to launch it multiple times (e.g. with
> different parameters) place it into the test function like originally.
> 
> Your test did not pass on qemu.git or qom-next - I picked up the
> corresponding fix from ppc-next to reallow -device spapr-pci-host-bridge.

Sure it did not pass, this is why I made the test ;)

But I wonder why this fix not gone to upstream immediately - it was breakage.


> Further the patch was missing a line for gcov to pick up the .o file:



> Gcov report for ppc64-softmmu/hw/ppc/spapr_pci.c:
> File '/home/andreas/QEMU/qemu/hw/ppc/spapr_pci.c'
> Lines executed:42.98% of 342



What did you do to get this output? None from "make check-help" seems to do
this.

btw it would nice if people updated "make check-help" when they add new
tests as without documentation this is all we have to know what tests are
there. For example, it was not very obvious how
check-tests/qemu-iotests-quick.sh is called and how it works.

Or there is some howto and I am just disturbingly blind? Thanks.


Also thanks for comments and tweaks but I still do not understand if I
still have to do anything regarding these 2 patches.


> 
> File '../trace/generated-tracers.h'
> Lines executed:0.00% of 12
> 
> File '/usr/include/libfdt.h'
> Lines executed:100.00% of 5
> 
> File '/usr/include/libfdt_env.h'
> Lines executed:100.00% of 2
> 
> File '/home/andreas/QEMU/qemu/include/hw/pci-host/spapr.h'
> Lines executed:0.00% of 2
> 
> File '/home/andreas/QEMU/qemu/include/hw/ppc/spapr.h'
> Lines executed:22.22% of 9
> 
> File '/home/andreas/QEMU/qemu/include/hw/pci/pci.h'
> Lines executed:0.00% of 4
> 
> File '/home/andreas/QEMU/qemu/include/hw/irq.h'
> Lines executed:0.00% of 4
> 
> File '/home/andreas/QEMU/qemu/include/qemu/bitops.h'
> Lines executed:100.00% of 5
> 
> File '/home/andreas/QEMU/qemu/include/qemu/bswap.h'
> Lines executed:100.00% of 6
> 
> File '/usr/include/bits/byteswap.h'
> Lines executed:100.00% of 4
> 
> 
> Regards,
> Andreas
> 
>> diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
>> new file mode 100644
>> index 0000000..11f186c
>> --- /dev/null
>> +++ b/tests/spapr-phb-test.c
>> @@ -0,0 +1,24 @@
>> +/*
>> + * 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"
>> +
>> +int main(int argc, char **argv)
>> +{
>> +    g_test_init(&argc, &argv, NULL);
>> +
>> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
>> +    qtest_end();
>> +
>> +    return g_test_run();
>> +}
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge
  2014-03-06  1:59           ` Alexey Kardashevskiy
@ 2014-03-12  2:13             ` Alexey Kardashevskiy
  2014-03-13  2:13             ` Andreas Färber
  1 sibling, 0 replies; 31+ messages in thread
From: Alexey Kardashevskiy @ 2014-03-12  2:13 UTC (permalink / raw)
  To: Andreas Färber, qemu-devel; +Cc: qemu-ppc, Alexander Graf

On 03/06/2014 12:59 PM, Alexey Kardashevskiy wrote:
> On 03/06/2014 07:42 AM, Andreas Färber wrote:
>> Am 14.02.2014 05:05, schrieb Alexey Kardashevskiy:
>>> On 02/11/2014 02:48 AM, Andreas Färber wrote:
>>>> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>>>>> This adds a test if SPAPR PHB can be added via the command line.
>>>>>
>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>>> ---
>>>>>  tests/Makefile         |  2 ++
>>>>>  tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
>>>>>  2 files changed, 30 insertions(+)
>>>>>  create mode 100644 tests/spapr-phb-test.c
>>>>>
>>>>> diff --git a/tests/Makefile b/tests/Makefile
>>>>> index 3a00ea7..303225e 100644
>>>>> --- a/tests/Makefile
>>>>> +++ b/tests/Makefile
>>>>> @@ -117,6 +117,7 @@ check-qtest-s390x-y += tests/qom-test$(EXESUF)
>>>>>  check-qtest-unicore32-y += tests/qom-test$(EXESUF)
>>>>>  check-qtest-xtensa-y += tests/qom-test$(EXESUF)
>>>>>  check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
>>>>> +check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
>>>>>  
>>>>>  check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
>>>>>          comments.json empty.json funny-char.json indented-expr.json \
>>>>> @@ -203,6 +204,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..8cad354
>>>>> --- /dev/null
>>>>> +++ b/tests/spapr-phb-test.c
>>>>> @@ -0,0 +1,28 @@
>>>>> +/*
>>>>> + * QTest testcase for SPAPR PHB
>>>>> + *
>>>>
>>>> Missing some IBM or aik copyright?
>>>>
>>>>> + * 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"
>>>>> +
>>>>> +static void test_phb_device(void)
>>>>> +{
>>>>> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
>>>>> +
>>>>> +    qtest_end();
>>>>> +}
>>>>> +
>>>>> +int main(int argc, char **argv)
>>>>> +{
>>>>> +    g_test_init(&argc, &argv, NULL);
>>>>> +
>>>>> +    qtest_add_func("/qmp/phb_device", test_phb_device);
>>>>> +
>>>>> +    return g_test_run();
>>>>> +}
>>>>> +
>>>>
>>>> Trailing white line FWIW.
>>>>
>>>> This is looking good, thanks for your work. Apart from the device
>>>> there's nothing ppc-specific in here, so I might take it through
>>>> qom-next. One nit here is the test name, which I think should rather be
>>>> /spapr-phb/device (nothing QMP-specific in there) - I could tweak that
>>>> for you.
>>>>
>>>> Another question is, do you plan to test variations of the device?
>>>> Otherwise I would suggest to place the qtest_start() and qtest_end()
>>>> into main(), so that individual future tests can test certain
>>>> functionalities on the instantiated device rather than repeatedly
>>>> launching QEMU processes.
>>>
>>> Is this better? It does the job.
>>
>> Hmm... ;)
>>
>>> I am not quite sure what qtest_add_func() is for. Is there any good example
>>> of calling such a function via json or whatever it is? Thanks.
>>
>> There are lots of other tests/*-test.c files, including the series you
>> replied to. I've tweaked your original patch so that it outputs:
>>
>> $ make check-qtest-ppc64 V=1
>> [...]
>> TEST: tests/spapr-phb-test... (pid=3080)
>>   /ppc64/spapr-phb/device:                                            OK
>> PASS: tests/spapr-phb-test
>>
>> "/spapr-phb/device" is the name of the unit test supplied to
>> qtest_add_func(), which then prepends the architecture for uniqueness.
>> Without calling it, there is no indication that the test was successful.
>>
>> Individual tests reading/writing registers etc. will need the
>> qemu-system-ppc64 process running, so g_test_run() needs to go before
>> qtest_end(). Or if you want to launch it multiple times (e.g. with
>> different parameters) place it into the test function like originally.
>>
>> Your test did not pass on qemu.git or qom-next - I picked up the
>> corresponding fix from ppc-next to reallow -device spapr-pci-host-bridge.
> 
> Sure it did not pass, this is why I made the test ;)
> 
> But I wonder why this fix not gone to upstream immediately - it was breakage.
> 
> 
>> Further the patch was missing a line for gcov to pick up the .o file:
> 
> 
> 
>> Gcov report for ppc64-softmmu/hw/ppc/spapr_pci.c:
>> File '/home/andreas/QEMU/qemu/hw/ppc/spapr_pci.c'
>> Lines executed:42.98% of 342
> 
> 
> 
> What did you do to get this output? None from "make check-help" seems to do
> this.
> 
> btw it would nice if people updated "make check-help" when they add new
> tests as without documentation this is all we have to know what tests are
> there. For example, it was not very obvious how
> check-tests/qemu-iotests-quick.sh is called and how it works.
> 
> Or there is some howto and I am just disturbingly blind? Thanks.
> 
> 
> Also thanks for comments and tweaks but I still do not understand if I
> still have to do anything regarding these 2 patches.


Andreas?


>> File '../trace/generated-tracers.h'
>> Lines executed:0.00% of 12
>>
>> File '/usr/include/libfdt.h'
>> Lines executed:100.00% of 5
>>
>> File '/usr/include/libfdt_env.h'
>> Lines executed:100.00% of 2
>>
>> File '/home/andreas/QEMU/qemu/include/hw/pci-host/spapr.h'
>> Lines executed:0.00% of 2
>>
>> File '/home/andreas/QEMU/qemu/include/hw/ppc/spapr.h'
>> Lines executed:22.22% of 9
>>
>> File '/home/andreas/QEMU/qemu/include/hw/pci/pci.h'
>> Lines executed:0.00% of 4
>>
>> File '/home/andreas/QEMU/qemu/include/hw/irq.h'
>> Lines executed:0.00% of 4
>>
>> File '/home/andreas/QEMU/qemu/include/qemu/bitops.h'
>> Lines executed:100.00% of 5
>>
>> File '/home/andreas/QEMU/qemu/include/qemu/bswap.h'
>> Lines executed:100.00% of 6
>>
>> File '/usr/include/bits/byteswap.h'
>> Lines executed:100.00% of 4
>>
>>
>> Regards,
>> Andreas
>>
>>> diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c
>>> new file mode 100644
>>> index 0000000..11f186c
>>> --- /dev/null
>>> +++ b/tests/spapr-phb-test.c
>>> @@ -0,0 +1,24 @@
>>> +/*
>>> + * 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"
>>> +
>>> +int main(int argc, char **argv)
>>> +{
>>> +    g_test_init(&argc, &argv, NULL);
>>> +
>>> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
>>> +    qtest_end();
>>> +
>>> +    return g_test_run();
>>> +}
>>
> 
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge
  2014-03-06  1:59           ` Alexey Kardashevskiy
  2014-03-12  2:13             ` Alexey Kardashevskiy
@ 2014-03-13  2:13             ` Andreas Färber
  1 sibling, 0 replies; 31+ messages in thread
From: Andreas Färber @ 2014-03-13  2:13 UTC (permalink / raw)
  To: Alexey Kardashevskiy, qemu-devel; +Cc: qemu-ppc, Alexander Graf

Am 06.03.2014 02:59, schrieb Alexey Kardashevskiy:
> On 03/06/2014 07:42 AM, Andreas Färber wrote:
>> Am 14.02.2014 05:05, schrieb Alexey Kardashevskiy:
>>> On 02/11/2014 02:48 AM, Andreas Färber wrote:
>>>> Am 10.02.2014 04:52, schrieb Alexey Kardashevskiy:
>>>>> This adds a test if SPAPR PHB can be added via the command line.
>>>>>
>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>>> ---
>>>>>  tests/Makefile         |  2 ++
>>>>>  tests/spapr-phb-test.c | 28 ++++++++++++++++++++++++++++
>>>>>  2 files changed, 30 insertions(+)
>>>>>  create mode 100644 tests/spapr-phb-test.c
>>>>>
>>>>> diff --git a/tests/Makefile b/tests/Makefile
>>>>> index 3a00ea7..303225e 100644
>>>>> --- a/tests/Makefile
>>>>> +++ b/tests/Makefile
>>>>> @@ -117,6 +117,7 @@ check-qtest-s390x-y += tests/qom-test$(EXESUF)
>>>>>  check-qtest-unicore32-y += tests/qom-test$(EXESUF)
>>>>>  check-qtest-xtensa-y += tests/qom-test$(EXESUF)
>>>>>  check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
>>>>> +check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF)
>>>>>  
>>>>>  check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
>>>>>          comments.json empty.json funny-char.json indented-expr.json \
>>>>> @@ -203,6 +204,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..8cad354
>>>>> --- /dev/null
>>>>> +++ b/tests/spapr-phb-test.c
>>>>> @@ -0,0 +1,28 @@
>>>>> +/*
>>>>> + * QTest testcase for SPAPR PHB
>>>>> + *
>>>>
>>>> Missing some IBM or aik copyright?
>>>>
>>>>> + * 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"
>>>>> +
>>>>> +static void test_phb_device(void)
>>>>> +{
>>>>> +    qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=100");
>>>>> +
>>>>> +    qtest_end();
>>>>> +}
>>>>> +
>>>>> +int main(int argc, char **argv)
>>>>> +{
>>>>> +    g_test_init(&argc, &argv, NULL);
>>>>> +
>>>>> +    qtest_add_func("/qmp/phb_device", test_phb_device);
>>>>> +
>>>>> +    return g_test_run();
>>>>> +}
>>>>> +
>>>>
>>>> Trailing white line FWIW.
>>>>
>>>> This is looking good, thanks for your work. Apart from the device
>>>> there's nothing ppc-specific in here, so I might take it through
>>>> qom-next. One nit here is the test name, which I think should rather be
>>>> /spapr-phb/device (nothing QMP-specific in there) - I could tweak that
>>>> for you.
>>>>
>>>> Another question is, do you plan to test variations of the device?
>>>> Otherwise I would suggest to place the qtest_start() and qtest_end()
>>>> into main(), so that individual future tests can test certain
>>>> functionalities on the instantiated device rather than repeatedly
>>>> launching QEMU processes.
>>>
>>> Is this better? It does the job.
>>
>> Hmm... ;)
>>
>>> I am not quite sure what qtest_add_func() is for. Is there any good example
>>> of calling such a function via json or whatever it is? Thanks.
>>
>> There are lots of other tests/*-test.c files, including the series you
>> replied to. I've tweaked your original patch so that it outputs:
>>
>> $ make check-qtest-ppc64 V=1
>> [...]
>> TEST: tests/spapr-phb-test... (pid=3080)
>>   /ppc64/spapr-phb/device:                                            OK
>> PASS: tests/spapr-phb-test
>>
>> "/spapr-phb/device" is the name of the unit test supplied to
>> qtest_add_func(), which then prepends the architecture for uniqueness.
>> Without calling it, there is no indication that the test was successful.
>>
>> Individual tests reading/writing registers etc. will need the
>> qemu-system-ppc64 process running, so g_test_run() needs to go before
>> qtest_end(). Or if you want to launch it multiple times (e.g. with
>> different parameters) place it into the test function like originally.
>>
>> Your test did not pass on qemu.git or qom-next - I picked up the
>> corresponding fix from ppc-next to reallow -device spapr-pci-host-bridge.
> 
> Sure it did not pass, this is why I made the test ;)
> 
> But I wonder why this fix not gone to upstream immediately - it was breakage.
> 
> 
>> Further the patch was missing a line for gcov to pick up the .o file:
> 
> 
> 
>> Gcov report for ppc64-softmmu/hw/ppc/spapr_pci.c:
>> File '/home/andreas/QEMU/qemu/hw/ppc/spapr_pci.c'
>> Lines executed:42.98% of 342
> 
> 
> 
> What did you do to get this output? None from "make check-help" seems to do
> this.

Configure a separate build directory with --enable-gcov, then run make
check* as usual.

> btw it would nice if people updated "make check-help" when they add new
> tests as without documentation this is all we have to know what tests are
> there. For example, it was not very obvious how
> check-tests/qemu-iotests-quick.sh is called and how it works.

Neither Alex nor me will feel responsible for this complaint and those
maintaining it are unlikely to read it here...

> Or there is some howto and I am just disturbingly blind? Thanks.
> 
> 
> Also thanks for comments and tweaks but I still do not understand if I
> still have to do anything regarding these 2 patches.

1/2 maybe - had ping'ed it for review. Bugfix, so still time.

2/2 is in my pull; obviously it's still just a stub, the libqos portion
still needs to be implemented to do any functional tests.
I.e. tests/libqos/pci-spapr.c, see pci-pc.c as template.

Cheers,
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] 31+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule
  2014-02-14  4:03       ` Alexey Kardashevskiy
  2014-02-28  2:17         ` Alexey Kardashevskiy
  2014-03-05 20:48         ` Andreas Färber
@ 2014-04-07 16:08         ` Peter Maydell
  2 siblings, 0 replies; 31+ messages in thread
From: Peter Maydell @ 2014-04-07 16:08 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: Alexander Graf, qemu-ppc, Andreas Färber, QEMU Developers

On 14 February 2014 04:03, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> Like this? Against what should I rebase my patches and repost them?
>
>
> diff --git a/tests/Makefile b/tests/Makefile
> index 94b32b7..2577843 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -323,7 +323,9 @@ check-block: $(patsubst %,check-%, $(check-block-y))
>  check: check-qapi-schema check-unit check-qtest
>  check-clean:
>         $(MAKE) -C tests/tcg clean
> -       rm -rf $(check-unit-y) $(check-qtest-i386-y)
> $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) t
> +       $(eval rmlist = $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y))
> +       $(foreach target,$(SYSEMU_TARGET_LIST), $(eval rmlist +=
> $(check-qtest-$(target)-y)))
> +       rm -rf $(rmlist)

You don't need this intermediate rmlist variable. It should be
possible to do something like
   rm -rf $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y))

(untested!)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2014-04-07 16:08 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-09 11:57 [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 01/12] tests: Add e1000 qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 02/12] tests: Add vmxnet3 qtest Andreas Färber
2014-02-10  6:56   ` Dmitry Fleytman
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 03/12] tests: Add rtl8139 qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 04/12] tests: Add pcnet qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 05/12] tests: Add eepro100 qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 06/12] tests: Add tpci200 qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 07/12] tests: Add ne2000 qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 08/12] tests: Add virtio-net qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 09/12] tests: Add virtio-blk qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 10/12] tests: Add virtio-balloon qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 11/12] tests: Add virtio-rng qtest Andreas Färber
2014-02-09 11:57 ` [Qemu-devel] [PATCH qom-next v2 12/12] tests: Add ipoctal232 qtest Andreas Färber
2014-02-10  3:46 ` [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Alexey Kardashevskiy
2014-02-10  3:52 ` [Qemu-devel] [PATCH 0/2] tests-ppc64: add spapr phb test Alexey Kardashevskiy
2014-02-10  3:52   ` [Qemu-devel] [PATCH 1/2] tests-ppc64: add to cleanup rule Alexey Kardashevskiy
2014-02-10 20:32     ` Andreas Färber
2014-02-14  4:03       ` Alexey Kardashevskiy
2014-02-28  2:17         ` Alexey Kardashevskiy
2014-03-05 20:48         ` Andreas Färber
2014-04-07 16:08         ` Peter Maydell
2014-02-10  3:52   ` [Qemu-devel] [PATCH 2/2] tests-ppc64: test for -device spapr-pci-host-bridge Alexey Kardashevskiy
2014-02-10 15:48     ` Andreas Färber
2014-02-14  4:05       ` Alexey Kardashevskiy
2014-03-05 20:42         ` Andreas Färber
2014-03-06  1:59           ` Alexey Kardashevskiy
2014-03-12  2:13             ` Alexey Kardashevskiy
2014-03-13  2:13             ` Andreas Färber
2014-02-10 16:07 ` [Qemu-devel] [PATCH qom-next v2 00/12] qtest: Prepare PCI NIC, virtio, IndustryPack tests Stefan Hajnoczi
2014-02-10 16:54   ` Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.