From nobody Tue Nov 4 22:03:33 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533566639894483.0641842292174; Mon, 6 Aug 2018 07:43:59 -0700 (PDT) Received: from localhost ([::1]:34398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmgjm-0003jq-Nl for importer@patchew.org; Mon, 06 Aug 2018 10:43:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmgbD-00059z-Ey for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:35:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmgb9-0000yp-Gy for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:35:07 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:36093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fmgb9-0000y9-9Z for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:35:03 -0400 Received: by mail-ed1-x52f.google.com with SMTP id k15-v6so5262899edr.3 for ; Mon, 06 Aug 2018 07:35:03 -0700 (PDT) Received: from localhost.localdomain ([194.230.159.126]) by smtp.gmail.com with ESMTPSA id x13-v6sm14615157edx.17.2018.08.06.07.35.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 07:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jThxVMsZXxHF8Or+1F6qpb5hobYMWMv3VFnI0vqqV9o=; b=c/vygvMKXOg5L/MMY9LmS2OpfSSK9wCtPDEb1rGu2m0XujEkvaggaZgwiZhJzBcFRw d0jnyYbUVwUTDQGDiutZl6P2vq32luXJYyhKcaScCxQK6/BLa2ED3O1o9/hsJdK2oqlA dOcaclPNlR2tK43KoXbjMAaswFT1slhRX9n6XXnOYe/yVK6EhtgXCKZB2GU3xdLyyRYc wBUlHM1LI+c8zKQVrqmlgr/Opk11RD77uheFla5nXSi+NWBDDcnM9kOVQMjFkeBCER8G v5b655FHzKVMABAsrku8/DXPuseiN73l0053LY47B7VVN8iTFFaW2xRfY5QDqdPVzWkP 2klw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jThxVMsZXxHF8Or+1F6qpb5hobYMWMv3VFnI0vqqV9o=; b=qtT7JO92ndgdJMPIfWxsD/V0NSEJ2Ake2iFUpeVEqZT+f82dgkxMBv0Vi9tRro2Rye nF5+WCKo0QblQ5HoMky5UiA5zuh0a4mzIxhAg4i0lRuMZbW/+neeFBK4D2TuBqfrVdhx yJRwWjXqdvVnSI6qj7+O7nPa7fDlMFUn3H7+6ynv6vkceuHztiVN66LLRV/xAjZoQxzc y4eC3B5M7AMNBB7U90nIHzr/M/VjwJtKAkJi5TutyoQDON4RB4ZefqfxsJjOIgbbX7S4 0fIoyEv8wzTtjrTXkCqE4pidlyMI6ZeH4p7V9Nw/Dnawgc4XJYfQSjBG3fw147RyWspY BzLA== X-Gm-Message-State: AOUpUlHemZTt39YWrJ80UlR6WNV3qSg5GpyMavXXjXnUj7CUAcMn2Ur8 ePyqrVWoNIfqfS+uQcw1fxU= X-Google-Smtp-Source: AAOMgpekut2qmcx48Xi5eiT8/dk5MOHRaxSv4eCIH1DTdW5e6hJ/Mp4CfybQ2zWXOnMoqLHhN5reiA== X-Received: by 2002:aa7:c6c2:: with SMTP id b2-v6mr18054814eds.302.1533566102171; Mon, 06 Aug 2018 07:35:02 -0700 (PDT) From: Emanuele Giuseppe Esposito To: Paolo Bonzini Date: Mon, 6 Aug 2018 16:33:59 +0200 Message-Id: <20180806143412.27722-22-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180806143412.27722-1-e.emanuelegiuseppe@gmail.com> References: <20180806143412.27722-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52f Subject: [Qemu-devel] [PATCH v2 21/34] test/qgraph: virtio-serial test node 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: Laurent Vivier , Stefan Hajnoczi , Emanuele Giuseppe Esposito , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@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" Convert tests/virtio-serial-test in qgraph test node, virtio-serial-test. This test consumes a virtio-serial interface and checks that its function return the expected values. Note that this test does not allocate any virtio-serial structure, it's all done by the qtest walking graph mechanism Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 4 +--- tests/virtio-serial-test.c | 27 +++++++++------------------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 6742f97058..f258a7778e 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -205,7 +205,6 @@ check-qtest-virtio-y +=3D tests/virtio-9p-test$(EXESUF) gcov-files-virtio-y +=3D hw/9pfs/virtio-9p.c gcov-files-virtio-y +=3D i386-softmmu/hw/9pfs/virtio-9p-device.c endif -check-qtest-virtio-y +=3D tests/virtio-serial-test$(EXESUF) gcov-files-virtio-y +=3D i386-softmmu/hw/char/virtio-serial-bus.c check-qtest-virtio-y +=3D $(check-qtest-virtioserial-y) gcov-files-virtio-y +=3D $(gcov-files-virtioserial-y) @@ -398,7 +397,6 @@ check-qtest-s390x-$(CONFIG_POSIX) +=3D tests/test-filte= r-redirector$(EXESUF) check-qtest-s390x-y +=3D tests/drive_del-test$(EXESUF) check-qtest-s390x-y +=3D tests/virtio-ccw-test$(EXESUF) check-qtest-s390x-y +=3D tests/virtio-balloon-test$(EXESUF) -check-qtest-s390x-y +=3D tests/virtio-serial-test$(EXESUF) check-qtest-s390x-y +=3D tests/cpu-plug-test$(EXESUF) =20 check-qtest-generic-y +=3D tests/machine-none-test$(EXESUF) @@ -782,6 +780,7 @@ libqgraph-pci-obj-y +=3D tests/libqos/e1000e.o libqgraph-tests-obj-y =3D $(libqgraph-pci-obj-y) libqgraph-tests-obj-y +=3D tests/sdhci-test.o libqgraph-tests-obj-y +=3D tests/e1000e-test.o +libqgraph-tests-obj-y +=3D tests/virtio-serial-test.o libqgraph-tests-obj-y +=3D tests/virtio-console-test.o =20 check-unit-y +=3D tests/test-qgraph$(EXESUF) @@ -832,7 +831,6 @@ tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o= $(libqos-pc-obj-y) $(lib 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 $(libqos-vir= tio-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-serial-test.c b/tests/virtio-serial-test.c index 7cc7060264..1691811f85 100644 --- a/tests/virtio-serial-test.c +++ b/tests/virtio-serial-test.c @@ -9,33 +9,24 @@ =20 #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/virtio.h" +#include "libqos/virtio-serial.h" =20 /* Tests only initialization so far. TODO: Replace with functional tests */ -static void virtio_serial_nop(void) +static void virtio_serial_nop(void *obj, void *data, QGuestAllocator *allo= c) { + /* no operation */ } =20 -static void hotplug(void) +static void serial_hotplug(void *obj, void *data, QGuestAllocator *alloc) { qtest_qmp_device_add("virtserialport", "hp-port", NULL); - qtest_qmp_device_del("hp-port"); } =20 -int main(int argc, char **argv) +static void virtio_serial_test(void) { - int ret; - - g_test_init(&argc, &argv, NULL); - qtest_add_func("/virtio/serial/nop", virtio_serial_nop); - qtest_add_func("/virtio/serial/hotplug", hotplug); - - global_qtest =3D qtest_startf("-device virtio-serial-%s", - qvirtio_get_dev_type()); - ret =3D g_test_run(); - - qtest_end(); - - return ret; + qos_add_test("serial-nop", "virtio-serial", virtio_serial_nop, NULL); + qos_add_test("serial-hotplug", "virtio-serial", serial_hotplug, NULL); } + +libqos_init(virtio_serial_test); --=20 2.17.1