From nobody Sun Nov 9 22:34:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551982596873363.230763750244; Thu, 7 Mar 2019 10:16:36 -0800 (PST) Received: from localhost ([127.0.0.1]:56766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1xZI-0007y2-HI for importer@patchew.org; Thu, 07 Mar 2019 13:16:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wr1-0003SS-4n for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1wqz-0008Hv-W0 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:47 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:52107) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1wqz-0008GN-NA for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:45 -0500 Received: by mail-wm1-x343.google.com with SMTP id n19so10054307wmi.1 for ; Thu, 07 Mar 2019 09:30:44 -0800 (PST) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d206sm9979753wmc.11.2019.03.07.09.30.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 09:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=DG71ZyHm3BluoQ6xpJ/g+TjbO4Y/s/NXK5J7hNRv/ZQ=; b=usTU36kqwLIV2LJA4ZVwGtxEHo+wxvm83/8MVIyR80GxeVr2R7yxwDruN75wkn2zzU v/tm5mOvdaf6KVq3MOTXghvltYMpXpUw8eWUgmNO70THFt2ZwJa5gDdTznVyM9hLyT2d vf7AvzYgGue17QLwRFjEYfnHgCoGiZsReYYT5Low5FwcdA5nULetT82jy6RSIiWnyq/u yinJ/Ki9GV/X7Ihsz7C2vTG0bhtGQqgH4Lvr6+vRCfaVKPKGITx6Kq6TZyp55fHyRXZW PVXsdGBJMHjSx5BhnhrqapmYQ8RzVrlDQ6Kf4sauGUGhdN2Q/T7pgwxEGPld/SLs0v4i vatw== 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 :in-reply-to:references; bh=DG71ZyHm3BluoQ6xpJ/g+TjbO4Y/s/NXK5J7hNRv/ZQ=; b=GKrCjrSYfJZFeymdPANYp0aeaFVJqime1gUxa7R+OfACaLTz3O0yoJ2nPg8iw0K9UH sl2Xghzsw3tzSh6eXNixc8IksgWO/ambJeY97t6fxVH+juzZgAHHJBljpMvexTsjI3yC eIDNKBqqfFBLiiYSMN8IAzwCzFU0NJuF+cuxqjyCBt++ebZvkQwoDMFMRMw2fpBceKqX n5FitcXqcv4zWtbyXETh8tPgxXblU0NXa+1EFy6aWGMeoBxpZXs13T78gvP1u1pLc+aj 5shrb4WaruGvYU2BlIrLFjoG9Jf8fRmDJ+1aaFArt1nv6vk9JgjhuChyqs6eZSlEAv79 0hVg== X-Gm-Message-State: APjAAAVvf7MnClgsJxc/K/+0q6aBF2W7osJvpMZVWmj5ZD5MwsynLFYN gWDdmem8j5xMdNkHx0HPg2OkJmGA X-Google-Smtp-Source: APXvYqzfzYUyk91SogNDtZWP6ujrFcPBgDAg49V59fH4vVhsRIK+StnSpFwZsJjTW97FLqjvUBqTig== X-Received: by 2002:a1c:2947:: with SMTP id p68mr6474279wmp.104.1551979842994; Thu, 07 Mar 2019 09:30:42 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 18:29:40 +0100 Message-Id: <1551979804-6060-34-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551979804-6060-1-git-send-email-pbonzini@redhat.com> References: <1551979804-6060-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PULL 33/57] qos-test: virtio-rng 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: thuth@redhat.com, Emanuele Giuseppe Esposito , lviver@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Emanuele Giuseppe Esposito Convert tests/virtio-rng-test in qgraph test node, virtio-rng-test. This test consumes a virtio-rng interface and checks that its function return the expected values. Some functions are implemented only for virtio-rng-pci, so they don't consume virtio-rng, but virtio-rng-pci Note that this test does not allocate any virtio-rng structure, it's all done by the qtest walking graph mechanism Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Paolo Bonzini --- tests/Makefile.include | 3 +-- tests/virtio-rng-test.c | 27 +++++++-------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 2d2817e..ebf2212 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -155,7 +155,6 @@ check-qtest-ipack-y +=3D tests/ipoctal232-test$(EXESUF) =20 check-qtest-virtio-y +=3D tests/virtio-net-test$(EXESUF) check-qtest-virtio-y +=3D tests/virtio-blk-test$(EXESUF) -check-qtest-virtio-y +=3D tests/virtio-rng-test$(EXESUF) check-qtest-virtio-y +=3D tests/virtio-scsi-test$(EXESUF) =20 check-qtest-pci-y +=3D tests/e1000-test$(EXESUF) @@ -764,6 +763,7 @@ qos-test-obj-y +=3D tests/pci-test.o qos-test-obj-y +=3D tests/sdhci-test.o qos-test-obj-y +=3D tests/virtio-test.o qos-test-obj-$(CONFIG_VIRTFS) +=3D tests/virtio-9p-test.o +qos-test-obj-y +=3D tests/virtio-rng-test.o qos-test-obj-y +=3D tests/virtio-serial-test.o =20 check-unit-y +=3D tests/test-qgraph$(EXESUF) @@ -813,7 +813,6 @@ tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-o= bj-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) tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c index 657d9a4..5309c7c 100644 --- a/tests/virtio-rng-test.c +++ b/tests/virtio-rng-test.c @@ -9,16 +9,12 @@ =20 #include "qemu/osdep.h" #include "libqtest.h" -#include "libqos/pci.h" +#include "libqos/qgraph.h" +#include "libqos/virtio-rng.h" =20 #define PCI_SLOT_HP 0x06 =20 -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void pci_nop(void) -{ -} - -static void hotplug(void) +static void rng_hotplug(void *obj, void *data, QGuestAllocator *alloc) { const char *arch =3D qtest_get_arch(); =20 @@ -30,18 +26,9 @@ static void hotplug(void) } } =20 -int main(int argc, char **argv) +static void register_virtio_rng_test(void) { - int ret; - - g_test_init(&argc, &argv, NULL); - qtest_add_func("/virtio/rng/pci/nop", pci_nop); - qtest_add_func("/virtio/rng/pci/hotplug", hotplug); - - qtest_start("-device virtio-rng-pci"); - ret =3D g_test_run(); - - qtest_end(); - - return ret; + qos_add_test("hotplug", "virtio-rng-pci", rng_hotplug, NULL); } + +libqos_init(register_virtio_rng_test); --=20 1.8.3.1