From nobody Wed Nov 5 12:20:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534857038265119.42632165471866; Tue, 21 Aug 2018 06:10:38 -0700 (PDT) Received: from localhost ([::1]:53411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs6Qa-00032S-Hs for importer@patchew.org; Tue, 21 Aug 2018 09:10:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs6J3-0004c4-SF for qemu-devel@nongnu.org; Tue, 21 Aug 2018 09:02:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs6J0-0005ZB-Ir for qemu-devel@nongnu.org; Tue, 21 Aug 2018 09:02:45 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:38852) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fs6J0-0005Yi-9S; Tue, 21 Aug 2018 09:02:42 -0400 Received: by mail-wm0-x242.google.com with SMTP id t25-v6so2768507wmi.3; Tue, 21 Aug 2018 06:02:42 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id q135-v6sm4177728wmd.4.2018.08.21.06.02.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 06:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=QMuj15RGo7qZDC4sOb2uNTQR7rSxS9e4hJOrz+wJPiQ=; b=HPiJs+do6KfgJj8iAkOaZ+6xFzbRgUsPv160akLAZVE38a2bfnhFkcKHbQQ58LsUHQ 9026dM3WGeQZIIPYyL2U8eAFZ+vZi8+jaM6AHi3/f/Z9kwpaOuiqQpgJQL2sks0JFtDX lr3S19Sa63YNfCSp2R1vNjeEy883ZDPDOQJLsBtqGx/NZNJR9xywY6Kref1ETGiZkCnP l1c4jq6/tw8CdoeyOGi6TmQCYaj3Zt1jEa3OEsDcMz0Z9A289oO00ld6LMgfY7dCXqtX wQzuHxb2DKqiLoCB/RkaQbxZxE8o/WjrHE9X4U4YuJRq815d6RTIxyIMxuISXyYb9qaA cA3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=QMuj15RGo7qZDC4sOb2uNTQR7rSxS9e4hJOrz+wJPiQ=; b=lrcrDh0TBU/QCcPjwiVfg74him1oKAcPPA9LI2gJbU9yNR1aOoF1a8WACuR+DyTkvx YmTeHacWCBJFgxBWZpMA1aJ+rS8O2Mhn5NtsUHhRuuuhRM2q6HSYfeht8UWIR22sOmNt hJ0Iof8pDQNRHIa2jnLr/+0rCHUfv3nMjU5I1dtLvWIiiOpElEBczP2WUEsLIGkVCwRS Dw2HtmSUwR/0GRIcQ2ncFVrb4IojQRg5N1lwFafwcbuWGUaLC7GAcmfsiYVRdqcvG393 BAfzAAOJwiGxY9TligxKMCvcWJQ2L6YmCfJp6tucPAmx4nBVnQukQfPavMBh9LJt23rI pODg== X-Gm-Message-State: AOUpUlHf5ZtI0h8A7QB2/N/ql92QWaenuOOCNo1uIrTnlu/eGzYvLY+n wyAT2LZOvBNEIj0hrZFgsFbFr3dd X-Google-Smtp-Source: AA+uWPyg6v71CgBM9bCJv0Hk8Esry70YG7zqsC5DlEZp6IhWh2GA6nsnAknocgAdv/Cfau8EdulUxQ== X-Received: by 2002:a1c:9f12:: with SMTP id i18-v6mr29365810wme.124.1534856560739; Tue, 21 Aug 2018 06:02:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 21 Aug 2018 15:02:36 +0200 Message-Id: <1534856557-36022-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH rebased] tests: virtio: separate ccw tests from libqos 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Because qtest does not support s390 channel I/O, s390 only performs smoke t= ests on those few devices that do not have any functional tests. Therefore, every = time we add functional tests for a virtio device, the choice is between removing those tests from the s390 suite (so that s390 actually _loses_ coverage) or sprinkling the test with architecture checks. This patch simply creates a ccw-specific test that only performs smoke test= s on all virtio-ccw devices. If channel I/O support is ever added to qtest and = libqos, then this file can go away. In the meanwhile, it simplifies maintenance and makes sure that all virtio devices are tested. Acked-by: Cornelia Huck Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- Just small adjustments for the qtest API. I'll include this version in my pull request. tests/Makefile.include | 5 +- tests/virtio-ccw-test.c | 118 ++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 tests/virtio-ccw-test.c diff --git a/tests/Makefile.include b/tests/Makefile.include index 760a0f1..29e70f4 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -402,9 +402,7 @@ check-qtest-s390x-$(CONFIG_SLIRP) +=3D tests/test-netfi= lter$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) +=3D tests/test-filter-mirror$(EXESUF) check-qtest-s390x-$(CONFIG_POSIX) +=3D tests/test-filter-redirector$(EXESU= F) check-qtest-s390x-y +=3D tests/drive_del-test$(EXESUF) -check-qtest-s390x-y +=3D tests/virtio-balloon-test$(EXESUF) -check-qtest-s390x-y +=3D tests/virtio-console-test$(EXESUF) -check-qtest-s390x-y +=3D tests/virtio-serial-test$(EXESUF) +check-qtest-s390x-y +=3D tests/virtio-ccw-test$(EXESUF) check-qtest-s390x-y +=3D tests/cpu-plug-test$(EXESUF) =20 check-qtest-generic-y +=3D tests/machine-none-test$(EXESUF) @@ -809,6 +807,7 @@ 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 $(libqos-v= irtio-obj-y) tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o $(libqos-virtio-ob= j-y) +tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o 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) diff --git a/tests/virtio-ccw-test.c b/tests/virtio-ccw-test.c new file mode 100644 index 0000000..7eddbdd --- /dev/null +++ b/tests/virtio-ccw-test.c @@ -0,0 +1,118 @@ +/* + * QTest testcase for VirtIO CCW + * + * Copyright (c) 2014 SUSE LINUX Products GmbH + * Copyright (c) 2018 Red Hat, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +/* Until we have a full libqos implementation of virtio-ccw (which requires + * also to add support for I/O channels to qtest), we can only do simple + * tests that initialize the devices. + */ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "libqos/virtio.h" + +static void virtio_balloon_nop(void) +{ + global_qtest =3D qtest_initf("-device virtio-balloon-ccw"); + qtest_end(); +} + +static void virtconsole_nop(void) +{ + global_qtest =3D qtest_initf("-device virtio-serial-ccw,id=3Dvser0 " + "-device virtconsole,bus=3Dvser0.0"); + qtest_end(); +} + +static void virtserialport_nop(void) +{ + global_qtest =3D qtest_initf("-device virtio-serial-ccw,id=3Dvser0 " + "-device virtserialport,bus=3Dvser0.0"); + qtest_end(); +} + +static void virtio_serial_nop(void) +{ + global_qtest =3D qtest_initf("-device virtio-serial-ccw"); + qtest_end(); +} + +static void virtio_serial_hotplug(void) +{ + global_qtest =3D qtest_initf("-device virtio-serial-ccw"); + qtest_qmp_device_add("virtserialport", "hp-port", "{}"); + qtest_qmp_device_del("hp-port"); + qtest_end(); +} + +static void virtio_blk_nop(void) +{ + global_qtest =3D qtest_initf("-drive if=3Dnone,id=3Ddrv0,file=3Dnull-c= o://,format=3Draw " + "-device virtio-blk-ccw,drive=3Ddrv0"); + qtest_end(); +} + +static void virtio_net_nop(void) +{ + global_qtest =3D qtest_initf("-device virtio-net-ccw"); + qtest_end(); +} + +static void virtio_9p_nop(void) +{ + global_qtest =3D qtest_initf("-fsdev synth,id=3Dfsdev0 " + "-device virtio-9p-ccw,fsdev=3Dfsdev0,moun= t_tag=3Dqtest"); + qtest_end(); +} + +static void virtio_rng_nop(void) +{ + global_qtest =3D qtest_initf("-device virtio-rng-ccw"); + qtest_end(); +} + +static void virtio_scsi_nop(void) +{ + global_qtest =3D qtest_initf("-device virtio-scsi-ccw"); + qtest_end(); +} + +static void virtio_scsi_hotplug(void) +{ + global_qtest =3D qtest_initf("-drive if=3Dnone,id=3Ddrv0,file=3Dnull-c= o://,format=3Draw " + "-drive if=3Dnone,id=3Ddrv1,file=3Dnull-co= ://,format=3Draw " + "-device virtio-scsi-ccw " + "-device scsi-hd,drive=3Ddrv0"); + qtest_qmp_device_add("scsi-hd", "scsihd", "{'drive': 'drv1'}"); + qtest_qmp_device_del("scsihd"); + + qtest_end(); +} + +int main(int argc, char **argv) +{ + int ret; + + g_test_init(&argc, &argv, NULL); + qtest_add_func("/virtio/balloon/nop", virtio_balloon_nop); + qtest_add_func("/virtio/console/nop", virtconsole_nop); + qtest_add_func("/virtio/serialport/nop", virtserialport_nop); + qtest_add_func("/virtio/serial/nop", virtio_serial_nop); + qtest_add_func("/virtio/serial/hotplug", virtio_serial_hotplug); + qtest_add_func("/virtio/block/nop", virtio_blk_nop); + qtest_add_func("/virtio/net/nop", virtio_net_nop); + qtest_add_func("/virtio/9p/nop", virtio_9p_nop); + qtest_add_func("/virtio/rng/nop", virtio_rng_nop); + qtest_add_func("/virtio/scsi/nop", virtio_scsi_nop); + qtest_add_func("/virtio/scsi/hotplug", virtio_scsi_hotplug); + + ret =3D g_test_run(); + + return ret; +} --=20 1.8.3.1