From patchwork Sat Apr 4 15:23:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4513 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E7FE13FAEE for ; Sat, 4 Apr 2026 17:26:58 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48895008a3esf11927585e9.3 for ; Sat, 04 Apr 2026 08:26:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1775316418; cv=pass; d=google.com; s=arc-20240605; b=PE2qN7gjgV7z/wjEQpWEP/v2RFuI/90fX10dpz+byEDE8i1vC/KUq3M8C0xtqEtj6b sPIkMKZfEMhJjV0uQhImhuuxV4miB0hRVXq6cPvelQ054amb/NDw85nh5Bg388Tr7Jrv l7Dwmb3vYCMEBAHNMDQpuMppZVf1SwSJHgUxwXyrMVygSjLm+5RV6Olc6j3Tb/wqgoAb nGS9Vqk+acM3nglAzlz8zoKdtLX7DBwmHNMtYc1hSmXG57oUaw8ZeNXAOnWBlalNGplR XNMwO3Tstg3/16K4DYRQY/DgakPOecIHGN7ER5TCJhzyWaZQZ113BSpPfWFs3dOBs3gB XkSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=NnnfPq2npo3CvyVMf+hD5zCajjxZTgs7Zm+W8CeSxuc=; fh=7X5lK+q/YbUlWIEkhNMW+/unYPXx/PQlfPEtwCQSHk4=; b=JImYEePefZqKkuOfEb4GE9v00Su/F0JRIF0V1E7hB6j/2aIH0oeY01Ysbmwa/bK0ne oCa/H5MBv3qphChm6M0nhgmR0v/VBNdfz0GpgiZ6kE3VpUL/D7lMjlnku1NaibinHuqa x+FlwYuY4hHl6+pmFQvsfEuVLeT10xf3pnpKi/tn99F2c+8H3G/QbUX+/7wt00p8cC7S aIRZOmftbd7UiShlIjnufQMJ+rLV5ICxS/t1CAekPT5KjG81gdwY0O2XWEN7d2N7uqza Bikv9DbGQ3s5ZRLpQntekv54qTzjY2TL/6myiC/Tic3PMiegLsAvwJAEOpZtEnwCneIf DRjw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bYvyE7tC; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1775316418; x=1775921218; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=NnnfPq2npo3CvyVMf+hD5zCajjxZTgs7Zm+W8CeSxuc=; b=rCZkucbcmsSSzD/8XHBLZeuHpIDSXPAS3CS2EtoN0HUIj3Tuu5TpOoZR5G7zAhBAAG 4Gvl+aYY9IACZGeew9iTk0zeqrloEqBfDGQHwhuEontJewRrM1VzG3DqnylfH5fRyIFr SzgNwdoLgx9EKi4d1s28y0A77Ohxdxe84oc/c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775316418; x=1775921218; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NnnfPq2npo3CvyVMf+hD5zCajjxZTgs7Zm+W8CeSxuc=; b=jsyMEMBfb0asxdRc+7Y1LwapWsSBytXJCLsIEd+vHskkAqOhSj8YjGul92W0LV+nGD i/8taX54ZvBx5SPLdi9Cf5IKHx4TJXHQDP8VynGEC3PmZ87SP2D1k1pyTPntcHZ7JACS fAU7uBfkYGwFnMp1PM+9F8Tb7o5PgqF/iz9R8zpwCmmpbtbIowfCIzswYF7jQcAfpjif PZAg4T8/C/I570jWWihU8pxgdIfCc4KtyJVKhOUu/DPQr22x43VFboBo9EAvHw1ShX5G aSw0rwm6gSgF0ZrZeUYL9m09Dw4toaxAP5DAC3SPh73FMOxwcik21Ml4P2OwZW/PKyCs DGzA== X-Forwarded-Encrypted: i=2; AJvYcCXzKR4s11LPeeN1z42jkgvysqRCeWb8eWO4HlPp+ieuACO9k0nWRK2rGtOj3XkpQpSn0kNSf/5zKD1Iic72@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyBKpFY8KSRhVzq4/CnsZYLdKkAPGVc1Ray733gSPVw4Ip0jEJg 577wi1vMY+C0uEMQEN4rH1aBe/kCprD4tarUDcCBtgKKGNlOX1/curwLx+PR3ZSPJPbOHzNBbyT Jvw== X-Received: by 2002:a05:600c:3f0a:b0:487:2439:b7c8 with SMTP id 5b1f17b1804b1-488996a206dmr114679205e9.1.1775316418518; Sat, 04 Apr 2026 08:26:58 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiIhI5bHLVM+DdcW7Av33mHshkVnUixyhcIz+ozcoUX2jQ==" Received: by 2002:a05:6000:15cb:b0:439:b886:20d8 with SMTP id ffacd0b85a97d-43d1f21d150ls1767214f8f.0.-pod-prod-08-eu; Sat, 04 Apr 2026 08:26:57 -0700 (PDT) X-Received: by 2002:a05:6000:2888:b0:43b:4f86:e985 with SMTP id ffacd0b85a97d-43d292d518bmr10346910f8f.33.1775316416717; Sat, 04 Apr 2026 08:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775316416; cv=none; d=google.com; s=arc-20240605; b=hukM20XeR/AO6/R+aZiNfKVS07BgLEX9dvNP3nq82OR2BD7KR+UKQdBKpxYeoIfg7g DaQ8vvquMTAAPMg4cgAJ8FQERT0CsAKe2e9LiEOxbAjfDqX2+4u/Pb6n5hXCcPn1jL2O 7Dh73RYUPINgSt4zkxDfXAchat+8bMKBpQO61gLjKr057/DjMFXE5mVc7f1Jp5nGK8Fo qrqZM+ObHliyUK0LuRXL4RnZXYM9ldvFoPWjYuvIcAHLhvFTs6S8eSzAvqFuqV7UNZe2 ztDEPyN/4U704VxjbrTAtdXxo6xiz+wlbMYtWKawJH6ICPicjv8Ww/nyBBcC6QG4zEdr uFVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7vsC278ki22hZLC0y+544VenywlCTyldgzB/WZ5r7Zg=; fh=QKtXhpPHPPJ3MOyesXaYZigeLLYT7FZESBZq59tDsd8=; b=eQDzjxB9FwUEtHee2Xo+Hp0ChPBeTAz4V1taOK5UTRRNgMSH48G20mFVqagfMmUcAL NkaFDdhKhL/9kH83UR7LBxilS1fRqV65ST9FfcWRau3qymAbFI7wHsEQoddRDWirtqdD 5TMxdZz1Ct9TJhROCMcrvIaBWVoLhSTtUXXq9Dum1siX69dVMKvBU99gbHxWxZP9lFLh N7eeY9LGEtAzx0D4URg2X+vx3FDDwk7CAe847IGJc9O8hH/wruRWTcnUEfrRNzHwLp06 +ONZkwLsaVzZ/iUI9DGJha6E0Y2JL4xaC9TS5Ny5aNK1LEDG+FUDZPirMbDRyM1jBcAf D+Ww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bYvyE7tC; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ffacd0b85a97d-43d1e4bd453sor813876f8f.10.2026.04.04.08.26.56 for (Google Transport Security); Sat, 04 Apr 2026 08:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Gm-Gg: AeBDietO9vd6gkcC11ylUYxCOtUAVoTgFTDTz8xfCnORrFohLdc6oKonR8auOYZKOXy jLaxE99xtb0HNie1cq6xZHnNB9JcCx98pzSbdrBX1nE7s1tJ5oC6Yl8EvJ+nszCMtclJYNuodrg xASWxbp7MQKXjoXZ+NhvYvq4BHmvMGK51kcakPOFbRZt2eSoQciNkyK6DTrMnnRjstthbPwHyA4 npTN+wooWK8kHiFEsdgEwY36Po6Fix1YbiBxyr5AFkb6+x8gmK+xNeaIv/2UduOQd+zIlskJ29P AuXrMtINdh75KM7XlpVQsLPLxZN0Gn8+rFfI84MsBL5crBE++LPbWB9pqbVjdU7N/PZp8/xRljf sWQe4CQZJa/9POi5ynR1jJUFroM+9OylAiVcrwo2WMPMr3uToEaK2cIrS2z/TM863kzGoz/ntH8 aUyRNZujBLTPflgQU/8P72nT57PmwxQn60xSoqL0kLDB3lD1bC+kvGGa9WzeUlWossGKx5KqEgI IThFSDPRrNIJBeO6OwA4aWWwqYfKT4ufYYpC1MmqLPv6fjuLbiT5DV9sCI8zl0iboCjLmyQaXgl RVREjdqLUtGoyZ75fGo+T9CY X-Received: by 2002:a05:6000:40ca:b0:43d:a58:b076 with SMTP id ffacd0b85a97d-43d292e89a7mr9641908f8f.44.1775316416188; Sat, 04 Apr 2026 08:26:56 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-87-9-100-184.retail.telecomitalia.it. [87.9.100.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4f1a99sm28059462f8f.32.2026.04.04.08.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Apr 2026 08:26:55 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Jerome Forissier , Mattijs Korpershoek , Simon Glass , Tom Rini Subject: [PATCH v2 2/7] test: dm: part: add test for part_get_info_by_uuid Date: Sat, 4 Apr 2026 17:23:29 +0200 Message-ID: <20260404152640.3297713-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260404152640.3297713-1-dario.binacchi@amarulasolutions.com> References: <20260404152640.3297713-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bYvyE7tC; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add a new unit test for the part_get_info_by_uuid() function. Signed-off-by: Dario Binacchi --- (no changes since v1) test/dm/part.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/test/dm/part.c b/test/dm/part.c index caae23bd4aad..ad37d7f406f4 100644 --- a/test/dm/part.c +++ b/test/dm/part.c @@ -195,3 +195,56 @@ static int dm_test_part_get_info_by_type(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_part_get_info_by_type, UTF_SCAN_PDATA | UTF_SCAN_FDT); + +static int dm_test_part_get_info_by_uuid(struct unit_test_state *uts) +{ + struct disk_partition parts[] = { + { + .start = 48, + .size = 1, + .name = "test1", + .uuid = "c5bce7a2-03f0-4d03-9048-01ff23b9d527", + }, + { + .start = 49, + .size = 1, + .name = "test2", + .uuid = "9df346e8-2c53-4cd8-b9ac-3af83f9a9b74", + }, + }; + char disk_guid[UUID_STR_LEN + 1] = + "8d60b397-1bb6-4d33-80ee-b1587d24c2f8"; + struct blk_desc *mmc_dev_desc; + struct disk_partition info; + int part, i; + + ut_asserteq(2, blk_get_device_by_str("mmc", "2", &mmc_dev_desc)); + + if (CONFIG_IS_ENABLED(RANDOM_UUID)) { + for (i = 0; i < ARRAY_SIZE(parts); i++) + gen_rand_uuid_str(parts[i].uuid, UUID_STR_FORMAT_STD); + + gen_rand_uuid_str(disk_guid, UUID_STR_FORMAT_STD); + } + + ut_assertok(gpt_restore(mmc_dev_desc, disk_guid, parts, + ARRAY_SIZE(parts))); + + for (i = 0; i < ARRAY_SIZE(parts); i++) { + part = part_get_info_by_uuid(mmc_dev_desc, parts[i].uuid, + &info); + + ut_asserteq(i + 1, part); + ut_asserteq_str(parts[i].name, info.name); + ut_asserteq(parts[i].start, info.start); + ut_asserteq(parts[i].size, info.size); + } + + part = part_get_info_by_uuid(mmc_dev_desc, + "00000000-0000-0000-0000-000000000000", + &info); + ut_assert(part < 0); + + return 0; +} +DM_TEST(dm_test_part_get_info_by_uuid, UTF_SCAN_PDATA | UTF_SCAN_FDT);