qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"Gabriel L. Somlo" <gsomlo@gmail.com>,
	Gabriel Somlo <somlo@cmu.edu>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL 4/5] tests: e1000: test additional device IDs
Date: Mon,  9 Jun 2014 15:43:05 +0200	[thread overview]
Message-ID: <1402321386-17773-5-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1402321386-17773-1-git-send-email-stefanha@redhat.com>

From: "Gabriel L. Somlo" <gsomlo@gmail.com>

Update e1000-test.c to check all currently supported devices.

Suggested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/e1000-test.c | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/tests/e1000-test.c b/tests/e1000-test.c
index a8ba2fc..53c41f8 100644
--- a/tests/e1000-test.c
+++ b/tests/e1000-test.c
@@ -13,21 +13,41 @@
 #include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
-static void nop(void)
+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);
+
+    if (s) {
+        qtest_quit(s);
+    }
+    g_free(args);
 }
 
+static const char *models[] = {
+    "e1000",
+    "e1000-82540em",
+    "e1000-82544gc",
+    "e1000-82545em",
+    "e1000-82573l",
+};
+
 int main(int argc, char **argv)
 {
-    int ret;
+    int i;
 
     g_test_init(&argc, &argv, NULL);
-    qtest_add_func("/e1000/nop", nop);
 
-    qtest_start("-device e1000");
-    ret = g_test_run();
+    for (i = 0; i < ARRAY_SIZE(models); i++) {
+        char *path;
 
-    qtest_end();
+        path = g_strdup_printf("/%s/e1000/%s", qtest_get_arch(), models[i]);
+        g_test_add_data_func(path, models[i], test_device);
+    }
 
-    return ret;
+    return g_test_run();
 }
-- 
1.9.3

  parent reply	other threads:[~2014-06-09 13:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 13:43 [Qemu-devel] [PULL 0/5] Net patches Stefan Hajnoczi
2014-06-09 13:43 ` [Qemu-devel] [PULL 1/5] net: xilinx_ethlite: Fix Rx-pong interrupt Stefan Hajnoczi
2014-06-09 13:43 ` [Qemu-devel] [PULL 2/5] vmxnet3: fix msix vectors unuse Stefan Hajnoczi
2014-06-09 13:43 ` [Qemu-devel] [PULL 3/5] e1000: allow command-line selection of card model Stefan Hajnoczi
2014-06-09 13:43 ` Stefan Hajnoczi [this message]
2014-06-09 13:43 ` [Qemu-devel] [PULL 5/5] e1000: remove broken support for 82573L Stefan Hajnoczi
2014-06-09 14:26 ` [Qemu-devel] [PULL 0/5] Net patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402321386-17773-5-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=gsomlo@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=somlo@cmu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).