From nobody Tue Nov 18 07:55:46 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 1731939266583455.2752723904954; Mon, 18 Nov 2024 06:14:26 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 6BA931AA7; Mon, 18 Nov 2024 09:14:25 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 93C3A1BC4; Mon, 18 Nov 2024 09:10:33 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7A45919FF; Mon, 18 Nov 2024 08:55:03 -0500 (EST) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 BF04019F9 for ; Mon, 18 Nov 2024 08:55:02 -0500 (EST) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-7ea8de14848so1608448a12.2 for ; Mon, 18 Nov 2024 05:55:02 -0800 (PST) Received: from localhost.localdomain ([2409:40f4:9:7d39:e991:fcfb:15ab:ce58]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-72477135ecbsm6113482b3a.84.2024.11.18.05.54.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 Nov 2024 05:55:00 -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.5 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=1731938101; x=1732542901; 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=RCcTpzn/Nq32gg8kT9BVIp5VP0QEDqJ+8tfDCKOnp8jvOf9eziz37UsYXEMfDor+Lg vxd7kCiYbBoFfya+ge/58bX+g9xUVjzcKUb9mDZMd6Ev7Cy2kYTHS4kOkZjirLJQEqge ugyrLZXrHwUP18qx364r5Fkb2tXrGDnMqOhWo2xM0MQ25tE7yg92LjO2ogxjQIdBRIjP YTI/MlV/mouQPFp831uQvre1gsBfbElMhEJoBVq931S1F8EsOHjiuDJ330Mu5lAKvVtl 3o1tzQrYArpE78r9pGUn5vJoJV35iaz80hwmNpU2kbWXl7z/kvGOCXjXSE/Nd3vtl6Hy Z6rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731938101; x=1732542901; 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=NbfvRh1lFpL78gol++J0SO8mEvUcU2E6dnw1OQMeOFwv8MV7CxuvkfTs4fvmHX+eeK 8S59CYwTqK2DidgAXtxpjchnVPclthVWXeK6vtGpwa1MCcH/RFS4TkeW3UZ8Af89tQQV XmNG1lxybf9Hp46zcylIDyFUmcu4ATly6DFo/6XQ7HKhLEGFo7LDLbDpxkT0UPgn710D G1redZZ2ZPZOkjrIK0YtIh+Iym1tsWbzY3w1JglbsjVD+vXsBLaJKISqn29DQdHmFKQF o8rmeSuhgaR1Nz7nx5t0/wAMkG5aNBeovU2LKJqItCZSF2IkCAdffZwKy2cor0/gCgrz LvOw== X-Gm-Message-State: AOJu0Yyz2eqh9SODrHKGixbznVttFgS2MnNP8mBj6m+iIoLus+EmnHZv 59GrCT4vFTE1cCYDLAWaRB6Gf6P58NFSOvigiw9mqaagADUM+5oOP/BfRoHw X-Google-Smtp-Source: AGHT+IHk2vRfvlFVCcE15PSioc+tw+s3ZLYkoFdS0UCm0C5wZLKUEsWTVkLl2Mv+D03msI0s+61pQg== X-Received: by 2002:a05:6a20:a120:b0:1db:d9fe:c442 with SMTP id adf61e73a8af0-1dc90b556c1mr17852502637.23.1731938100854; Mon, 18 Nov 2024 05:55:00 -0800 (PST) From: Harikumar R To: devel@lists.libvirt.org Subject: [PATCH v5 06/18] tests: Test qemuMonitorJSONGetThrottleGroup and qemuMonitorJSONUpdateThrottleGroup Date: Mon, 18 Nov 2024 19:24:14 +0530 Message-Id: <20241118135426.37643-7-harirajkumar230@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20241118135426.37643-1-harirajkumar230@gmail.com> References: <20241118135426.37643-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: ALCT53FMTEHL5SGAPIW2LTMAND2HGWBP X-Message-ID-Hash: ALCT53FMTEHL5SGAPIW2LTMAND2HGWBP X-Mailman-Approved-At: Mon, 18 Nov 2024 14:10:14 -0500 CC: harikumar.rajkumar@ibm.com, sanjeev.ranjan@ibm.com, earulana@in.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: 1731939268042116600 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 Reviewed-by: Peter Krempa --- 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)