qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Cornelia Huck <cohuck@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Hildenbrand <david@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>,
	Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>,
	Eric Farman <farman@linux.vnet.ibm.com>,
	Fan Zhang <zhangfan@linux.vnet.ibm.com>,
	Farhan Ali <alifm@linux.vnet.ibm.com>,
	Fei Li <sherrylf@linux.vnet.ibm.com>,
	Halil Pasic <pasic@linux.vnet.ibm.com>,
	Janosch Frank <frankja@linux.vnet.ibm.com>,
	Jason J Herne <jjherne@linux.vnet.ibm.com>,
	Jing Liu <liujbjl@linux.vnet.ibm.com>,
	Pierre Morel <pmorel@linux.vnet.ibm.com>,
	QingFeng Hao <haoqf@linux.vnet.ibm.com>,
	Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>,
	Yang Chen <bjcyang@linux.vnet.ibm.com>,
	Yi Min Zhao <zyimin@linux.vnet.ibm.com>,
	Marc Mari <markmb@redhat.com>, Cleber Rosa <crosa@redhat.com>,
	Michael S Tsirkin <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 2/6] tests: Add network filter tests to the check-qtest-s390x list
Date: Thu, 17 Aug 2017 08:25:09 +0200	[thread overview]
Message-ID: <1502951113-4246-3-git-send-email-thuth@redhat.com> (raw)
In-Reply-To: <1502951113-4246-1-git-send-email-thuth@redhat.com>

With some small modifications, we can also use the the netfilter,
the fiter-mirror and the filter-redirector tests on s390x.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/Makefile.include         |  3 +++
 tests/test-filter-mirror.c     |  9 +++++++--
 tests/test-filter-redirector.c | 22 ++++++++++++++++------
 tests/test-netfilter.c         | 11 ++++++++++-
 4 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 8d5991d..0bb18b3 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -360,6 +360,9 @@ check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
 check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
 
 check-qtest-s390x-y = tests/boot-serial-test$(EXESUF)
+check-qtest-s390x-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
+check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
+check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF)
 
 check-qtest-generic-y += tests/qom-test$(EXESUF)
 check-qtest-generic-y += tests/test-hmp$(EXESUF)
diff --git a/tests/test-filter-mirror.c b/tests/test-filter-mirror.c
index a1d5865..d569d27 100644
--- a/tests/test-filter-mirror.c
+++ b/tests/test-filter-mirror.c
@@ -25,6 +25,11 @@ static void test_mirror(void)
     char *recv_buf;
     uint32_t size = sizeof(send_buf);
     size = htonl(size);
+    const char *devstr = "e1000";
+
+    if (g_str_equal(qtest_get_arch(), "s390x")) {
+        devstr = "virtio-net-ccw";
+    }
 
     ret = socketpair(PF_UNIX, SOCK_STREAM, 0, send_sock);
     g_assert_cmpint(ret, !=, -1);
@@ -33,10 +38,10 @@ static void test_mirror(void)
     g_assert_cmpint(ret, !=, -1);
 
     cmdline = g_strdup_printf("-netdev socket,id=qtest-bn0,fd=%d "
-                 "-device e1000,netdev=qtest-bn0,id=qtest-e0 "
+                 "-device %s,netdev=qtest-bn0,id=qtest-e0 "
                  "-chardev socket,id=mirror0,path=%s,server,nowait "
                  "-object filter-mirror,id=qtest-f0,netdev=qtest-bn0,queue=tx,outdev=mirror0 "
-                 , send_sock[1], sock_path);
+                 , send_sock[1], devstr, sock_path);
     qtest_start(cmdline);
     g_free(cmdline);
 
diff --git a/tests/test-filter-redirector.c b/tests/test-filter-redirector.c
index 69c663b..3afd411 100644
--- a/tests/test-filter-redirector.c
+++ b/tests/test-filter-redirector.c
@@ -57,6 +57,16 @@
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
 
+static const char *get_devstr(void)
+{
+    if (g_str_equal(qtest_get_arch(), "s390x")) {
+        return "virtio-net-ccw";
+    }
+
+    return "rtl8139";
+}
+
+
 static void test_redirector_tx(void)
 {
     int backend_sock[2], recv_sock;
@@ -78,7 +88,7 @@ static void test_redirector_tx(void)
     g_assert_cmpint(ret, !=, -1);
 
     cmdline = g_strdup_printf("-netdev socket,id=qtest-bn0,fd=%d "
-                "-device rtl8139,netdev=qtest-bn0,id=qtest-e0 "
+                "-device %s,netdev=qtest-bn0,id=qtest-e0 "
                 "-chardev socket,id=redirector0,path=%s,server,nowait "
                 "-chardev socket,id=redirector1,path=%s,server,nowait "
                 "-chardev socket,id=redirector2,path=%s,nowait "
@@ -87,8 +97,8 @@ static void test_redirector_tx(void)
                 "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0,"
                 "queue=tx,indev=redirector2 "
                 "-object filter-redirector,id=qtest-f2,netdev=qtest-bn0,"
-                "queue=tx,outdev=redirector1 "
-                , backend_sock[1], sock_path0, sock_path1, sock_path0);
+                "queue=tx,outdev=redirector1 ", backend_sock[1], get_devstr(),
+                sock_path0, sock_path1, sock_path0);
     qtest_start(cmdline);
     g_free(cmdline);
 
