From patchwork Tue Jan 7 15:15:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 55133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22AF2E77197 for ; Tue, 7 Jan 2025 15:15:39 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.98]) by mx.groups.io with SMTP id smtpd.web11.22924.1736262932271212229 for ; Tue, 07 Jan 2025 07:15:34 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@weidmueller.com header.s=selector2 header.b=ZrgYjNme; spf=pass (domain: weidmueller.com, ip: 40.107.21.98, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R1Jfv1TOywpsVXd6vxp0lPLnETCuXPWuuw8kmGsu7P7u4QZ/Db8ZFF70NG7vke6st4ZmuXUez4HuuIecV6MItIb9OHpSbcDzsUwjn53pqyw8QPASjiXxHgbMrRwjUDO7oFvv7VbQPfHiPmDhPCSBVa09EREsw9YzeIYRIIiFDedAK/w1xJDtokzwVQYoj6xOEqzAeP9MoeQDpZsPZKi/lbvIaiBihIX7eFE3MSgNzPD9/CLw8BJ2qBZ1xG8+nPkdfjyZxZ8K4L3Q+A5IdV0CRwRFxWjkFqmHJ0KlQii4XWskASXrzs9Vs3/SPJaQ/UvBOl9+1+tdGoeKqGYSrt4fYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6pbj55CPFe25xB3fiBrLj9pEp8pJo74Je7GJhUMbgW4=; b=stKhdx5n76HNC6t1DR6+F05SH56jbTBB+lfb0ObZTFHBNDMMG39VNhBgWPceyQDJcZhBYmWbD85c/P+gmLymcTCwI8EQ6IWJ78l0D4xoW/STsGTeq6SLJegJ8qBJvGFXnw0XwWVeMALCbPxE2TFgDzczDGbP0feqbWrRhaC5xqZzuINPrcfXGjpVIp8YH3PYmqHq3scWXYb+QShh8L4lCxUDQGQdOHw0FjlbdR4EpaGcP2gZCCYNZ8AME6+WHUO479yzUGtVqMtue67L1xriq6w2ARIF6kl6Byq3OHwMHBN4RcXDkUb3exxIJSuLCagYYrsnERnQ5WLXhpdSAAx/Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6pbj55CPFe25xB3fiBrLj9pEp8pJo74Je7GJhUMbgW4=; b=ZrgYjNmeH/ygNgi0t36uHhIqgH6Dht5fY8N934w6mgB8IbBzHD6rmRvjhsJtf6puR/VWUkaSByRJOROh07NgoXsEhCq6Cw7wc8qdjpXBVBYM6HL/e7JWisLGiPffPHsZKOzC9PrcL3wtJdyOlrcLgBDoGjEEXnIYpGXyHbKQfTV0fnYHspxomQtGSO+4BVsRU4Y4fqAWdTU0gDaJqnQ08PRfBewHJHwuvSOnvlTgPABAHR5RQwNm5cweUl3tQOsng2U5Y2nUQv8j6MhF1clNRRRgUKKH6MC0FIsSQqQ+7H1fQCi/f4VrnAABntwv76MDIuvD1cz8Od2wiDZJbcHbKA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by VI0PR08MB10538.eurprd08.prod.outlook.com (2603:10a6:800:205::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Tue, 7 Jan 2025 15:15:24 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4%3]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 15:15:24 +0000 From: Stefan Herbrechtsmeier To: bitbake-devel@lists.openembedded.org CC: Stefan Herbrechtsmeier Subject: [PATCH 1/2] utils: add Go mod h1 checksum support Date: Tue, 7 Jan 2025 16:15:13 +0100 Message-ID: <20250107151514.8115-2-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107151514.8115-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20250107151514.8115-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR0P281CA0229.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b2::14) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|VI0PR08MB10538:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d95acbf-1dcd-443d-c9f9-08dd2f2e1bd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: 4ZPcP/N2mxKeOILtKyStdGbxgyves3UznCgeRjcmrM6h5Jfw692Vuhc8t4vQSArf9vHtT1n8eWd5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22yxteQdOOys9kyAF/rszhYKbjtZzKNJCYzYicB0O7jd/CwA4EmVHd7gdrg/yvcNGtS2ZHtVSet9+heOAkY+/ILyh+8TDF4jnhXY6gXiM4oyYFb+q20rBh4YAhjGYcOVIEdk88lUT32YxqtUGBiR5UoP8xCPjKl+kOI933KaCOWpdmMQpuBVsaEAmynsghwiHh3zu6KfQ6/fd6rKzpi/OPzXn37rGV0e/Pc070ciBSbF7odWIqNrXG4PYF18ef9IG1oAwt5vs4aY3bESiwzZdbS6C8ZyV4YuKSGGDAZazjpz8/SVW0bTJfT3K+jV9CJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u1HbDOgHyHcRY6SHgFmQ19VGQTHmbPdnT+z/9LLXWZEi3o97NTkcY5yOD2Nw5qMrrZNlCW0V/ERcZKsFNnmKcIiSpX+RcnQDrnc/AVIQAxOpL3Km4wB6ogygnRRBV9DH0eLYXorTaPkuVZsM/K+GQLyuzu2dOBX2CKW5iEIjPGAdJz01T/IEkVjqZbK8z417XWrk2sfloGahyb6WdgySUQH+BmCKlIZFVALxpulSh2y9ahe7BsM+rtHoaieHF7j4HV3UmsWgWUuRh+02dYayvKlMYKzrfJvHfPic2GJOWVJCzTDPajytQvWobHpS3pcAqDX5BfblVtaoSrZqs9iZ1UStWQnH6DmaF1zZPTb9v3pEgxLfNQY1mGHZy/VryJKLGudl60aCrmyinoKssYpSPG46HTy7K3LYn80X0Q4qWl91uz1vsagxWiU+xEhgfwqYTUO2JDDI2ME2Sykcz1fFqQXGFdPLMpzysSAljflGEaLe1y5EjsCVJDCunwsOGpQnVA7HkxQrE0jVJ5mItpGwesMI2RM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Org: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d95acbf-1dcd-443d-c9f9-08dd2f2e1bd5 X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 15:15:24.0002 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: F/v6jzfLUbUjaY2FCzMUCR59RGS+jYSTkfJITKkXC0QN/LfHy0bnIOe8Mul+S3cK7jOmymNTZwCEipRO6pr5+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR08MB10538 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 07 Jan 2025 15:15:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16979 From: Stefan Herbrechtsmeier Add support for the Go mod h1 hash. The hash is based on the Go dirhash package. The package defines hashes over directory trees and is uses for Go mod files and zip archives. Signed-off-by: Stefan Herbrechtsmeier --- lib/bb/fetch2/__init__.py | 2 +- lib/bb/utils.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index f79e278b1..911b42545 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -34,7 +34,7 @@ _revisions_cache = bb.checksum.RevisionsCache() logger = logging.getLogger("BitBake.Fetcher") -CHECKSUM_LIST = [ "md5", "sha256", "sha1", "sha384", "sha512" ] +CHECKSUM_LIST = [ "goh1", "md5", "sha256", "sha1", "sha384", "sha512" ] SHOWN_CHECKSUM_LIST = ["sha256"] class BBFetchException(Exception): diff --git a/lib/bb/utils.py b/lib/bb/utils.py index e722f9113..135c71c00 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -585,6 +585,31 @@ def sha512_file(filename): import hashlib return _hasher(hashlib.sha512(), filename) +def goh1_file(filename): + """ + Return the hex string representation of the Go mod h1 checksum of the + filename. The Go mod h1 checksum uses the Go dirhash package. The package + defines hashes over directory trees and is used by go mod for mod files and + zip archives. + """ + import hashlib + import zipfile + + lines = [] + if zipfile.is_zipfile(filename): + with zipfile.ZipFile(filename) as archive: + for fn in sorted(archive.namelist()): + method = hashlib.sha256() + method.update(archive.read(fn)) + hash = method.hexdigest() + lines.append("%s %s\n" % (hash, fn)) + else: + hash = _hasher(hashlib.sha256(), filename) + lines.append("%s go.mod\n" % hash) + method = hashlib.sha256() + method.update("".join(lines).encode('utf-8')) + return method.hexdigest() + def preserved_envvars_exported(): """Variables which are taken from the environment and placed in and exported from the metadata""" From patchwork Tue Jan 7 15:15:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 55132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24CF0E77198 for ; Tue, 7 Jan 2025 15:15:39 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.98]) by mx.groups.io with SMTP id smtpd.web11.22924.1736262932271212229 for ; Tue, 07 Jan 2025 07:15:35 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@weidmueller.com header.s=selector2 header.b=NW1elh4L; spf=pass (domain: weidmueller.com, ip: 40.107.21.98, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cfTtMGGlkJlJJ64/w08xgC9jx+Quis4we4kpoAmesfi1QZUqRS1sep6bbmdpBdmh/dd6fqm+E/FfxRTrCxfbtxNjDo685e1nuDHi5uOL2Fb7ICEtvgSnGcvPNeDC7tA77tGOEfxBdAVlxTXi0a60ggR2DVl6GM9A+C8K5PUlOiLkYEYXG4sRxTzgaSdes43Lr+eWl+PTwDvKEifd1WFraIMJgcQcHiwq+9Dx5gHXp7xeWWoW0dBdrRlchm07/58H8hgbt2u82IoR13Am95PBEG+9QAy+N+JQDQ1d8knoXzHamJM3ZMNQGB0Ma4pOSoW2SwEdLB1IfY7SsNvAOc52ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7Q6q3MD1M9yLb9yl5zIR0wAjclQLqSnhN/AOr6/nji4=; b=Y7oWBFklhTXBGaV/eSP3cuBxbMVT/O79EPflEGlc2YvKFSi9DZMbCyHl7cA4lgHJVxAxOaAkfs/9vpXBLfJy7xdUMa/tEdgE5nNY1DOLb/J3kZqCdKytOUQ+sO2G8M9+zJsGQVWNNhG13sJFARleRWsDKGTt67k9Sr7J95k49Z1bT4mXfF5I9o35SYfx+ho5dvFOg2UmbuD/T84CXfCZFghLbUMFZR8W4AKRj8w1FI8rxh5uhOA5OKyrDmN44vywNOF6wu1OlkGicsMiGT+/ivINbMWFjz8LZsNOFsu/Wk2+WLi0x5P6K9bvcFyt4X84Ut6xryr7Vvpat2mSUk2nVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Q6q3MD1M9yLb9yl5zIR0wAjclQLqSnhN/AOr6/nji4=; b=NW1elh4Lln7i3rToEEvklsW+w3xwHnB1y3OnXPGW5ksG2XVtCxNlCZoKoARwfcfG34OEvS/Gh5bTMhbbBF1G4YskIKxaM5+EAHnuGcyCA2Q1aFao886+ey5eeOTAUQaKaSPNGrIYF+wmSWloKh/CMZf0fQTwmTIeWri9lLBVSoddaB5vMcCmIfWWD81ZFWzU0zpj8ciuaPfbuaoDRDW1cpxFNcziTqiZTJOBLXhpnhvMUdD6R57Lyc3LKGkq+FWvuwhiPvi6zcHxs6/9Tc1/o27DEWJRPhROuJW+qZ6EWoeaUfAESrE8Nt0gJtVF3Dvq1OcQbzZjVvfMHuv+CA/ByQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by VI0PR08MB10538.eurprd08.prod.outlook.com (2603:10a6:800:205::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Tue, 7 Jan 2025 15:15:24 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::3b1:b329:1ed9:dad4%3]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 15:15:24 +0000 From: Stefan Herbrechtsmeier To: bitbake-devel@lists.openembedded.org CC: Stefan Herbrechtsmeier Subject: [PATCH 2/2] tests: utils: add test for Go mod h1 checksum Date: Tue, 7 Jan 2025 16:15:14 +0100 Message-ID: <20250107151514.8115-3-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250107151514.8115-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20250107151514.8115-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: FR0P281CA0229.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b2::14) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|VI0PR08MB10538:EE_ X-MS-Office365-Filtering-Correlation-Id: 5dfee39f-f451-4f86-fb48-08dd2f2e1c10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: maYEULxE+OqurOdnl94VLIT7xG2Ottj9DDjGxXug5qp+w3GtON8uo4+d4dnlZ7omrxrNTKSROgG/q6N0cru95CSZsmd4Q15lOm1DmuB1GpZWuD72uS3UG4ANcWq+8yUoxTunyyF1fd19iAIo/cJqEy+aYvlPGDAwU5kGu4+o0c6EJ0Z+mdqWq/uPpaqiukmDrT15mZJkCyIs7u16uwWTiq20QEn/mS9AxFCOWsmOZuE9pHrBKgtdcG/kKFSAblXKwWFNG9GSTl/dwoexbVwWiLIM4MDfgPGaoeRi7tZz2hc2+gd54u39FzaJNppDhawvt9v9C6zfFPFQHkpsJz76/VybbWEqg3aNEgxOHYtWZaPs72XYTaRZYsJD2qwhEroeD5zhZO9wWsACFlAfhWdp97KJ7MyxyJp8IpX5YYQomNZC9KT6R2aouzoNSuJYHV8cPsSPVoWPsKwLd1uiIgPfBI9g7GT2bnQ0bnpsX/kx18wz//uH4cxCZSGx+56rVeHYGkA0nlNC4otYk080sCP9DhKAAiYPeuuKj5a9liY59aQb1As8tScNx8G/TCkehcgdozYxEfidSljSbAUxK4MOU/zh6wYIG2qe1soXNb/oz3GmIkYjyqCC0gEteXSTQjAXKD+K7zMGPcIyKh4JQ3YU9qLbHmU3WcCaHvsKE4WmmTP75hqrcUClJVMMmoPhjyoUMnr65KryhwrkGrhUN29EhwLE0QedcXzibG0Zq0X0VSxjlID9rwCZ6G3tw0lSdv732jVixCpqgHTBnFnAPsIH0OBfJ8P8BxYqfq0eP/cEJ+lcAGXJV6qzHpk4aJPW0A3qHb4kwzXgvMrFeaHxr9BbTwUPmG4AGp2YGCVBURAGGg5qK1KBq1cWF+0CYVfq3KJR9DvX19XqXkk9jA83p6ZYBwoHsLjGGaZm/TOiIZ3ky0r9Xo4kjvbYw+0UYVHyNiKtBe7W0MXTg83P7zRu733V6Q9686dpK+Wd0ryt9GA5eDxTqPT9I4oeqXnLhXE80/PaDuh/Ts+MyQBoMg2Hik8GnjksXESN8Sgfo1zIC/AtTiZ2JkvYoWpzEZBwKxv/XYE+SZKB/fvkE9BRabOw8kzDG6LJ5yc4BTjoaa4KTNcQFGndPeTqQz8ZQ4gy8WA1W2Alohmrtr8mWcvgNGQ9y2IAoXxzdTZ2B717g7O2JOzmUfOpHpvk9VNsnhdmapSFxDFSoKtflwslm9gapWys+OoklvHKBMj705kDbwQ0Dwk678NbIM+cfOSRz3baHJCs79K9WdS5coOThKzfsJZfXlpkRRqaX3hAMpUFGLFFB2Zkg9hBFDyFM+q71U5ZXRC9bgUWCWfoQ5fXILiJnLKp8Ggc6w52Fq9qsrRHYWD4xc39SQbJ0iSzgfZsg+q1hj/E9qNGdpeON3E56ITb4Y0T+IuCNykZQ659AXb9s44Bf0II976ULeHqxJey3ZrI1mDUNaUp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0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1tptgMvo23cVzGIf6PLmLvcvlv64nFZhEiy6VMsrmmWeg41rqx1itqlD4l+j8E+vYfuHlrpgfVK6o+uQSDn99MhpD6QU5xyg/slMEc6IAZj1PY2wnmtyTrPARZTbBMNvVtKK5RSYw8aYfBYHJyJj+STwGXbEVAUD89wa+av7STQ9Mv7mjI/ZMlAFaCqV24Im8MlqM7szilP9FxW2M4QAnfpFoj/s9Saslc6t0nyUaTu51htbQ412l9y2ev9+a0Paj9JpxozhYkBC3liZOk3utqUR8JPir9xzccNyIIkZ8NjuOtk5Y6uy1ZFtPCgE6lsq2NpwxFSRZjZK2+joM7GYbi4vcL62VN5TJuB9NtwwN/mKXq1uRsFu56yFUj5w+3/OsKuC3pVNctshCXyoXU2DQOBTg44mCQ7jSjJ1NTzgtxn2cLA1wEpZ1rCWTJjtv6vDr5rwgwFIdB/8FlV8xQSZCSXMVhtxXK7cp0FzmfLQ7DycB0aSe73BQ9239xePxEjwM9US4CfYvA33D/uvx9ZGyrIOEfi3I8CA== X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dfee39f-f451-4f86-fb48-08dd2f2e1c10 X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 15:15:24.4419 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8ipdgmv3Tauljo9K5ev8j/i9UuJ3S3PnYzWcLmcoMapnIkg/NGQvN34uiAXlj9+Lpz4awQbnX92VZbabCZed0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR08MB10538 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 07 Jan 2025 15:15:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/16980 From: Stefan Herbrechtsmeier Add a basic test for the goh1_file function. Signed-off-by: Stefan Herbrechtsmeier --- lib/bb/tests/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/bb/tests/utils.py b/lib/bb/tests/utils.py index c363f62d7..48e61dfce 100644 --- a/lib/bb/tests/utils.py +++ b/lib/bb/tests/utils.py @@ -130,6 +130,14 @@ class Checksum(unittest.TestCase): checksum = bb.utils.sha256_file(f.name) self.assertEqual(checksum, "fcfbae8bf6b721dbb9d2dc6a9334a58f2031a9a9b302999243f99da4d7f12d0f") + def test_goh1(self): + import hashlib + with tempfile.NamedTemporaryFile() as f: + f.write(self.filler) + f.flush() + checksum = bb.utils.goh1_file(f.name) + self.assertEqual(checksum, "81191f04d4abf413e5badd234814e4202d9efa73e6f9437e9ddd6b8165b569ef") + class EditMetadataFile(unittest.TestCase): _origfile = """ # A comment