qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PULL for-2.0 2/4] virtio-console-test: Test virtserialport as well
Date: Thu, 13 Mar 2014 21:47:13 +0100	[thread overview]
Message-ID: <1394743636-23848-3-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1394743636-23848-1-git-send-email-afaerber@suse.de>

A test is only as good as its coverage - testing virtserialport in
addition to virtconsole showed that commit
0399a3819b27083ba69b88a9baa9025facab85bd (virtio-console: QOM cast
cleanup for VirtConsole) broke virtserialport.

Acked-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/virtio-console-test.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/tests/virtio-console-test.c b/tests/virtio-console-test.c
index f98f5af2..6be96e8 100644
--- a/tests/virtio-console-test.c
+++ b/tests/virtio-console-test.c
@@ -13,8 +13,18 @@
 #include "qemu/osdep.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
-static void pci_nop(void)
+static void console_pci_nop(void)
 {
+    qtest_start("-device virtio-serial-pci,id=vser0 "
+                "-device virtconsole,bus=vser0.0");
+    qtest_end();
+}
+
+static void serialport_pci_nop(void)
+{
+    qtest_start("-device virtio-serial-pci,id=vser0 "
+                "-device virtserialport,bus=vser0.0");
+    qtest_end();
 }
 
 int main(int argc, char **argv)
@@ -22,13 +32,10 @@ int main(int argc, char **argv)
     int ret;
 
     g_test_init(&argc, &argv, NULL);
-    qtest_add_func("/virtio/console/pci/nop", pci_nop);
+    qtest_add_func("/virtio/console/pci/nop", console_pci_nop);
+    qtest_add_func("/virtio/serialport/pci/nop", serialport_pci_nop);
 
-    qtest_start("-device virtio-serial-pci,id=vser0 "
-                "-device virtconsole,bus=vser0.0");
     ret = g_test_run();
 
-    qtest_end();
-
     return ret;
 }
-- 
1.8.4.5

  parent reply	other threads:[~2014-03-13 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 20:47 [Qemu-devel] [PULL for-2.0 0/4] QOM devices patch queue 2014-03-13 Andreas Färber
2014-03-13 20:47 ` [Qemu-devel] [PULL for-2.0 1/4] virtio-console: Fix VIRTIO_CONSOLE() cast macro Andreas Färber
2014-03-13 20:47 ` Andreas Färber [this message]
2014-03-13 20:47 ` [Qemu-devel] [PULL for-2.0 3/4] qtest: Fix crash if SIGABRT during qtest_init() Andreas Färber
2014-03-13 20:47 ` [Qemu-devel] [PULL for-2.0 4/4] main-loop: Suppress "I/O thread spun" warnings for qtest Andreas Färber
2014-03-13 22:14 ` [Qemu-devel] [PULL for-2.0 0/4] QOM devices patch queue 2014-03-13 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=1394743636-23848-3-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=qemu-devel@nongnu.org \
    /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).