@@ -149,7 +159,7 @@ static void test_redirector_rx(void)
     g_assert_cmpint(ret, !=, -1);
 
     cmdline = g_strdup_printf("-netdev socket,id=qtest-bn0,fd=%d "
-                "-device rtl8139,netdev=qtest-bn0,id=qtest-e0 "
+                "-device %s,netdev=qtest-bn0,id=qtest-e0 "
                 "-chardev socket,id=redirector0,path=%s,server,nowait "
                 "-chardev socket,id=redirector1,path=%s,server,nowait "
                 "-chardev socket,id=redirector2,path=%s,nowait "
@@ -158,8 +168,8 @@ static void test_redirector_rx(void)
                 "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0,"
                 "queue=rx,outdev=redirector2 "
                 "-object filter-redirector,id=qtest-f2,netdev=qtest-bn0,"
-                "queue=rx,indev=redirector1 "
-                , backend_sock[1], sock_path0, sock_path1, sock_path0);
+                "queue=rx,indev=redirector1 ", backend_sock[1], get_devstr(),
+                sock_path0, sock_path1, sock_path0);
     qtest_start(cmdline);
     g_free(cmdline);
 
diff --git a/tests/test-netfilter.c b/tests/test-netfilter.c
index 8b5a9b2..2506473 100644
--- a/tests/test-netfilter.c
+++ b/tests/test-netfilter.c
@@ -182,6 +182,12 @@ static void remove_netdev_with_multi_netfilter(void)
 int main(int argc, char **argv)
 {
     int ret;
+    char *args;
+    const char *devstr = "e1000";
+
+    if (g_str_equal(qtest_get_arch(), "s390x")) {
+        devstr = "virtio-net-ccw";
+    }
 
     g_test_init(&argc, &argv, NULL);
     qtest_add_func("/netfilter/addremove_one", add_one_netfilter);
@@ -191,10 +197,13 @@ int main(int argc, char **argv)
     qtest_add_func("/netfilter/remove_netdev_multi",
                    remove_netdev_with_multi_netfilter);
 
-    qtest_start("-netdev user,id=qtest-bn0 -device e1000,netdev=qtest-bn0");
+    args = g_strdup_printf("-netdev user,id=qtest-bn0 "
+                           "-device %s,netdev=qtest-bn0", devstr);
+    qtest_start(args);
     ret = g_test_run();
 
     qtest_end();
+    g_free(args);
 
     return ret;
 }
-- 
1.8.3.1

  parent reply	other threads:[~2017-08-17  6:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17  6:25 [Qemu-devel] [PATCH for-2.11 0/6] Enable more qtests for s390x Thomas Huth
2017-08-17  6:25 ` [Qemu-devel] [PATCH 1/6] tests: Run filter-redirector and -mirror test only on POSIX systems Thomas Huth
2017-08-17  8:25   ` Cornelia Huck
2017-08-17  9:41   ` David Hildenbrand
2017-08-17 10:09   ` Zhang Chen
2017-08-30 19:35   ` Cleber Rosa
2017-08-17  6:25 ` Thomas Huth [this message]
2017-08-17  8:41   ` [Qemu-devel] [PATCH 2/6] tests: Add network filter tests to the check-qtest-s390x list Cornelia Huck
2017-08-17 14:02     ` Thomas Huth
2017-08-18  1:49       ` Zhang Chen
2017-08-18  7:54       ` Cornelia Huck
2017-08-18  8:47         ` Thomas Huth
2017-08-30 20:05         ` Cleber Rosa
2017-08-30 20:03     ` Cleber Rosa
2017-08-17  6:25 ` [Qemu-devel] [PATCH 3/6] tests: Enable the drive_del test also on s390x Thomas Huth
2017-08-17  8:53   ` Cornelia Huck
2017-08-17  9:46     ` David Hildenbrand
2017-08-17 13:54       ` Thomas Huth
2017-08-17 14:01         ` Cornelia Huck
2017-08-30 21:41   ` Cleber Rosa
2017-09-04 13:49     ` Cornelia Huck
2017-08-17  6:25 ` [Qemu-devel] [PATCH 4/6] tests: Introduce generic device hot-plug/hot-unplug functions Thomas Huth
2017-08-17  9:00   ` Cornelia Huck
2017-08-17  9:53   ` David Hildenbrand
2017-08-17 10:57     ` Thomas Huth
2017-08-17 11:16       ` David Hildenbrand
2017-08-17  6:25 ` [Qemu-devel] [PATCH 5/6] tests: Add qvirtio_(un)plug_device_test wrapper functions Thomas Huth
2017-08-17  9:04   ` Cornelia Huck
2017-08-17  6:25 ` [Qemu-devel] [PATCH 6/6] tests: Enable the simple virtio tests on s390x, too Thomas Huth
2017-08-17  9:07   ` Cornelia Huck
2017-08-17  9:11 ` [Qemu-devel] [PATCH for-2.11 0/6] Enable more qtests for s390x Cornelia Huck
2017-08-18 13:40   ` Cornelia Huck

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=1502951113-4246-3-git-send-email-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=alifm@linux.vnet.ibm.com \
    --cc=bjcyang@linux.vnet.ibm.com \
    --cc=bjsdjshi@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=crosa@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.vnet.ibm.com \
    --cc=frankja@linux.vnet.ibm.com \
    --cc=haoqf@linux.vnet.ibm.com \
    --cc=imbrenda@linux.vnet.ibm.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=liujbjl@linux.vnet.ibm.com \
    --cc=markmb@redhat.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=pmorel@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=renxiaof@linux.vnet.ibm.com \
    --cc=sherrylf@linux.vnet.ibm.com \
    --cc=zhangfan@linux.vnet.ibm.com \
    --cc=zyimin@linux.vnet.ibm.com \
    /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).