From patchwork Wed Oct 18 14:20:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10014799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 10B5E60215 for ; Wed, 18 Oct 2017 14:22:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0431B28DBB for ; Wed, 18 Oct 2017 14:22:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED46528DBF; Wed, 18 Oct 2017 14:22:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A84F028DBB for ; Wed, 18 Oct 2017 14:22:16 +0000 (UTC) Received: from localhost ([::1]:44933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4pEd-0003AL-IF for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Oct 2017 10:22:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4pDS-000370-CG for qemu-devel@nongnu.org; Wed, 18 Oct 2017 10:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4pDQ-00023C-UZ for qemu-devel@nongnu.org; Wed, 18 Oct 2017 10:21:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57944) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e4pDQ-00022Z-Lq; Wed, 18 Oct 2017 10:21:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B0963C47; Wed, 18 Oct 2017 14:20:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8B0963C47 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 174346A513; Wed, 18 Oct 2017 14:20:53 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 16:20:28 +0200 Message-Id: <1508336428-20511-3-git-send-email-thuth@redhat.com> In-Reply-To: <1508336428-20511-1-git-send-email-thuth@redhat.com> References: <1508336428-20511-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 18 Oct 2017 14:20:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] tests: Enable the very simple virtio tests on s390x, too X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, Amit Shah , Michael S Tsirkin Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP These tests can easily be used on s390x, too. We just have to make sure to use the virtio-xxx-ccw devices instead of virtio-xxx-pci. Signed-off-by: Thomas Huth Reviewed-by: Eric Blake Acked-by: Christian Borntraeger --- tests/Makefile.include | 9 ++++++--- tests/virtio-balloon-test.c | 8 +++++--- tests/virtio-console-test.c | 19 +++++++++++-------- tests/virtio-serial-test.c | 10 ++++++---- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 4ca15e6..70dc711 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -367,6 +367,9 @@ 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-s390x-y += tests/drive_del-test$(EXESUF) +check-qtest-s390x-y += tests/virtio-balloon-test$(EXESUF) +check-qtest-s390x-y += tests/virtio-console-test$(EXESUF) +check-qtest-s390x-y += tests/virtio-serial-test$(EXESUF) check-qtest-generic-y += tests/qom-test$(EXESUF) check-qtest-generic-y += tests/test-hmp$(EXESUF) @@ -754,14 +757,14 @@ tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) -tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o +tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o $(libqos-virtio-obj-y) tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-obj-y) tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o $(libqos-pc-obj-y) $(libqos-virtio-obj-y) tests/virtio-rng-test$(EXESUF): tests/virtio-rng-test.o $(libqos-pc-obj-y) tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o $(libqos-virtio-obj-y) -tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o -tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o +tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o $(libqos-virtio-obj-y) +tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o $(libqos-virtio-obj-y) tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o diff --git a/tests/virtio-balloon-test.c b/tests/virtio-balloon-test.c index 0d0046b..0a07e03 100644 --- a/tests/virtio-balloon-test.c +++ b/tests/virtio-balloon-test.c @@ -9,9 +9,10 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/virtio.h" /* Tests only initialization so far. TODO: Replace with functional tests */ -static void pci_nop(void) +static void balloon_nop(void) { } @@ -20,9 +21,10 @@ int main(int argc, char **argv) int ret; g_test_init(&argc, &argv, NULL); - qtest_add_func("/virtio/balloon/pci/nop", pci_nop); + qtest_add_func("/virtio/balloon/nop", balloon_nop); - qtest_start("-device virtio-balloon-pci"); + global_qtest = qtest_startf("-device virtio-balloon-%s", + qvirtio_get_dev_type()); ret = g_test_run(); qtest_end(); diff --git a/tests/virtio-console-test.c b/tests/virtio-console-test.c index 1c3de07..945bae5 100644 --- a/tests/virtio-console-test.c +++ b/tests/virtio-console-test.c @@ -9,27 +9,30 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/virtio.h" /* Tests only initialization so far. TODO: Replace with functional tests */ -static void console_pci_nop(void) +static void console_nop(void) { - qtest_start("-device virtio-serial-pci,id=vser0 " - "-device virtconsole,bus=vser0.0"); + global_qtest = qtest_startf("-device virtio-serial-%s,id=vser0 " + "-device virtconsole,bus=vser0.0", + qvirtio_get_dev_type()); qtest_end(); } -static void serialport_pci_nop(void) +static void serialport_nop(void) { - qtest_start("-device virtio-serial-pci,id=vser0 " - "-device virtserialport,bus=vser0.0"); + global_qtest = qtest_startf("-device virtio-serial-%s,id=vser0 " + "-device virtserialport,bus=vser0.0", + qvirtio_get_dev_type()); qtest_end(); } int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); - qtest_add_func("/virtio/console/pci/nop", console_pci_nop); - qtest_add_func("/virtio/serialport/pci/nop", serialport_pci_nop); + qtest_add_func("/virtio/console/nop", console_nop); + qtest_add_func("/virtio/serialport/nop", serialport_nop); return g_test_run(); } diff --git a/tests/virtio-serial-test.c b/tests/virtio-serial-test.c index 7d1517d..7cc7060 100644 --- a/tests/virtio-serial-test.c +++ b/tests/virtio-serial-test.c @@ -9,9 +9,10 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/virtio.h" /* Tests only initialization so far. TODO: Replace with functional tests */ -static void pci_nop(void) +static void virtio_serial_nop(void) { } @@ -27,10 +28,11 @@ int main(int argc, char **argv) int ret; g_test_init(&argc, &argv, NULL); - qtest_add_func("/virtio/serial/pci/nop", pci_nop); - qtest_add_func("/virtio/serial/pci/hotplug", hotplug); + qtest_add_func("/virtio/serial/nop", virtio_serial_nop); + qtest_add_func("/virtio/serial/hotplug", hotplug); - qtest_start("-device virtio-serial-pci"); + global_qtest = qtest_startf("-device virtio-serial-%s", + qvirtio_get_dev_type()); ret = g_test_run(); qtest_end();