From nobody Sun Dec 7 13:35:42 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 1739984759012739.2263262847997; Wed, 19 Feb 2025 09:05:59 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 04BD81E17; Wed, 19 Feb 2025 12:05:58 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EFEF11DAB; Wed, 19 Feb 2025 12:02:21 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 5516C1D64; Wed, 19 Feb 2025 12:02:16 -0500 (EST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.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 27A791C9B for ; Wed, 19 Feb 2025 12:01:52 -0500 (EST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-219f8263ae0so130571225ad.0 for ; Wed, 19 Feb 2025 09:01:52 -0800 (PST) Received: from localhost.localdomain ([2001:4490:4ea9:8374:8512:e327:fdaf:a56e]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-220d558fe3asm106651545ad.234.2025.02.19.09.01.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 19 Feb 2025 09:01:50 -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.8 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=1739984511; x=1740589311; 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=DszPuPk/BustI2h10gk0CfSGFhMFWS6Zl/rVFLZ2iU0=; b=SEiuf6PbdpueGqM2/iZLmjp8JwaQiOjM2Kg2d1YJvR4nJP934xB5RbeDhPVGyMCpxV W3mtXHV8yYbvo4CL6qXZ6TsdldewokXU5z0lQ2myomidrp5dwxQozhSxdrIA8E0DTS+d xPhJ95E/Lt4wOBWlghFsN5vI/0zexVlpQVaf8a+NEWNyegGN0pR0WaNlW3Hou5rBfpTo XgId1EOFJPknS+YdqveaOJcj72ttvgGBGxSmEtBMFEBo0SdR7fki4gq3n95rCS95y9fI wGliRreKVEqWPKyNZeLsZe8XJs6A1Zoy73horkHSArA8Ac9kTs2Kcl056QdwaGb9T5F2 v30Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739984511; x=1740589311; 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=DszPuPk/BustI2h10gk0CfSGFhMFWS6Zl/rVFLZ2iU0=; b=cqCpTEKDKhBbdlWLj05GXIxe8EyO2RFrmcBEjWtXKGvdoqcdFcNQIF+BRDCaS/m5WW j025m98w6XSWdwiZhzb9qlYJ36u9lu570SbSFpPPDYVpSEg9wYn59LrbjAEBhsggex5d Uw046tmo0GpD8OLQsMm6zLpF9wR3oPQwfR9Zhy3KjB8cjLvGfjaFXxHqI8QyD1XZE7iw du0a4qLxqgcvaQzYPa7Lsyz7XkUlx5kItHCQ0/MrjbzJ/1hmkjVZak7022f5NtSW5Dfm ldfI4MTIoHfDORugcrz/b9pIoyitDfPzCahP1gs+OdoKw5J75PQ4ZDgpiuI9V5a4csyh 1BAw== X-Gm-Message-State: AOJu0Yz9RDvxHMXpYFFvatMfkNiLkVoSF7E0im1W1AJrz+WyXNxXYzDH B2Mq9XYhZRSeul0l6kyU3U9oX++uT0pl4ibb7+LAVWWeuyr+VsHp30x67ixp X-Gm-Gg: ASbGncuzW2bWuL/KhWKsFk2nvob4WzyqvHJ8A3Aj7BhQB2GoE/SXq5k1rGatDBahDa3 H1phgO9av284iek+Bntn/S6XsJjcuEF7ft8bRiZmaUZtVA6FfFV/Lu65Kq9PLWsWvo00PQTE+58 bgtNbHCw6lxkuVCM0jCNSf3CUKT3djHc/iBwb7DNo72UExQ/PN4NRLTwlOiUrzQPhjUJ0ix4KGp 8CrkN+XeJZGGAeTLTFATUzsQlznV9qSJhUkbNFaokwzLXz4kibNltvP719dlXEWNSBT1tyVl57A ftATMzgA6dOtQQEqUCyk9mzVsG4uj8WE4o7IjHxUPLAHwips0hBM0F15DA== X-Google-Smtp-Source: AGHT+IHfxafwE1J1OiXMLPrNJT54n71Vw5LoUaL1PNdV+GKDBEDkXN5sUPCjef4QDNwUR0A2TSoFlg== X-Received: by 2002:a17:902:f70e:b0:21f:3e2d:7d35 with SMTP id d9443c01a7336-22104025607mr278780925ad.15.1739984510590; Wed, 19 Feb 2025 09:01:50 -0800 (PST) From: Harikumar Rajkumar To: devel@lists.libvirt.org Subject: [PATCH v8 06/18] tests: Test qemuMonitorJSONGetThrottleGroup and qemuMonitorJSONUpdateThrottleGroup Date: Wed, 19 Feb 2025 22:27:10 +0530 Message-Id: <20250219165722.26348-7-harirajkumar230@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250219165722.26348-1-harirajkumar230@gmail.com> References: <20250219165722.26348-1-harirajkumar230@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2J4BCY7KMFCM2SVWPMRZPCS4RLLBOYNJ X-Message-ID-Hash: 2J4BCY7KMFCM2SVWPMRZPCS4RLLBOYNJ X-MailFrom: harirajkumar230@gmail.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: sanjeev.ranjan@ibm.com, harikumar.rajkumar@ibm.com, earulana@in.ibm.com, Chun Feng Wu , Harikumar Rajkumar 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: 1739984761269019100 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 * fix test Signed-off-by: Harikumar Rajkumar Reviewed-by: Peter Krempa --- tests/qemumonitorjsontest.c | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index f0f6a329c8..bd1fda145b 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1914,6 +1914,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), + "throttle-limit1", &info) < 0) + return -1; + + return 0; +} + + static int testQemuMonitorJSONqemuMonitorJSONGetTargetArch(const void *opaque) { @@ -3011,6 +3096,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)