qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests
@ 2014-02-05 17:01 Andreas Färber
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest Andreas Färber
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Andreas Färber @ 2014-02-05 17:01 UTC (permalink / raw)
  To: qemu-devel
  Cc: Anthony Liguori, Paolo Bonzini, Andreas Färber,
	Stefan Hajnoczi, Peter Maydell

Hello Stefan,

As discussed late last year, this series starts preparing tests to cover
optional NICs. They don't do any functional tests but assure that QOM/PCI
refactorings don't break the basic usage of these devices.

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

virtio-net is missing among others (is there any ongoing work on virtio
qtests?!), but I thought I'd get this out as a start. My goal will be to
have every optional device in 2.0 covered by such basic tests.
Hopefully it will also encourage people to write functional tests later on
and to copy these stubs for new devices!

Regards,
Andreas

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>

Andreas Färber (5):
  tests: Add e1000 qtest
  tests: Add vmxnet3 qtest
  tests: Add rtl8139 qtest
  tests: Add PC-Net qtest
  tests: Add eepro100 qtest

 tests/Makefile        | 22 +++++++++++++++++++
 tests/e1000-test.c    | 35 +++++++++++++++++++++++++++++
 tests/eepro100-test.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/pcnet-test.c    | 35 +++++++++++++++++++++++++++++
 tests/rtl8139-test.c  | 35 +++++++++++++++++++++++++++++
 tests/vmxnet3-test.c  | 35 +++++++++++++++++++++++++++++
 6 files changed, 223 insertions(+)
 create mode 100644 tests/e1000-test.c
 create mode 100644 tests/eepro100-test.c
 create mode 100644 tests/pcnet-test.c
 create mode 100644 tests/rtl8139-test.c
 create mode 100644 tests/vmxnet3-test.c

-- 
1.8.4.5

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

