Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 224BA606A31A for ; Thu, 22 Oct 2026 13:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=VJ1UyqnQ; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eJtDjVIJ Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id EB6AB60A6E; Thu, 22 Oct 2026 13:31:05 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id OgNo0oQ3a-hE; Thu, 22 Oct 2026 13:31:05 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org E5463608BD Authentication-Results: smtp3.osuosl.org; arc=pass header.oldest-pass=0 smtp.remote-ip=140.211.166.142 ARC-Seal: i=2; d=osuosl.org; s=arc; a=rsa-sha256; cv=pass; t=1792675865; b=OE5hlus8LpQ0Ix+g4umLHPS88eXwvOeOru1cO59BRPLC42FQng4Psj2hxV1HgeSy8tCX 7yjuELXhUkM2msyLRxyi+M1XQ1I90u1+q10fk2M9pK9tADrGqGUgsQTvvf4w8rwjpyZ5W fbbipURBoiZrS5NBpwfRjY2Ij0VsiuW2QG5IEKW8WETlQAfQthqsF/MYHlCat6FoSOZ73 j0GsYVcpHdcENoag3WVg0djF05HQN2O1PmEpfrYRGQf37JlUgk7jKKvJmOW7IIaVASG/h wFV/xKo7rjrx15Z5FocLUEKTd3OOeZgkk+OqtAibiqe4vOUKH2SAvUaiWXhDm0oJ7fQ== ARC-Message-Signature: i=2; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1792675865; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key:X-BeenThere: X-Mailman-Version:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Errors-To; bh=E9LIGcH7tZS90jmGA0TY9WLSKW/+Q1SQ3z5yUmDXgVE=; b=mwx10+6mNrjArNO/Q9BSHxetgYuDJIqx3urs0fxZKG+DPYHSXLWtJzwZWBKyYwGfko9W GmhRiCxFkFy2TRw/yDUWvOMC0mKFGKLperl27knBcsFdE9yl/ds8RaCB5qTOIEaI6Gvs4 K+4QWMFnSpnTp2sFuaHUe00/p3QbLrFnSsNSOA5WpN5cj6PEVJBUaiEUV5Uo3JzJxq2m6 XXKGFgpjEGjTjR0IKHTimdroiOKfBaZsoerqqEQUipxk5eo1EOhTJsFkRHPRX/jhqV/+A gbonJwjMgaKhJDkAwalqQJO4G71tVi5u2OMz2ABGuKzHey0RpOZDoyYqwcyAj+ZeAbA== ARC-Authentication-Results: i=2; smtp3.osuosl.org; arc=pass header.oldest-pass=0 smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1792675865; bh=E9LIGcH7tZS90jmGA0TY9WLSKW/+Q1SQ3z5yUmDXgVE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VJ1UyqnQ7RD8vvP+IP1RJI/5ou5ir4523txGwQdEyruvgIHIw+oI1gQW2aH580Mq+ iLQNN2mnbEniU7hvFqbNzFl9vlqIzi3OvKBVtbFN+Hvv3+hkjTH3G0wXKttUq+tOW1 FDHgAJZBvPSnVBZPGZVup+rFzf2z7dT/XGdZfwcvhmjPIbRBw+DbKAkMTKOfDhDZXW b0wUofwF2L3TGHAoaoxH7B/U24g5I663D05wotekvdSkb254lpgZLrMqVzdKnvXFOU +ubn0QLbfdsRm5tZCQBwWTCArlBYioCdfCNc0kwEHDPkO7O1Ld5dcDG6JuCWHbUtev SIctTX/L7qRPQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id E5463608BD; Thu, 22 Oct 2026 13:31:04 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 472D72A8 for ; Thu, 22 Oct 2026 13:31:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2DC5F8121A for ; Thu, 22 Oct 2026 13:31:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jIGY8vbbV7F8 for ; Thu, 22 Oct 2026 13:31:02 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org 181AC81176 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1792675862; b=o84aHDaieyzwnz5PwyewCMEtJHJlr2023t8Y6FaCBuFcxlScPTg5RfY/0gBucPpe+35M Qdwtgbr24nlEZ0JdjwLSYWnESkf4PSutn2+7KcEmwcbcN8bsTGVsJpmH8VLMEngOE6X/F im5tpCtZs/qNvCYjo1O117W47DLckHHAXs/FbfdIBiSoLubquP3/40RnRENV/f6ngCcKe 05H/u0fhdhEXPKFacrf+Sj8P6a5j9YcJz26UEvUqljP4kCgFDpQBI5BrDMnHYKVSvXff2 6AVNxWnHnQr4fk2GUWqNzeiSTBsNZ2ItOX+AkDPXTWW1QMCT66KejmSa6xZ+lo6nL9w== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1792675862; h=Received-SPF:Received:Received:DKIM-Signature:From:Date:Subject: MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id: References:In-Reply-To:To:Cc:X-Mailer:X-Developer-Signature: X-Developer-Key; bh=E9LIGcH7tZS90jmGA0TY9WLSKW/+Q1SQ3z5yUmDXgVE=; b=Hvnsm8sJUGoxBK+k7IQ4aWcN8jPlB8OxR01RciTUBNSKBsg2FntQiHQayZZa/+vZiLRj lc4RrOiNllmPCqUcBdfuQEtdbL7CSYjGrWJQig04Ue7L+BXPrERTmLOuo8xEZPpuqXi76 BC89bDiH24ipztj2n5z4Nt3BlMz1m21s5/EAVc+UEj/hL7PrjmHsGOejsXa3WJO8rRP0s MhUt6ELO9COYMRwCZODzl3ezEDFeZpRPEzJ/m4d7Wz3icA0LeyzM42HLJpMDvB6/krfVg BL/kdnqDJWdwIL1G3GLWcka10kYB7gXvzQYxhVPIBAAeurcCDhS9b6QxN47eBWB6LGA== ARC-Authentication-Results: i=1; smtp1.osuosl.org; dmarc=pass header.from=kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eJtDjVIJ; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=mkorpershoek@kernel.org; receiver= Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eJtDjVIJ Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by smtp1.osuosl.org (Postfix) with ESMTPS id 181AC81176 for ; Thu, 22 Oct 2026 13:31:01 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id D88F160261; Thu, 22 Oct 2026 13:31:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CD131F000C1; Thu, 22 Oct 2026 13:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792675860; bh=E9LIGcH7tZS90jmGA0TY9WLSKW/+Q1SQ3z5yUmDXgVE=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=eJtDjVIJez7YBhvW6gFuxAI8FIP71dhAcoQkwBdokKIEfuqX0pK9lgBm6QmC+RhPI 5P1NTUKDv8jaRAZVDAC4RhKdQkSaSTrVlrnv5td1f9QLsLj/ZPl9nBYA1sTXUdqi7v WJhYqHJAjDC5058PqPew3mn38wpQwRAQZUkz/8gdtZoEIfql54VNY/UcT+s/RcqC/z WEcRFz9FfkGKlngic4XgtbVwezbkRmeOsKK1fKWYUPusCF4nX8sF2WKlINLz/Opodz 08KSdly5kH0bArINWRCPpQBkj5JDv+oX6U5l5HfWWtvePVRWS9jUr/Wk2x9/4tLs4L P+LLvliQT+Y/A== From: Mattijs Korpershoek Date: Thu, 22 Oct 2026 15:30:38 +0200 Subject: [PATCH v3 09/10] test/py: avb: Add sandbox AVB testing with dedicated mmc12 device X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261022-test-avb-fixes-v3-9-d3a6ff9ba097@kernel.org> References: <20261022-test-avb-fixes-v3-0-d3a6ff9ba097@kernel.org> In-Reply-To: <20261022-test-avb-fixes-v3-0-d3a6ff9ba097@kernel.org> To: Igor Opaniuk , u-boot@lists.u-boot-project.org Cc: Jan Kehren , Guillaume La Roque , Tom Rini , Simon Glass , Mattijs Korpershoek , Igor Opaniuk X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=10309; i=mkorpershoek@kernel.org; h=from:subject:message-id; bh=N51iToQ6/BQxQPhggj/GTmAcFCKVraCGGusjI4Rd538=; b=owEBbQGS/pANAwAKARkNHbRmThk1AcsmYgBq2g/9h416KyJiNQmko5VSWG6YWipf+XhD05D0Z 9ApcLroYayJATMEAAEKAB0WIQQu6UKnth9qvlMTrQAZDR20Zk4ZNQUCatoP/QAKCRAZDR20Zk4Z NYnLB/48RkMTdsVNe/cAge9V9PvYs+SrDtefAR8RiBnIc6gA2npPNCWcWhcJE0R1z4dKyQmnIBc WLOyOvlj27R2jKciWfO1Mk+JNV2dYvxvbYoBU7qXFtummgE0mB+Y9ZOE4nhlO48SW2egKXDVPem hspAXsjka82l2hoVx9Eg/ye60QkpQPcY8yH3TI0PVbsdHQBmtBEsN/lRi1C4UfeNd9iPcz3FyPT FkLmn1zEBcwIo7wYuAZKQJVQmkt4C7i+8s6qRC3/saiUYt7Vt/Oxs1P57ZBHmV4ZI3TU13LcVjn c9fknAvsxdGiSMA+Sggm0EV19Oa5NQF8SXT7OUxj8frnXBTp X-Developer-Key: i=mkorpershoek@kernel.org; a=openpgp; fpr=8234A35B45C0D26B31C1A2DA570338B018144F28 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Right now, sandbox runs the AVB tests using mmc1.img, which contains a fedora image. This does not really make sense. We should test on an mmc device which has a proper vbmeta partition instead. Add a new mmc12 in sandbox which contains all required partitions for proper AVB testing. Use the mmc12 device in the avb tests only when running in sandbox. The mmc12 DT node gets enabled by the avb_device_id fixture if CMD_BIND is available. Note: the vbmeta.img has been generated using: $ ./avbtool.py add_hash_footer \ --image boot.img \ --partition_name boot \ --partition_size 4194304 $ ./avbtool.py make_vbmeta_image \ --key test/data/testkey_rsa4096.pem \ --algorithm SHA256_RSA4096 \ --include_descriptors_from_image boot.img \ --padding_size 4096 --flags 1 \ --output vbmeta.img $ gzip -9 vbmeta.img $ xxd -p vbmeta.img.gz > vbmeta.img.gz.hex Reviewed-by: Guillaume La Roque Tested-by: Guillaume La Roque Tested-by: Igor Opaniuk Signed-off-by: Mattijs Korpershoek --- arch/sandbox/dts/test.dts | 8 +++ test/py/tests/test_android/android_image.py | 15 ++++++ test/py/tests/test_android/test_abootimg.py | 77 +++++++++++++++++++++++++++++ test/py/tests/test_android/test_avb.py | 31 +++++++++++- 4 files changed, 130 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 25c99ef81472..80f505083cd9 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -50,6 +50,7 @@ mmc9 = "/mmc9"; mmc10 = "/mmc10"; mmc11 = "/mmc11"; + mmc12 = "/mmc12"; pci0 = &pci0; pci1 = &pci1; pci2 = &pci2; @@ -1398,6 +1399,13 @@ filename = "mmc11.img"; }; + /* This is used for Android AVB tests */ + mmc12 { + status = "disabled"; + compatible = "sandbox,mmc"; + filename = "mmc12.img"; + }; + pch { compatible = "sandbox,pch"; }; diff --git a/test/py/tests/test_android/android_image.py b/test/py/tests/test_android/android_image.py index 79e2965f2309..dbfba8a403bb 100644 --- a/test/py/tests/test_android/android_image.py +++ b/test/py/tests/test_android/android_image.py @@ -95,7 +95,22 @@ def setup_android_v2_image(ubman): ] create_gpt_image(ubman, 8, required_parts, images) +def setup_android_avb_image(ubman): + """Create mmc12.img: boot image v2 with vbmeta.img.""" + + required_parts = [ + {'num': 1, 'label':'boot', 'size': '4M'}, + {'num': 2, 'label':'system', 'size': '4M'}, + {'num': 3, 'label':'vbmeta', 'size': '4M'}, + ] + images = [ + (1, 'boot.img', test_abootimg.img_hex), + (3, 'vbmeta.img', test_abootimg.vbmeta_img_hex), + ] + create_gpt_image(ubman, 12, required_parts, images) + def setup_android_image(ubman): """Create disk images with Android partitions.""" setup_android_v4_image(ubman) setup_android_v2_image(ubman) + setup_android_avb_image(ubman) diff --git a/test/py/tests/test_android/test_abootimg.py b/test/py/tests/test_android/test_abootimg.py index ff54a8318a12..a54e09bb09ba 100644 --- a/test/py/tests/test_android/test_abootimg.py +++ b/test/py/tests/test_android/test_abootimg.py @@ -49,6 +49,18 @@ using the same steps above : --pagesize 4096 --vendor_ramdisk ./ramdisk.img \ --header_version 4 --vendor_boot ./vboot.img \ +3- vbmeta.img + $ ./avbtool.py add_hash_footer \ + --image boot.img \ + --partition_name boot \ + --partition_size 4194304 + + $ ./avbtool.py make_vbmeta_image \ + --key test/data/testkey_rsa4096.pem \ + --algorithm SHA256_RSA4096 \ + --include_descriptors_from_image boot.img \ + --padding_size 4096 --flags 1 \ + --output vbmeta.img """ # boot.img.gz hex dump @@ -81,6 +93,71 @@ fae68747835d6dec42bc0df6d74d1fc5a0bfac6e89331797b9564926663a 000080fa912fcae854c55adbeb2769d4ab34c9ad4d16963f010000000000 a88d2fb468951800500000""" +vbmeta_img_hex = """ +1f8b0808f36fcf6a020376626d6574612e696d6700edd369301bea1a07f0 +7062dfb758521a55b4b650722807572d41ab2d5a6a4b90a225b64aad69c5 +d67063b968a9725b91632bb12fb11faa45c4762c8928557b7a6c557b0fee +ccd9e69e993b77eecc9db91feef87df9bfcfbcf3cefbe5f99b385cd10400 +006c803fb0ffe5d7e4f86500fc19e4cff9c775efaf01e4fe2d8701ff5aef +3f9d7ff9d323d413131888866869e8686802fef7025c122d02b16f9c05b1 +3fd89904c6054cb993631550b20e3d36f0fc97a5fab3e3ab1813c7059894 +3024ec1e6a4c412f9d71de37ebb3132b8f25858b29e0a98d19820724a8ad +11ef74e93b156edc57630f18b6788530b0de2f661a5f755bda6b28cc5367 +f41f67dc7c008db14b0f961539b149a94adc44317ab0f55f257d50addbb2 +6ca967eb2f0240832e33ad34f0165457652a752b30e1a9ea60bb64458785 +4d17bf22cc1fc07b777210d3f3e139b0377020d02b59ac2d84ccb5f3ac4a +eeb60e1322f9445a259a6b3c79f2a563e7e16a9c54886ac6323659f8ef85 +82e36fd1b7728f1d645495422df053249da0d2c58fe44b24a250cb8f7306 +faa26fb8231abdb6ce657cf416e183cb4a111de2a8363c1d8a61b5673f86 +01ef83ddc1059b3a370c8a23a5560bd9433d664dde352db09412cab2272f +5a145b363c347439a13b1ecc535e95f53ea79c401b48efa277065eb21467 +6f104b19d15d8f4790cce128dd673132db7edc29bb63b0899e25ab1778ce +f14622bd6d9ff0e486336968f432b3c107e9e0fa75044c19e8474936cfec +c85b0a1cad94ac579b390a995d312280a6d3b0dc2224da514ef5965f2749 +4733a4324d40ec6bb8b8c7ec2d0bbad1a8ffdbf3743231b1125be6ffe07d +bbf14e2e7c3c7cba09be7b0486e22b708b40cc39d88176eb190bcbb9905c +09cf1c8dbd282817c483f5b7f7b1cc6147f935fb65c5b7d42ad70b5cb49a +667f3d51fd70d38a5dcb017c8df917df58c27485c47fb846bf1781f27b3d +42ee795c827dfb6fdf007feb11e4bfdd61cfc0404cc5d6f032473f5cc44e +f49025bc09950a607ad7114cf1da446413f27b3fc1c875231c6ba6c5d629 +179c169fd52add2237fc48f17ee770a9b15ca6ade3094e1c001006dc9e04 +9219c0caf9d178f4638124c3aee451d1db2ccfbecf42081ae841991956cd +cbfa693d4815d0c2b921c6657fede06ed3854870fcf34486cff70a07c557 +df5b0bede94b55dc2a9138ae2297c3980664e5d6ca9551a8aece84ad2ada +59999ec559e947c1510f35ebaa136a6d5ebf7e03d291a12cf71c1ef08495 +6567fe6456310469ddc4894c29f0c3839bfc27a2dce1789043666397ca8b +aa6b6cfc9a8c4cfce65a00a15dd365b7a8721a873547a4a56722cc8e29b1 +5ceb11d40ead10cf3bf303ddad5d22b244eb8e63e547c45d1809417def08 +35daec737be2bb5fe95dbc36405923229b731364c6792a9e5e3718ea77ed +8bc0edd18aac4b7c19a35a2207bbec281519f511196f30c8a4ad6dcfe607 +eb45652b64f49d7965f5c53e6f413b3d90de57d04ff6c64b47ac0284a213 +23c2fce49b6b4a0500e7d42e5ba2c441d4b66b4cae141cc650e760918560 +1809522a81a6ccc4ba2d1c024739f89af56baccca1f01e0113e36c9c8d71 +677d4b10b258b7d2f29ca8b9c68e103e632e9eed4054485ce2fc6052ce7a +53b7645090c4a7f677e8b39eb5dbea20fc570739f3b28a4b0b88f4357b6f +44db1a7949f4b2405cdf8a1f5abd70bddbd9bb22399b2e80b6ead9e9ced0 +22f0ac6b334b751baca4f605ddcd7bb5d337208ec2ede1ea714a13548f03 +e86c0787a69db3e81940b11b0dabf1f6198164b069aa8198064c09d4eae6 +940ee4359aeec1cce4bb6283cb525ed79988accaa5fc2c1e9b713dce97d7 +0f867063b9d292672e8f58bb2051a5776779fbf928ced8377c4bedc704a1 +473aa9ecde18363435b41cebc30d3596295273af3d61a65044f901d1b49b +44d7bbc439e425afbebcf6095e31fc772ae6707eea95d8c324afe5a4bab4 +3db92585c26127dd880cfaa0e1d13c916f089d90eff5c5f59d350a19a0af +af42f06d80b6ecd75cf56c954957f49ebf4f75b7e2dbfd6bbb51a87d5764 +0950f2e1e72fdf7882136aaa3670120d63d73f04974fa900c7eae49bbd1c +1c570ee30b1e890956d25fdc5121c5c4a7f0e4fb76b64cee3c296f7be8c1 +b3946c1856b3a6095900c866af74f400c0f2d5a065131f8d55bdd645701d +a78256f019ab8150ebd06f53484904ebc86d7caf8490eee55d7f9cf4866b +89f720181421ff81aea5d92d3fade3f2a38caa91dbde272a476a63bf9546 +fefc76b1a5b4701eb078fb02a637100551b538af242d3ba2a6e5ef7cb180 +b3a8c684c6ab9cc593550ef70abf67fb7c8251a49e3fb43a87d98a9dcf9e +7c3cb6cf17646a581d958d9be8a74bb7a2f88e6c128f7dca29b49b8df76a +5d26e4147f467e9752ad8dadb562330ebe2d68dbeca174f869b17ee5f5d0 +40d6ab894ea47d3a996306b26ccb7479e6b3b6bd7ec52b488c2f48fc4cdf +ac3415b9231b7415cd8959add708fb88219272f2135e7e2e673c069c3a75 +ead4a953a7feeffd03523602d400100000 +""" + # Expected response for "abootimg dtb_dump" command dtb_dump_resp="""## DTB area contents (concat format): - DTB #0: diff --git a/test/py/tests/test_android/test_avb.py b/test/py/tests/test_android/test_avb.py index 34cddc485ebc..9104cf6f37a8 100644 --- a/test/py/tests/test_android/test_avb.py +++ b/test/py/tests/test_android/test_avb.py @@ -13,8 +13,11 @@ For configuration verification: - Corrupt boot partition and check for failure - Corrupt vbmeta partition and check for failure """ +import os import pytest +import shutil +from android_image import setup_android_avb_image temp_addr = 0x90000000 temp_addr2 = 0x90002000 @@ -22,10 +25,36 @@ temp_addr2 = 0x90002000 @pytest.fixture(scope='function') def avb_device_id(ubman): """Returns the device id number for AVB + + On sandbox, creates mmc12.img and binds the disabled mmc12 DT node. + On other boards, defaults to device 1. """ + if ubman.config.buildconfig.get('config_sandbox'): + if not ubman.config.buildconfig.get('config_cmd_bind'): + pytest.skip('CMD_BIND required for AVB on sandbox') + + required_host_tools = ['qemu-img', 'cgpt'] + for tool in required_host_tools: + if shutil.which(tool) is None: + pytest.skip(f'tool "{tool}" not in $PATH') + + mmc_dev = 0xc + fname = os.path.join(ubman.config.source_dir, f'mmc{mmc_dev}.img') + if not os.path.exists(fname): + setup_android_avb_image(ubman) + + response = ubman.run_command(f'bind /mmc{mmc_dev} mmc_sandbox') + assert response == '' + # Run mmc list to ensure that mmc_sandbox driver is probed + ubman.run_command('mmc list') + + yield mmc_dev + + ubman.run_command(f'unbind /mmc{mmc_dev}') + return # default mmc id - return 1 + yield 1 @pytest.mark.buildconfigspec('cmd_avb') @pytest.mark.buildconfigspec('cmd_mmc') -- 2.56.0