From nobody Wed Dec 17 08:52:30 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 1739356811932185.81605059280037; Wed, 12 Feb 2025 02:40:11 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 80E7B1CAB; Wed, 12 Feb 2025 05:40:12 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id A7D801BD4; Wed, 12 Feb 2025 05:36:34 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 566D81219; Wed, 12 Feb 2025 05:36:27 -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 B3D4C1BBD for ; Wed, 12 Feb 2025 05:36:03 -0500 (EST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-220c8cf98bbso1820595ad.1 for ; Wed, 12 Feb 2025 02:36:03 -0800 (PST) Received: from localhost.localdomain ([117.251.37.46]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-2fbf98b3277sm1147688a91.7.2025.02.12.02.35.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 02:36:01 -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=1739356562; x=1739961362; 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=kK4Ty8DAkccPNqVKrHXp0Q+AXgQDGdWjDP+vfyqZtbI=; b=feG28DbBh9fWf5AROBeWaQnQtC2HUKeNxah7BdpOAVyYTTITAvxxmDQGEN44gTJWz2 gxVyHrCJsBK7CZ+Gsp3ZcM+x6Uj/a0eXWvs8fk88Nw0XvFPQzket3MptAUGj+R84Jn8w JEqZ8yJUAfDysqj0VDk8fQ/og5Xtx+yYIwHH31ZpOZoeoBoxLc1XDtcL2yIQcL8OirVz 90SAY5TQEgN56o51TarGWbnG209hxa611g9pm2d/EJn4b81u006mnwi+9/Xqjk5ZgzMB 6gSDL2KOpyTb6kuh22WVk2iEotI6JMfht+MFLBjvgQVsQ0KzrcRMduJGWblFA0rW7cEq O6Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739356562; x=1739961362; 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=kK4Ty8DAkccPNqVKrHXp0Q+AXgQDGdWjDP+vfyqZtbI=; b=WGcxoax2OvTxsN74i9m6BI7lavgiULEnPDbbVWHYzd2nS+pita7xUnlbhVNXLVbD79 nhEXPh5t7QKCKPnHyUuXRFozCnTxKp8ASKUQ65ALhJUqlnOj/Rt9WPw6p993BBcgOPvI rjzcnRS1Lr0oC4qAz68FyZ2DUoImKkYp2rBJJapsRoOn24TxXVr/JNnpWJr/E+wqC5Mc 6Sm9Rjz5t1nBGHGNpFQYgc+awzWrm9D2T5BZjsBLcpky9tWIMdbPT/DdWROPbX1bKlra ZbfYQIILho/1PUhLxO0mVYqxioT0loUpEOlCPHDSVtyO6cRp+jF4OQVNuzIPu7f3YAw5 nuOw== X-Gm-Message-State: AOJu0Yx1UZ01NLE1e0brY2RAREifM82yA2d8Kwn6CKf4tufdI1zwFVW8 0nz9dwH296gxOwB4FzeO6qanW1ekSKwa8pgoEs6/f7X0AptwEGjz3P9InA== X-Gm-Gg: ASbGnctSxhxI0XJGERU1RY3titPaJ+7C9k5h44G9OX2AU+ZNlG6LaZ4vb1v4S1O7ylC /zhADzIOheFMJ0yWDZUl45w7zhGPCzi9d9bCDeqDVXsZXKzwqmFXGtKE6cgyIWo9YLionJ1AIqW WV6l7hVHcQV8X3+Q1cdvKqvLdIUkpiTEg4pO2h7jP8cVHFruUcZq6jZ8SpFwXFVNtBxVvhS/v36 +SU2zg2wCEW0voccjIY+bPlj6khIK0OC0bCEMUC6jDtFNFq6Yub116e1uqBOEkBGQ/4lnjZDLYB 0RfC8cFy3Wzgd7Gzo4bZzl40yFGULf3jHoJ+SL+8qyUbAQ== X-Google-Smtp-Source: AGHT+IEk42UJo6lcDDKahcWsyE2wziXRz9SUAK+hHGInn5YVeCIE/O44foUhATdHMoEqdsE7sy8EZg== X-Received: by 2002:a17:902:f786:b0:21f:dbb:20a6 with SMTP id d9443c01a7336-220bbcc1e40mr45712165ad.33.1739356561974; Wed, 12 Feb 2025 02:36:01 -0800 (PST) From: Harikumar Rajkumar To: devel@lists.libvirt.org Subject: [PATCH v7 06/18] tests: Test qemuMonitorJSONGetThrottleGroup and qemuMonitorJSONUpdateThrottleGroup Date: Wed, 12 Feb 2025 16:05:25 +0530 Message-Id: <20250212103537.26352-7-harirajkumar230@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250212103537.26352-1-harirajkumar230@gmail.com> References: <20250212103537.26352-1-harirajkumar230@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2INJJCDG7SNRDUTYGZSWQCFTBJBTJDWX X-Message-ID-Hash: 2INJJCDG7SNRDUTYGZSWQCFTBJBTJDWX 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: harikumar.rajkumar@ibm.com, sanjeev.ranjan@ibm.com, earulana@in.ibm.com, 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: 1739356829120019000 Content-Type: text/plain; charset="utf-8" Within "testQemuMonitorJSONqemuMonitorJSONUpdateThrottleGroup" * Test qemuMonitorJSONGetThrottleGroup * Test qemuMonitorJSONUpdateThrottleGroup, which updates limits through "qom-set" Signed-off-by: Harikumar Rajkumar --- tests/qemumonitorjsontest.c | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index f7fe0fb6f4..bc18b5ef66 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), + "throttle-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)