From nobody Sat Jan 4 23:01:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1733750673246177.81795246395586; Mon, 9 Dec 2024 05:24:33 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 50BE0A40; Mon, 9 Dec 2024 08:24:32 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 44877130D; Mon, 9 Dec 2024 08:20:04 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 1F45311C7; Mon, 9 Dec 2024 07:42:35 -0500 (EST) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 436B211CC for ; Mon, 9 Dec 2024 07:42:34 -0500 (EST) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7e6d04f74faso3036743a12.1 for ; Mon, 09 Dec 2024 04:42:34 -0800 (PST) Received: from localhost.localdomain ([120.60.110.156]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2164d103993sm18113195ad.193.2024.12.09.04.42.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Dec 2024 04:42:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733748153; x=1734352953; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qqq/ALIAg/IFrQR7GTzoomOs+366odcFGWxPMf7qdtE=; b=UMJN9oDBmTnqNM+XMopglVSHFGIt+88oAWunhscC1xwTAxn6kdM77L7azsyrXjTms0 g87Jq8XfPbLZ18WPMKn3SgWwKvgBjKkRU/5cdN0aBZlRLkDUOjt2xVwPFf3It4n5qnU+ nkrhkAXfBFVjoiFm1AUQZcoVk7YuBRrmfN3tFKryzYGfGIWkTX8y9G5OnDnwEOehgCHf cDF8oJPFPNb1+DCQajqJKEbtdSKdt2LMNpPOSYniVRFRqZXm8/Xu7wPAnNDIqyRVV2Nf 5Vg/GjeXT1MD9jdzzipRDWI/g5SQOvqGwFREmzsFD1d5U1hLZcPVy61id79jt+8A5F4q 37vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733748153; x=1734352953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qqq/ALIAg/IFrQR7GTzoomOs+366odcFGWxPMf7qdtE=; b=fcnU9+dVh1yIwSfRoFzTMbIYWZtHsiNT3l+5Ey+mPxUMqLcqd6gmZ6ceVJXLTVvqlZ 6HBRP+3onVxFyNDc5COORx/fJTylwCo/Ygm7sdPH5ag23hZYRfSDtB+K9UpmddC0V4Br 7f343oigHZZbxo/3FSoP6GzD0+QrNWOcSZxatwRNW7bTgzAKa+HP1uKpmNYn8ckb5ARQ q3tJs+ZHlUh/r/kEm2d07PC7OeTXbJu//GAejqbzbxMC1AcdNypiD58/cyFPqFPW/LRK kyJmOdn9OPaZYD9rWta41Y8WPEIMa68QLUvmb0n7PHy7wVDrjSUmXUTdOmjIgsT4IZUJ sEzA== X-Gm-Message-State: AOJu0YzJZmQw8Q5PluzS0WB2smBiHHgQd/BMEkU9TYU1kSuMIYtmNESq 2a48ENJTD/eOvx3dv5znMFx4FiyY9BfDSkaFZk5nHfM83w2QKLLajajkipGX X-Gm-Gg: ASbGnctXTuQ54ythLKgR5nwzONhogEP6HAQ8UUo235zerax+2uU3qDO5nxUGgqECpiR wAN4jOWKE0EpC/ocMvdbPhs/Tla6InuZX/vSNoNDePFQDFcRz40D41PJUHAusyD05v0KnvOZoER fpT35CvfeSzTGJCBxPzdewkcqpT28yKtuEnLcpGtpZ5rEejfTIW/DjFiSvEl04bYQuawPR8SNQR AWSrqNZUQTgVOVqP9XZToZEd1NqWhZ550ZbpwoIeJJ59yRbypwsXgoM2P8Rs796Pbf/CF33BSPg L4rmiw== X-Google-Smtp-Source: AGHT+IFmW4DhxFi83PLupY8tBT9RO97ZLheDKWGLcySLSDSpTUOtvtypEg/8tZ+Lh9gxeKjE1lbYdg== X-Received: by 2002:a17:902:d512:b0:215:a2f4:d4ab with SMTP id d9443c01a7336-216109330d9mr167660525ad.7.1733748152642; Mon, 09 Dec 2024 04:42:32 -0800 (PST) From: Harikumar R To: devel@lists.libvirt.org Subject: [PATCH v6 06/18] tests: Test qemuMonitorJSONGetThrottleGroup and qemuMonitorJSONUpdateThrottleGroup Date: Mon, 9 Dec 2024 18:11:06 +0530 Message-Id: <20241209124118.39471-7-harirajkumar230@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20241209124118.39471-1-harirajkumar230@gmail.com> References: <20241209124118.39471-1-harirajkumar230@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: harirajkumar230@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: AFYUVGZTULFXIVFDY7NOKL5WZ2EW4XFS X-Message-ID-Hash: AFYUVGZTULFXIVFDY7NOKL5WZ2EW4XFS X-Mailman-Approved-At: Mon, 09 Dec 2024 13:19:44 -0500 CC: earulana@in.ibm.com, sanjeev.ranjan@ibm.com, harikumar.rajkumar@ibm.com, Chun Feng Wu X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1733750674959116600 Content-Type: text/plain; charset="utf-8" From: Chun Feng Wu Within "testQemuMonitorJSONqemuMonitorJSONUpdateThrottleGroup" * Test qemuMonitorJSONGetThrottleGroup * Test qemuMonitorJSONUpdateThrottleGroup, which updates limits through "qo= m-set" Signed-off-by: Chun Feng Wu --- tests/qemumonitorjsontest.c | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index f7fe0fb6f4..cf6fce3d77 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1884,6 +1884,91 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle= (const void *opaque) return ret; } =20 + +static int +testQemuMonitorJSONqemuMonitorJSONUpdateThrottleGroup(const void *opaque) +{ + const testGenericData *data =3D opaque; + virDomainXMLOption *xmlopt =3D data->xmlopt; + virDomainBlockIoTuneInfo info, expectedInfo; + g_autoptr(qemuMonitorTest) test =3D NULL; + + if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) + return -1; + + expectedInfo =3D (virDomainBlockIoTuneInfo) {1, 2, 3, 4, 5, 6, 7, 8, 9= , 10, 11, 12, 13, NULL, 15, 16, 17, 18, 19, 20}; + expectedInfo.group_name =3D g_strdup("limit0"); + + if (qemuMonitorTestAddItem(test, "qom-get", + "{" + " \"return\": {" + " \"bps-total\": 1," + " \"bps-read\": 2," + " \"bps-write\": 3," + " \"iops-total\": 4," + " \"iops-read\": 5," + " \"iops-write\": 6," + " \"bps-total-max\": 7," + " \"bps-read-max\": 8," + " \"bps-write-max\": 9," + " \"iops-total-max\": 10," + " \"iops-read-max\": 11," + " \"iops-write-max\": 12," + " \"iops-size\": 13," + " \"bps-total-max-length\": 15," + " \"bps-read-max-length\": 16," + " \"bps-write-max-length\": 17," + " \"iops-total-max-length\": 18," + " \"iops-read-max-length\": 19," + " \"iops-write-max-length\": 20" + " }," + " \"id\": \"libvirt-12\"" + "}") < 0) + return -1; + + if (qemuMonitorTestAddItemVerbatim(test, + "{\"execute\":\"qom-set\"," + " \"arguments\":{\"property\": \"li= mits\"," + " \"path\": \"thrott= le-limit1\"," + " \"value\":{\"bps-t= otal\": 1," + " \"bps-r= ead\": 2," + " \"bps-w= rite\": 3," + " \"iops-= total\": 4," + " \"iops-= read\": 5," + " \"iops-= write\": 6," + " \"bps-t= otal-max\": 7," + " \"bps-r= ead-max\": 8," + " \"bps-w= rite-max\": 9," + " \"iops-= total-max\": 10," + " \"iops-= read-max\": 11," + " \"iops-= write-max\": 12," + " \"iops-= size\": 13," + " \"bps-t= otal-max-length\": 15," + " \"bps-r= ead-max-length\": 16," + " \"bps-w= rite-max-length\": 17," + " \"iops-= total-max-length\": 18," + " \"iops-= read-max-length\": 19," + " \"iops-= write-max-length\": 20}}," + " \"id\":\"libvirt-2\"}", + NULL, + "{ \"return\" : {}}") < 0) + return -1; + + if (qemuMonitorJSONGetThrottleGroup(qemuMonitorTestGetMonitor(test), + "limit0", &info) < 0) + return -1; + + if (testValidateGetBlockIoThrottle(&info, &expectedInfo) < 0) + return -1; + + if (qemuMonitorJSONUpdateThrottleGroup(qemuMonitorTestGetMonitor(test), + "limit1", &info) < 0) + return -1; + + return 0; +} + + static int testQemuMonitorJSONqemuMonitorJSONGetTargetArch(const void *opaque) { @@ -2981,6 +3066,7 @@ mymain(void) DO_TEST(qemuMonitorJSONGetMigrationStats); DO_TEST(qemuMonitorJSONGetChardevInfo); DO_TEST(qemuMonitorJSONSetBlockIoThrottle); + DO_TEST(qemuMonitorJSONUpdateThrottleGroup); DO_TEST(qemuMonitorJSONGetTargetArch); DO_TEST(qemuMonitorJSONGetMigrationCapabilities); DO_TEST(qemuMonitorJSONQueryCPUsFast); --=20 2.39.5 (Apple Git-154)