From nobody Thu Apr 25 01:50:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1668133567; cv=none; d=zohomail.com; s=zohoarc; b=GQQzw7OlxaqZQUTmAadNR1zyAq4lpAY3a+7/s54E5tIF7wDecsvw86tlgwLVd49e8V1pBPkARevN1KsskR6gzPY0bxGHeVlXPlK6ANJ0w/5pOUHvHshv2JskrX1gTJAW+5s1yR+Y559x6GGz/SkB8YbuyT9a5KfVZtch1Hw4hg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668133567; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=k1QvEsIejcZf448PUKerHk/9jj3FwbgW2kl5xAqcmEI=; b=fHT+mrpep1ICNpfeNTQePTqp1fD09CzNAKAArCyvsl4j/YaXdTtj9ZnEl23aMeUyxxTqzaB1fbWfOSZXCffT/DtKo+ePedQ6Bt/fOqRPyxZaTVF5vLeellh+ZL/TV6A4rwjfrVng781tP8TvIegAmDFs6LitxKX+blKnZtvgkPI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1668133567917576.444737931921; Thu, 10 Nov 2022 18:26:07 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-QZCpbR3aMBGwwIz6Gy9e0A-1; Thu, 10 Nov 2022 21:26:01 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B4931871CCD; Fri, 11 Nov 2022 02:25:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B6C539D6A; Fri, 11 Nov 2022 02:25:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CEE201946589; Fri, 11 Nov 2022 02:25:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 220021946587 for ; Fri, 11 Nov 2022 02:25:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DE19F492B0F; Fri, 11 Nov 2022 02:25:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6070492B0E for ; Fri, 11 Nov 2022 02:25:55 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B4BB91C08978 for ; Fri, 11 Nov 2022 02:25:55 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70049.outbound.protection.outlook.com [40.107.7.49]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-205-yv4nU57cMc2IOANn_r1C3w-1; Thu, 10 Nov 2022 21:25:53 -0500 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) by DBBPR04MB7690.eurprd04.prod.outlook.com (2603:10a6:10:200::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 02:25:49 +0000 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::9d86:e0fa:f725:194]) by AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::9d86:e0fa:f725:194%7]) with mapi id 15.20.5791.027; Fri, 11 Nov 2022 02:25:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668133566; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=k1QvEsIejcZf448PUKerHk/9jj3FwbgW2kl5xAqcmEI=; b=P7NXYNsMmOsXxHyL7v4sYhsATH9zyu+IbQDJxVFZlNJCCSrV9BkSncuE8ynWmCntauTHrI LVBvEXpZe22sBo06STbO/aAKcJyeOP0Ajvf4ccZcAxYK8yRCjuA+Huh48U6vWwFOiFbOI6 vLHtbe7AmEoLg2IDWX8uFS6hKGk2WqM= X-MC-Unique: QZCpbR3aMBGwwIz6Gy9e0A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: yv4nU57cMc2IOANn_r1C3w-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH] tests: Fix libxlxml2domconfigtest Date: Thu, 10 Nov 2022 19:25:46 -0700 Message-ID: <20221111022546.9688-1-jfehlig@suse.com> X-ClientProxiedBy: AM6PR04CA0066.eurprd04.prod.outlook.com (2603:10a6:20b:f0::43) To AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB4899:EE_|DBBPR04MB7690:EE_ X-MS-Office365-Filtering-Correlation-Id: 2af341bc-41a8-4d1a-caf7-08dac38c0c38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: tWvpuLHv1jMObt6Yv6PlQMblVUcEM5Ji1A9RBq8pIZoKnRxBco/bAnzEFk1uXHKZ3U4HltMox9GOmKYw6EKrDA1k5dgN8APUA2fUAHRFOy4AaQnuYtxuoA+7TTwfRxHYQtFZP6lyGWSU8+gpKP2KaJBmpWJA9g8jiP6AIUL90pNTS8vayYT+ismC0klyQNp6+uzY0zSZpJ425Z8z2LRmbjbHNWLwX50BFDHy6UEQWpUUTfXpXaXKHPmZVLuo0PdDxztfnSzWFsiFDsqEg1AgIGhvwAf+2VK8SuVCKqjuhcrFZPlWjcSPOu9XWj8kgRF5/uiAoSbd5MzMxJiXbWPcJiVtwfEkY+ed/lwMhsYNz9hpsQpBtfn6sTwAd59PQPtabyeV2LmvS1az2KSiueJYpwzWD2yAR17jXkPtNF2CbEHjw45fN9VxbVhbpCgaV6cWf+5fjugS37TSOrIUNEICuR5qfAPI7ZW5vgqFBN3MoumD4ISKiD/i2mpQdph4xD5WQ09PEGrPPIk573wMpZNt83wmKbYWHT3TXHFmJ5t0OEPFafl0TcOTXMJy1Uv5Gm3/pFoSgng8LpNfrWUS5vo3bCOcgO53gyNXmF/yygIQnlH9x4/dunVsNpVMkb7cAx/Im4doYsmvygEXebOLKBT1lSch6Y0iz4PeddYIb7YgCRFAJuSfYav5Z5B41jYa8E166oLdOQL8Ol8/IOuiUwJ5MA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4899.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(136003)(376002)(366004)(396003)(39860400002)(451199015)(36756003)(86362001)(6666004)(6486002)(6916009)(478600001)(38100700002)(66556008)(2906002)(6506007)(6512007)(26005)(2616005)(186003)(1076003)(8936002)(316002)(8676002)(41300700001)(66476007)(83380400001)(66946007)(5660300002); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DomldMucZG8zdlhil0sPPfIAEa61gEqTAElDhX0G9YDob0zsKvJGZfpu7/k+?= =?us-ascii?Q?EBD+K4qLdgHpZKGkT2CJagcOVgroCQG9KIM2Eq6DxjPmcV4Dcb8t65DS19IP?= =?us-ascii?Q?90FLeWV1DodJ6w5dHKTkBjWWnZfF2gTENaGGxEiha5avnf9W3qqADT41SHbY?= =?us-ascii?Q?YZWImjmZ6WNMdDwH42XEM06XUEqncrM3blBnTS24PdDbZ218TrWYmXM2DgsR?= =?us-ascii?Q?WygrR6X2RVnfIU3CqQPEW8Gh2/wAF+0YA78fJsavCsAsSC/pl4a91f91fK0t?= =?us-ascii?Q?TWrZ4kNyISji3+EcldCj5Fmfg/CZf1XvxBOFKskPvh5bhpXSLRAzNsS8y6iX?= =?us-ascii?Q?BoR+jUzvc9ANgNQCmcMwwqtx+fLwH1drFXMc7VrKciaRqdQa9gsxlbhdkq84?= =?us-ascii?Q?xgQwOQhHCYZ169CU33s3fdsI2f1p+QrTVcmBaWfOsueMiHDLSU5rZV6no67K?= =?us-ascii?Q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lp8oFrdTQNb2FMvEb3?= =?us-ascii?Q?O2tS4hxUbs0b4NfS8iEZkBMSVLgv19C2tTU76w+0Mu2E4yMq7Ap7NV8HyJ+q?= =?us-ascii?Q?g87Rj/udM04OHRN/DHsgJerbZ407mdbzTIfpKw0a3hmL523UjD2D1VZJNjkr?= =?us-ascii?Q?GjRnEytOkigATMJfjL47WMgJJYy3g00MssBGKyPVGeqWQvbXm2AjpJkffqkO?= =?us-ascii?Q?75Sm6y+UN7S22BmJtgywVgp3tlYjb456Mmh0nSZ/?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2af341bc-41a8-4d1a-caf7-08dac38c0c38 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4899.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2022 02:25:49.5795 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2mFbln7VzZ4X+z7gIvL/8C1I5vLD4y2o/BStoEEcnmcdGUy3QF+PuiScn0GkRr0OQn4PMD/wKmAw9TKlQMJT5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7690 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1668133569002100001 Content-Type: text/plain; charset="utf-8" Downstream CI recently encountered failures of libxlxml2domconfigtest when building libvirt packages against Xen 4.17 rc3 packages. The test fails on vnuma_hvm config, where suddently the actual json produced by libxl_domain_config_to_json() contains a 'pnode' entry in the 'vnuma_nodes' list, which is absent in the expected json. It appears the test has thus far passed by luck. E.g. I was able to make the test pass in the failing environment by changing the meson buildtype from debugoptimized to debug. When a VM config contains vnuma settings, libxlMakeVnumaList() checks if the number of requested vnuma nodes exceeds the number of physical nodes. The number of physical nodes is retrieved with libxl_get_physinfo(), which can return wildly different results in the context of unit tests. This change mocks libxl_get_physinfo() to return consistent results. All fields of the libxl_physinfo struct are set to 0 except nr_nodes, which is set to 6 to ensure the vnuma_hvm configuration is properly tested. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- tests/libxlmock.c | 15 +++++++++++++++ tests/libxlxml2domconfigdata/vnuma-hvm.json | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/tests/libxlmock.c b/tests/libxlmock.c index 4754597e5b..205d34df19 100644 --- a/tests/libxlmock.c +++ b/tests/libxlmock.c @@ -70,6 +70,21 @@ VIR_MOCK_IMPL_RET_ARGS(libxl_get_version_info, return &info; } =20 +VIR_MOCK_IMPL_RET_ARGS(libxl_get_physinfo, + int, + libxl_ctx *, ctx, + libxl_physinfo *, physinfo) +{ + memset(physinfo, 0, sizeof(*physinfo)); + physinfo->nr_nodes =3D 6; + + /* silence gcc warning about unused function */ + if (0) + real_libxl_get_physinfo(ctx, physinfo); + + return 0; +} + VIR_MOCK_STUB_RET_ARGS(libxl_get_free_memory, int, 0, libxl_ctx *, ctx, diff --git a/tests/libxlxml2domconfigdata/vnuma-hvm.json b/tests/libxlxml2d= omconfigdata/vnuma-hvm.json index 2556c82d5f..c90ee823a4 100644 --- a/tests/libxlxml2domconfigdata/vnuma-hvm.json +++ b/tests/libxlxml2domconfigdata/vnuma-hvm.json @@ -39,6 +39,7 @@ 41, 51 ], + "pnode": 1, "vcpus": [ 1 ] @@ -53,6 +54,7 @@ 31, 41 ], + "pnode": 2, "vcpus": [ 2 ] @@ -67,6 +69,7 @@ 21, 31 ], + "pnode": 3, "vcpus": [ 3 ] @@ -81,6 +84,7 @@ 10, 21 ], + "pnode": 4, "vcpus": [ 4 ] @@ -95,6 +99,7 @@ 21, 10 ], + "pnode": 5, "vcpus": [ 5 ] --=20 2.37.3