* [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest
  2014-02-05 17:01 [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Andreas Färber
@ 2014-02-05 17:01 ` Andreas Färber
  2014-02-07 15:48   ` Stefan Hajnoczi
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 2/5] tests: Add vmxnet3 qtest Andreas Färber
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Andreas Färber @ 2014-02-05 17:01 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     |  7 +++++++
 tests/e1000-test.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 42 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..a053703
--- /dev/null
+++ b/tests/e1000-test.c
@@ -0,0 +1,35 @@
+/*
+ * 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 "libqtest.h"
+
+#include <glib.h>
+#include <string.h>
+#include "qemu/osdep.h"
+
+static void nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+    QTestState *s;
+    int ret;
+
+    g_test_init(&argc, &argv, NULL);
+    qtest_add_func("/e1000/nop", nop);
+
+    s = qtest_start("-device e1000");
+    ret = g_test_run();
+
+    if (s) {
+        qtest_quit(s);
+    }
+
+    return ret;
+}
-- 
1.8.4.5

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

* [Qemu-devel] [PATCH qom-next 2/5] tests: Add vmxnet3 qtest
  2014-02-05 17:01 [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Andreas Färber
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest Andreas Färber
@ 2014-02-05 17:01 ` Andreas Färber
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 3/5] tests: Add rtl8139 qtest Andreas Färber
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2014-02-05 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile       |  5 +++++
 tests/vmxnet3-test.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 40 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..e3449e7
--- /dev/null
+++ b/tests/vmxnet3-test.c
@@ -0,0 +1,35 @@
+/*
+ * 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 "libqtest.h"
+
+#include <glib.h>
+#include <string.h>
+#include "qemu/osdep.h"
+
+static void nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+    QTestState *s;
+    int ret;
+
+    g_test_init(&argc, &argv, NULL);
+    qtest_add_func("/vmxnet3/nop", nop);
+
+    s = qtest_start("-device vmxnet3");
+    ret = g_test_run();
+
+    if (s) {
+        qtest_quit(s);
+    }
+
+    return ret;
+}
-- 
1.8.4.5

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

* [Qemu-devel] [PATCH qom-next 3/5] tests: Add rtl8139 qtest
  2014-02-05 17:01 [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Andreas Färber
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest Andreas Färber
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 2/5] tests: Add vmxnet3 qtest Andreas Färber
@ 2014-02-05 17:01 ` Andreas Färber
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 4/5] tests: Add PC-Net qtest Andreas Färber
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2014-02-05 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile       |  3 +++
 tests/rtl8139-test.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 38 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..ecce1b2
--- /dev/null
+++ b/tests/rtl8139-test.c
@@ -0,0 +1,35 @@
+/*
+ * 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 "libqtest.h"
+
+#include <glib.h>
+#include <string.h>
+#include "qemu/osdep.h"
+
+static void nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+    QTestState *s;
+    int ret;
+
+    g_test_init(&argc, &argv, NULL);
+    qtest_add_func("/rtl8139/nop", nop);
+
+    s = qtest_start("-device rtl8139");
+    ret = g_test_run();
+
+    if (s) {
+        qtest_quit(s);
+    }
+
+    return ret;
+}
-- 
1.8.4.5

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

* [Qemu-devel] [PATCH qom-next 4/5] tests: Add PC-Net qtest
  2014-02-05 17:01 [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Andreas Färber
                   ` (2 preceding siblings ...)
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 3/5] tests: Add rtl8139 qtest Andreas Färber
@ 2014-02-05 17:01 ` Andreas Färber
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 5/5] tests: Add eepro100 qtest Andreas Färber
  2014-02-07 15:50 ` [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Stefan Hajnoczi
  5 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2014-02-05 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Test PCI only for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile     |  4 ++++
 tests/pcnet-test.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 39 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..643b348
--- /dev/null
+++ b/tests/pcnet-test.c
@@ -0,0 +1,35 @@
+/*
+ * 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 "libqtest.h"
+
+#include <glib.h>
+#include <string.h>
+#include "qemu/osdep.h"
+
+static void pci_nop(void)
+{
+}
+
+int main(int argc, char **argv)
+{
+    QTestState *s;
+    int ret;
+
+    g_test_init(&argc, &argv, NULL);
+    qtest_add_func("/pcnet/pci/nop", pci_nop);
+
+    s = qtest_start("-device pcnet");
+    ret = g_test_run();
+
+    if (s) {
+        qtest_quit(s);
+    }
+
+    return ret;
+}
-- 
1.8.4.5

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

* [Qemu-devel] [PATCH qom-next 5/5] tests: Add eepro100 qtest
  2014-02-05 17:01 [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Andreas Färber
                   ` (3 preceding siblings ...)
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 4/5] tests: Add PC-Net qtest Andreas Färber
@ 2014-02-05 17:01 ` Andreas Färber
  2014-02-07 15:50 ` [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Stefan Hajnoczi
  5 siblings, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2014-02-05 17:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/Makefile        |  3 +++
 tests/eepro100-test.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 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..4d1dea9
--- /dev/null
+++ b/tests/eepro100-test.c
@@ -0,0 +1,61 @@
+/*
+ * 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 "libqtest.h"
+
+#include <glib.h>
+#include <string.h>
+#include "qemu/osdep.h"
+
+static void test_nop(gconstpointer data)
+{
+    const char *model = data;
+    QTestState *s;
+    char *args;
+
+    args = g_strdup_printf("-device %s", model);
+    s = qtest_start(args);
+
+    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/nop",
+                               qtest_get_arch(), models[i]);
+        g_test_add_data_func(path, models[i], test_nop);
+    }
+
+    return g_test_run();
+}
-- 
1.8.4.5

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

* Re: [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest Andreas Färber
@ 2014-02-07 15:48   ` Stefan Hajnoczi
  2014-02-07 18:06     ` Andreas Färber
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Hajnoczi @ 2014-02-07 15:48 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel

On Wed, Feb 05, 2014 at 06:01:13PM +0100, Andreas Färber wrote:
> +#include "libqtest.h"
> +
> +#include <glib.h>
> +#include <string.h>
> +#include "qemu/osdep.h"

Please put <system.h> includes before "user.h" includes.  That way we
can be sure our macros don't mess up system headers.

> +
> +static void nop(void)
> +{
> +}

I suggest a comment here to explain the point of this test:
/* The point of this test case is just to instantiate the device */

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

* Re: [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests
  2014-02-05 17:01 [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Andreas Färber
                   ` (4 preceding siblings ...)
  2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 5/5] tests: Add eepro100 qtest Andreas Färber
@ 2014-02-07 15:50 ` Stefan Hajnoczi
  5 siblings, 0 replies; 10+ messages in thread
From: Stefan Hajnoczi @ 2014-02-07 15:50 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Paolo Bonzini, qemu-devel, Anthony Liguori, Peter Maydell

On Wed, Feb 05, 2014 at 06:01:12PM +0100, Andreas Färber wrote:
> Hello Stefan,
> 
> As discussed late last year, this series starts preparing tests to cover
> optional NICs. They don't do any functional tests but assure that QOM/PCI
> refactorings don't break the basic usage of these devices.
> 
> pcnet-test.c is intended to handle sparc's lance as well.
> 
> virtio-net is missing among others (is there any ongoing work on virtio
> qtests?!), but I thought I'd get this out as a start. My goal will be to
> have every optional device in 2.0 covered by such basic tests.
> Hopefully it will also encourage people to write functional tests later on
> and to copy these stubs for new devices!
> 
> Regards,
> Andreas
> 
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Cc: Anthony Liguori <anthony@codemonkey.ws>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> 
> Andreas Färber (5):
>   tests: Add e1000 qtest
>   tests: Add vmxnet3 qtest
>   tests: Add rtl8139 qtest
>   tests: Add PC-Net qtest
>   tests: Add eepro100 qtest
> 
>  tests/Makefile        | 22 +++++++++++++++++++
>  tests/e1000-test.c    | 35 +++++++++++++++++++++++++++++
>  tests/eepro100-test.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/pcnet-test.c    | 35 +++++++++++++++++++++++++++++
>  tests/rtl8139-test.c  | 35 +++++++++++++++++++++++++++++
>  tests/vmxnet3-test.c  | 35 +++++++++++++++++++++++++++++
>  6 files changed, 223 insertions(+)
>  create mode 100644 tests/e1000-test.c
>  create mode 100644 tests/eepro100-test.c
>  create mode 100644 tests/pcnet-test.c
>  create mode 100644 tests/rtl8139-test.c
>  create mode 100644 tests/vmxnet3-test.c

Not much going on here, should be easy to merge.  I did leave comments
on the first patch, they apply to all other patches in the series as
well.

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

* Re: [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest
  2014-02-07 15:48   ` Stefan Hajnoczi
@ 2014-02-07 18:06     ` Andreas Färber
  2014-02-08 10:23       ` Stefan Hajnoczi
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Färber @ 2014-02-07 18:06 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel

Am 07.02.2014 16:48, schrieb Stefan Hajnoczi:
> On Wed, Feb 05, 2014 at 06:01:13PM +0100, Andreas Färber wrote:
>> +#include "libqtest.h"
>> +
>> +#include <glib.h>
>> +#include <string.h>
>> +#include "qemu/osdep.h"
> 
> Please put <system.h> includes before "user.h" includes.  That way we
> can be sure our macros don't mess up system headers.

You are right in this case, but to my defense I copied this from another
file. ;) You'll find the "libqtest.h"-first pattern in:

endianness-test.c
fw_cfg-test.c
i440fx-test.c
m48t59-test.c
qom-test.c
rtc-test.c
tmp105-test.c

To make it clearer which example to copy from, feel free to submit a
patch cleaning those up.

NB in general it can be a valid technique to place a single "user.h" in
user.c before the usual <system> and "user" headers to assure that it
does not depend on external includes, but clearly that's not the case here.

>> +
>> +static void nop(void)
>> +{
>> +}
> 
> I suggest a comment here to explain the point of this test:
> /* The point of this test case is just to instantiate the device */

Thanks, will add a TODO.

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

* Re: [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest
  2014-02-07 18:06     ` Andreas Färber
@ 2014-02-08 10:23       ` Stefan Hajnoczi
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Hajnoczi @ 2014-02-08 10:23 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-devel

On Fri, Feb 07, 2014 at 07:06:58PM +0100, Andreas Färber wrote:
> Am 07.02.2014 16:48, schrieb Stefan Hajnoczi:
> > On Wed, Feb 05, 2014 at 06:01:13PM +0100, Andreas Färber wrote:
> >> +#include "libqtest.h"
> >> +
> >> +#include <glib.h>
> >> +#include <string.h>
> >> +#include "qemu/osdep.h"
> > 
> > Please put <system.h> includes before "user.h" includes.  That way we
> > can be sure our macros don't mess up system headers.
> 
> You are right in this case, but to my defense I copied this from another
> file. ;) You'll find the "libqtest.h"-first pattern in:
> 
> endianness-test.c
> fw_cfg-test.c
> i440fx-test.c
> m48t59-test.c
> qom-test.c
> rtc-test.c
> tmp105-test.c
> 
> To make it clearer which example to copy from, feel free to submit a
> patch cleaning those up.

Okay, I will.  Thanks!

Stefan

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

end of thread, other threads:[~2014-02-08 10:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-05 17:01 [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Andreas Färber
2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 1/5] tests: Add e1000 qtest Andreas Färber
2014-02-07 15:48   ` Stefan Hajnoczi
2014-02-07 18:06     ` Andreas Färber
2014-02-08 10:23       ` Stefan Hajnoczi
2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 2/5] tests: Add vmxnet3 qtest Andreas Färber
2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 3/5] tests: Add rtl8139 qtest Andreas Färber
2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 4/5] tests: Add PC-Net qtest Andreas Färber
2014-02-05 17:01 ` [Qemu-devel] [PATCH qom-next 5/5] tests: Add eepro100 qtest Andreas Färber
2014-02-07 15:50 ` [Qemu-devel] [PATCH qom-next 0/5] qtest: Prepare PCI NIC tests Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).