From nobody Wed Nov 5 10:45:41 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 153415615178119.82878479497606; Mon, 13 Aug 2018 03:29:11 -0700 (PDT) Received: from localhost ([::1]:38590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpA62-0002lT-2N for importer@patchew.org; Mon, 13 Aug 2018 06:29:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp9tQ-0007os-TH for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:16:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fp9tP-0002r3-UO for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:16:08 -0400 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:39195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fp9tP-0002qS-Nj; Mon, 13 Aug 2018 06:16:07 -0400 Received: by mail-ed1-x542.google.com with SMTP id h4-v6so7950553edi.6; Mon, 13 Aug 2018 03:16:07 -0700 (PDT) Received: from localhost.localdomain ([194.230.159.125]) by smtp.gmail.com with ESMTPSA id s27-v6sm11670006edb.73.2018.08.13.03.16.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 03:16:05 -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=Y6+Sak6sOHlmFYMHdrxX46/ItBu8UNx7jTqx/4mODH8=; b=dFFttYcmmaMyLJZIXOe9IyrpB3aOIsGm1dAhu2G2JJ2/TW+di4HeW/ZvPazbeJRs9v Pb/+lx5g2GNGX5b5xtFcXdfVQu3p50EfTvIOJlHb7xhXwtwcYYo/w7BKS0bu2zypIZ3i kc4M5tgAxmPJdNAK8ZlVQlGgbmbOomacVSFtCOyzCWgoMY2KzUL9CT83mBVn/5DDdqAk fv5Ieqmgv3G4Tp6O9PVUdAYe0fNGcUcGUfpotcnZZbo8As4k/GUVBlEXQoTH29nwUjUX L1NNpnQ5GSGKkZvHx9ync/cS/X6AXQG89Lmbv6WDJU9PfTHiQrO+sn3w7O4+p/4dyXok Osvg== 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=Y6+Sak6sOHlmFYMHdrxX46/ItBu8UNx7jTqx/4mODH8=; b=ig4oVGtqxQtWa220n8bFdwrj2GK9PZY6kscVWyI+nqhQA8qG8b36Mia6ij3d0+fqCn FXlC2xRJ2px332RSFf8Fhv1kT/MytmsLrySotpC8A6Z3gk2NHfm8QG5H2iM56i9VJcjq nRY4H2/MHrjnyAIuiSPtDG++F55KQwvcPNYEIMTBmwM2JbOWaDetSHftI9gLI9fU+oO7 934l42LanrzXjU0GP/AnkzzAYAnttsVeNH6Ttpll+ANvHAtwMa1lVOuD1RA3BPt3oW4X 3ND9eYIAkp6tJ6YYPiWfxdpcEgF6Qx2CTbh/IGvNDTRVBd2DGLMzx01SQWhKkG/2FvOz y5Ng== X-Gm-Message-State: AOUpUlFSFE8qDQKtZzVVh86NjiRDF62pehxcurbucFNLNKTaBFPSHKCP M9JG31oU9AX0rFNpdyO3GDZ9BnqLgP8= X-Google-Smtp-Source: AA+uWPwfm10Enyojd0s8cCnzjStySUaSlGT3kEfe5UVboGP+tI0KGxkKF8Ft5AZDR/HaCwPc7erTLA== X-Received: by 2002:a50:a804:: with SMTP id j4-v6mr22180362edc.61.1534155366438; Mon, 13 Aug 2018 03:16:06 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 12:14:44 +0200 Message-Id: <20180813101453.10200-25-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::542 Subject: [Qemu-devel] [PATCH 24/33] tests/qgraph: virtio-balloon 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-balloon-test in qgraph test node, virtio-balloon-test. This test consumes a virtio-balloon interface and checks that its function return the expected values. Note that this test does not allocate any virtio-balloon structure, it's all done by the qtest walking graph mechanism Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 4 +--- tests/virtio-balloon-test.c | 22 +++++++--------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 362d9ec4b2..b23597972d 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -192,7 +192,6 @@ gcov-files-virtioserial-y +=3D hw/char/virtio-console.c gcov-files-virtio-y +=3D i386-softmmu/hw/virtio/virtio.c check-qtest-virtio-y +=3D tests/virtio-net-test$(EXESUF) gcov-files-virtio-y +=3D i386-softmmu/hw/net/virtio-net.c -check-qtest-virtio-y +=3D tests/virtio-balloon-test$(EXESUF) gcov-files-virtio-y +=3D i386-softmmu/hw/virtio/virtio-balloon.c check-qtest-virtio-y +=3D tests/virtio-blk-test$(EXESUF) gcov-files-virtio-y +=3D i386-softmmu/hw/block/virtio-blk.c @@ -395,7 +394,6 @@ check-qtest-s390x-$(CONFIG_POSIX) +=3D tests/test-filte= r-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-ccw-test$(EXESUF) -check-qtest-s390x-y +=3D tests/virtio-balloon-test$(EXESUF) check-qtest-s390x-y +=3D tests/cpu-plug-test$(EXESUF) =20 check-qtest-generic-y +=3D tests/machine-none-test$(EXESUF) @@ -784,6 +782,7 @@ 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 libqgraph-tests-obj-y +=3D tests/virtio-9p-test.o +libqgraph-tests-obj-y +=3D tests/virtio-balloon-test.o =20 check-unit-y +=3D tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -826,7 +825,6 @@ 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 $(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) diff --git a/tests/virtio-balloon-test.c b/tests/virtio-balloon-test.c index 0a07e036bb..8499a2349d 100644 --- a/tests/virtio-balloon-test.c +++ b/tests/virtio-balloon-test.c @@ -9,25 +9,17 @@ =20 #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/virtio.h" +#include "libqos/qgraph.h" +#include "libqos/virtio-balloon.h" =20 /* Tests only initialization so far. TODO: Replace with functional tests */ -static void balloon_nop(void) +static void balloon_nop(void *obj, void *data, QGuestAllocator *alloc) { } =20 -int main(int argc, char **argv) +static void register_virtio_balloon_test(void) { - int ret; - - g_test_init(&argc, &argv, NULL); - qtest_add_func("/virtio/balloon/nop", balloon_nop); - - global_qtest =3D qtest_startf("-device virtio-balloon-%s", - qvirtio_get_dev_type()); - ret =3D g_test_run(); - - qtest_end(); - - return ret; + qos_add_test("balloon-nop", "virtio-balloon", balloon_nop, NULL); } + +libqos_init(register_virtio_balloon_test); --=20 2.17.1