From nobody Wed Nov 5 10:47:34 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 1534156290326300.18694464053635; Mon, 13 Aug 2018 03:31:30 -0700 (PDT) Received: from localhost ([::1]:38615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpA8H-0005gb-52 for importer@patchew.org; Mon, 13 Aug 2018 06:31:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp9tJ-0007hx-GY for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fp9tI-0002m2-EI for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:16:01 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:46964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fp9tI-0002lb-6u; Mon, 13 Aug 2018 06:16:00 -0400 Received: by mail-ed1-x529.google.com with SMTP id o8-v6so7929387edt.13; Mon, 13 Aug 2018 03:16:00 -0700 (PDT) Received: from localhost.localdomain ([194.230.159.125]) by smtp.gmail.com with ESMTPSA id s27-v6sm11670006edb.73.2018.08.13.03.15.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 03:15:58 -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=xMT02T2QxTuKkHtdvzGZmVfbGGsxAqna/lZMqmrQ9CI=; b=D4nZvJAWvshDeCXKBQOTvSdcjeA/+7sH5TLadeMMcxLnrML6FmyRD1XJBckODakjSd CBXywpGZO7G1lFH8QZ6isoSi5JN4ap+KGkIrNpVT1Hh+SpG2iJyu7Ab/B/6k6FPOT5P1 5LTCtEufkm3r1NRl6hHTh+JA3kx5cme4Wl9BKHYgDGeKlMuZTeOmllBc0oT5ukfLuy0d dr5mSzdazhyjay6kFhDBwZU1IkdPIbjvdiqOpDIoIePyQqe/8RGQKSg6/pzrCiBCGJU1 kLzb7htGaCJjyEolQi7Eb92N0/urvGfeV8BgOompDyh4v00cEzPpgMH7qVhfTfiejNzJ ASxA== 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=xMT02T2QxTuKkHtdvzGZmVfbGGsxAqna/lZMqmrQ9CI=; b=d0yy80IU391k7INzDYW/MZPLnYUunArtwn8BtkpMlRKeyju10J2iAJZCENqHL+k8uX TyyQKvxEnsY9rUsL+Ojgcn3mY2K+u8gYk2YTjkgvxY2O+0lbbv6fLLummI7/nUFcakMg NXUb1+LIIwID8PYG3O+lThT8XFPxl7ieZ86+cGjcgMg+P3iQhpbM4bar+ka1PEpp/cj+ XErHmVNwSNgBjdlV5//nHjzw147JvG5ajauYlFEDew9Crn5EbCfKkPrf5Ia27FgKlrBl oM8J9j3RmkupwH16gvtx9vkPTs5jkXQXQAhHDc0y8qMmf8hQqWjbRP9hH0SsSISWWZcg KUNA== X-Gm-Message-State: AOUpUlETO11AXcbu+N/FhmOuwDiZM1BLGI4D5JRj6lftw7anPB99DJwz 37JkKoTYDezw7GpjbcmioBMFQ7F5m54= X-Google-Smtp-Source: AA+uWPzdQWajsGrNfWV8vlbdel6cjSXkuM9FXBAqR4uZ9SgjVQG6BnhOrCfRknk7GJzAw/5VwAThRg== X-Received: by 2002:a50:a93c:: with SMTP id l57-v6mr20773021edc.229.1534155358881; Mon, 13 Aug 2018 03:15:58 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 12:14:40 +0200 Message-Id: <20180813101453.10200-21-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813101453.10200-1-e.emanuelegiuseppe@gmail.com> References: <20180813101453.10200-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::529 Subject: [Qemu-devel] [PATCH 20/33] tests/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 , Fam Zheng , qemu-block@nongnu.org, "Michael S. Tsirkin" , Jason Wang , Amit Shah , Emanuele Giuseppe Esposito , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson 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 a160059758..eafceefc12 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..3dcac93011 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 register_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(register_virtio_serial_test); --=20 2.17.1