summary refs log tree commit diff stats
path: root/tests/test-netfilter.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-netfilter.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-netfilter.c')
-rw-r--r--tests/test-netfilter.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test-netfilter.c b/tests/test-netfilter.c
index 8b5a9b21b5..2506473365 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;
 }