From nobody Tue Nov 4 22:03:35 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 1533567076264888.7730047473729; Mon, 6 Aug 2018 07:51:16 -0700 (PDT) Received: from localhost ([::1]:34437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmgql-0002Tj-EX for importer@patchew.org; Mon, 06 Aug 2018 10:51:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmgbI-0005GQ-Hf for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:35:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmgbE-00010B-Fp for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:35:12 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:34189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fmgbE-0000zp-8k for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:35:08 -0400 Received: by mail-ed1-x534.google.com with SMTP id h1-v6so5259563eds.1 for ; Mon, 06 Aug 2018 07:35:08 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 07:35:06 -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=DtrYSEHoasU05JnDYPpMQCJVqhfFpHPq9BX+rR5VMj8=; b=PWGABO/j3C8kgrgT4TaANcUnXxb9C84C5zEwVRYgdf8oqYMW5e76fPfc9rWTlLCyvh P6vVOWQnB3/M/nwRVmkDjfPRGjPF3dYgXEYWGdBbx1kPa5/SBp9Ww7lD8scGR3mahteP 5pLoFGnuLzVrKvrx2WyyXnUvkoscjLkWoQQZJq+U5/rlEOvQdssROUt2OD8js/ETu6+8 60HuL0AEY/erZnLC3nONxoJNQ+hKWIqL9e2t20NVMQ0QRe5zxoXNXhogJn0A9PTjWXpR f7sVYE+mLq3y8cRiCyX1JnHCnIWdz8t7E4hltcwCmwx+xzHPV23b7kMHuDYJIVr5qYp4 0zww== 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=DtrYSEHoasU05JnDYPpMQCJVqhfFpHPq9BX+rR5VMj8=; b=iZHhqNJBIMRy01t9X8CVzgSD45rq1dMB+ICc4pwbPho/MX3CLLTi8EWVHyFrocUl8U jKlUgw+0WdJRaEPgSxVjCWviGmNX7y5dCqMt5mNbg+tXangOKZL15+YTPvqdGRTMGPfB Buw8Faz7/kH2yEwDJFUYUiTE7QmyIIgiyTVaTHoq3wit7UiU+GJWEyYOqz3tR3a/h14Y 6UUc1NTwd4boyj5O4eBH6AtD9oYZsLRjr5qqhWj5tUQja02UaTL4t/jWwKBSPQ+HEbkj xhYeuyCeiogYi3ZSmdwBFGPcckaC0iPx4c6ZNamgBsynhHY5ayqK9/SEYzdoibOzCsFK Vrgg== X-Gm-Message-State: AOUpUlF37cv08Q4eCtErUXYNjLXJbTOocmSEa7S32UFCezELGGyHYU4A EyUosQFPaNo16AQ2Abnd+83v/btJ X-Google-Smtp-Source: AAOMgpfMt3wIN9eSYfbkK8paDuBikpLdbVdLlCW67+ow158GFVh3OgbsRlnn5aZhY5Ynf3braTo7Qw== X-Received: by 2002:a50:f297:: with SMTP id f23-v6mr18913203edm.40.1533566107183; Mon, 06 Aug 2018 07:35:07 -0700 (PDT) From: Emanuele Giuseppe Esposito To: Paolo Bonzini Date: Mon, 6 Aug 2018 16:34:03 +0200 Message-Id: <20180806143412.27722-26-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::534 Subject: [Qemu-devel] [PATCH v2 25/34] test/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 , 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-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 a3d425918f..5b33ffbc57 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..1604b7f430 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 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(virtio_balloon_test); --=20 2.17.1