From nobody Wed Apr 2 14:28:19 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1742822367; cv=none; d=zohomail.com; s=zohoarc; b=iz7W33enGDrTSmhAK9k/gBwbVxNfa4JTyMNtoMz8TbRFoAleygl7laKDFsiYDBDsoSNEvkgrPK6wDWPhOqzrabOdUOa3xBer/peTWlqHM2V1tEapj9H2j4BTZV+YTmdMZkuGpZVUI2nU0Im7IU9o3UJCI3tNla8o+43PhSe9L8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742822367; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9BAN5HZ8IUPZMahsfrk73BSgqvB455M7gULX/WU50Js=; b=Tho+TdjSYjtvVg5sDq1UpbkbThmbvOc7ME53aDF1mDLDtK+ZhIIgnbM3ER8J5UZjMO1ZgGHTRqerGbZFwd748bui6y+xpd77PVDqppiRFQ3CcfsgqObzlIys2tzHBi+omNA3EyIOx8DLqLA0fW+iUZkh9w8n+fLBBfxHS1SGJ38= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1742822367974616.9611868157627; Mon, 24 Mar 2025 06:19:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twhgn-0000SE-SS; Mon, 24 Mar 2025 09:18:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1twhgd-0000NN-5j for qemu-devel@nongnu.org; Mon, 24 Mar 2025 09:17:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1twhgY-0006rV-DB for qemu-devel@nongnu.org; Mon, 24 Mar 2025 09:17:50 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-65-NOm03IE2NTqZlFPjimcS1w-1; Mon, 24 Mar 2025 09:17:42 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ECCF5196D2D3; Mon, 24 Mar 2025 13:17:41 +0000 (UTC) Received: from srv1.redhat.com (unknown [10.45.225.127]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AA12B1956095; Mon, 24 Mar 2025 13:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742822265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9BAN5HZ8IUPZMahsfrk73BSgqvB455M7gULX/WU50Js=; b=NFkeg4G0tNnkYsFOOr/lrUagNB3c0yK+qT0tYGa2lKyGCGOtv1RTZ69wTgMjIsRKSlDrMu 3tx7ICSkIuMgb8n9xQeqCfYU49jBHS/NiJMPrmO1mDexjfY6cS/y2ES2icwJGX+Y0Z/RPv BzuOX8qb9i7E/dvUn/Qj9Bk3o4d0W8o= X-MC-Unique: NOm03IE2NTqZlFPjimcS1w-1 X-Mimecast-MFC-AGG-ID: NOm03IE2NTqZlFPjimcS1w_1742822262 From: Konstantin Kostiuk To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Dehan Meng , Yan Vugenfirer , Michael Roth Subject: [PATCH v2 2/2] qga: Add tests for guest-get-load command Date: Mon, 24 Mar 2025 15:17:29 +0200 Message-ID: <20250324131729.70992-3-kkostiuk@redhat.com> In-Reply-To: <20250324131729.70992-1-kkostiuk@redhat.com> References: <20250324131729.70992-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1742822937710019100 Content-Type: text/plain; charset="utf-8" Tested-by: Dehan Meng Reviewed-by: Yan Vugenfirer Signed-off-by: Konstantin Kostiuk --- tests/unit/test-qga.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index 541b08a5e7..587e30c7e4 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -332,6 +332,22 @@ static void test_qga_get_fsinfo(gconstpointer fix) } } =20 +static void test_qga_get_load(gconstpointer fix) +{ + const TestFixture *fixture =3D fix; + g_autoptr(QDict) ret =3D NULL; + QDict *load; + + ret =3D qmp_fd(fixture->fd, "{'execute': 'guest-get-load'}"); + g_assert_nonnull(ret); + qmp_assert_no_error(ret); + + load =3D qdict_get_qdict(ret, "return"); + g_assert(qdict_haskey(load, "load1m")); + g_assert(qdict_haskey(load, "load5m")); + g_assert(qdict_haskey(load, "load15m")); +} + static void test_qga_get_memory_block_info(gconstpointer fix) { const TestFixture *fixture =3D fix; @@ -1105,6 +1121,7 @@ int main(int argc, char **argv) g_test_add_data_func("/qga/get-vcpus", &fix, test_qga_get_vcpus); } g_test_add_data_func("/qga/get-fsinfo", &fix, test_qga_get_fsinfo); + g_test_add_data_func("/qga/get-load", &fix, test_qga_get_load); g_test_add_data_func("/qga/get-memory-block-info", &fix, test_qga_get_memory_block_info); g_test_add_data_func("/qga/get-memory-blocks", &fix, --=20 2.48.1