summary refs log tree commit diff stats
path: root/tests/test-filter-mirror.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-08-17 08:25:09 +0200
committerCornelia Huck <cohuck@redhat.com>2017-08-30 18:23:25 +0200
commitea5bef49eadd240c7924f287f2da1bb457a3f92c (patch)
tree4efc5f907fba0451e91f00c1f50a7915c64d078d /tests/test-filter-mirror.c
parent7f57d58d6a160fdb3b3020d985ddbb3c95fe964c (diff)
downloadfocaccia-qemu-ea5bef49eadd240c7924f287f2da1bb457a3f92c.tar.gz
focaccia-qemu-ea5bef49eadd240c7924f287f2da1bb457a3f92c.zip
tests: Add network filter tests to the check-qtest-s390x list
With some small modifications, we can also use the the netfilter,
the filter-mirror and the filter-redirector tests on s390x.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <1502951113-4246-3-git-send-email-thuth@redhat.com>
Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'tests/test-filter-mirror.c')
-rw-r--r--tests/test-filter-mirror.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test-filter-mirror.c b/tests/test-filter-mirror.c
index a1d5865ef7..d569d27657 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);