From patchwork Sun Apr 26 15:40:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4565 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 7BB703F36A for ; Sun, 26 Apr 2026 17:41:04 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48a5523fd53sf30505635e9.3 for ; Sun, 26 Apr 2026 08:41:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777218064; cv=pass; d=google.com; s=arc-20240605; b=B1pEuDZQOawRe82GynYDWUMq6nFPPFSYsGjXONV/hahwedUgPvCFErO/FAIXLcOxtD F4nfWnoRhxebOlBk/Dj0BOdhLY0Tpr/mkHR27rP2qkarFU0d+uJqSQnvYjYA2NajqOuR kik9VaFAabU3wVdxtSwNH/1bjbjjfj0C27O1MD9uuW5sJhpbOmlHDTqWzU+HJPYDZRx/ SGecKoTBxKdfMcK/zjTWcKTKt5TKPIOO+ckU5BdiZTWGiQz6f5E8FRNvnP86shf7upeR /Pfr4PO7E5OOHatG6Q+r8EUXPDTYwXEo8rfAuH/zm5DvTu1Z+bffpOAhsfH8fMxMu1h0 ECGw== 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=LqZiU4CCfu/BPkTAIvBDsRpZvwufxhM3alKg16baxhI=; fh=bNz/Sp8uLPzHyPEPqG6n6r7/LDxpF179YLrbGocuil0=; b=ERnubt7jwAsGbg/7PScuuTcyrVJ6UoMUinf/RY5Zjb3SLuoYFX+0voHKeHDTAARxEE KNXMr9c7zRILg/iyDvn0vC862yGPZMYq6KZeBPycYE2cmzVGBNJxaUjDlbnj++hHodkk T485506L1yEpgSpiWPa7Orklxoe0YdtwgcBzvhSjha6VbsGwSLvSK/yDOmjNE4O8gxKC DEO3xz1rgfJIweY5lNYrO+ti1DneSUhWhCz91eK2wo3fRChpGK8NTOpXH1+p01BXE1HZ PdvzdhA5nDL711Fm0yLuEG/7JJkgPEyhjGDb1eFaFlNCHyxdQU3WaJqnBrRT1WN5GgaO YdxQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=H2jq8qgV; 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=1777218064; x=1777822864; 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=LqZiU4CCfu/BPkTAIvBDsRpZvwufxhM3alKg16baxhI=; b=mdyCE2sr4ijoxukXvILg4oArtO9Ifh1HZA2TmEhjPWePU89+oSPfmm4fjvIVns+Fi5 lNJzlNaO0tI2ijYkRh8/gX72eI3w35+NVWBzk+x4TkRSauVsTe2As9t18MQLxInJ+IfW D3EAXFMHMtuxfAjbC3WEKUTDTLYmoEaMBjg/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777218064; x=1777822864; 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=LqZiU4CCfu/BPkTAIvBDsRpZvwufxhM3alKg16baxhI=; b=orBR58Q/fh2q46xK1aVtVBDk3HgXKVaHfzA5pF2fuAmgjrcSKcH/lYoTAvrujBcnTt EqFfI51bZJ4h8ZGASTy+1jfZoirc7TT195T2IDswheQ7qZKOiozt+wiWB5Bmbegd7iAn pxiyx/7VjZU7vQf4ixj4cPVUR4w5oly9J/19ZSaTws1Cj4H0dstADr7jwb/lOZT6hx20 I5k5c6nonVN8qNh/Viw3VS9d6f1x7zB4deA+ANR427BjA4t1dElEWi7W+AmhegOsjGqU FKem3342dzS22IynfIpXRfVAGUWioLqdTfcEY3vtcdJur/kH0NUB7+JhODitk99ZQGHQ ssbA== X-Forwarded-Encrypted: i=2; AFNElJ8tip9AkErFsMIXFCEM9AvQzhrWOAG62CrhNoIJgYmo3R8W1eH+pTfqDrUd6/jouhisj/VMmwkbMCwD6JJl@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx7oiuA1rAazX+1tpSR8NVDRDqZ0ijsytNQK9H8MI9Iz2hgzxMR dO88aFGUoH7bSEFqKnYzS1uCuUMneNoXRRrRh8uWnxwrfR5SLsf7t3Cp719lxN20B1rP0Skkxrk tQw== X-Received: by 2002:a05:600c:1da1:b0:488:79a3:f04c with SMTP id 5b1f17b1804b1-488fb7863femr586879585e9.27.1777218064111; Sun, 26 Apr 2026 08:41:04 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AUV6zMPrCJD1AuU5uqbzb0eHt1h9/bT90HHKETg3at0lwi9jlQ==" Received: by 2002:a05:6000:602:b0:43e:ad46:1485 with SMTP id ffacd0b85a97d-43eb1c569ecls7429389f8f.1.-pod-prod-06-eu; Sun, 26 Apr 2026 08:41:02 -0700 (PDT) X-Received: by 2002:a5d:5f89:0:b0:441:1cf9:4f06 with SMTP id ffacd0b85a97d-4411cf94f2cmr41754609f8f.31.1777218062384; Sun, 26 Apr 2026 08:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777218062; cv=none; d=google.com; s=arc-20240605; b=ANra89Fd9eyq3pTLrZakppR9lpxh2VDUyZOW6uRPugEayzsfRo/O0dNs40vle5ii0/ diKIU3SeLZy+KHcqARogA4foLJ82NeHdtqM/Y2wdsthEPT8jvZYJGEv2a4T3loT/ev7I e6zsPwxVW4ymTFc3x8KcQnrfLhsowLT7fvQsVRWgqOfDw702ymceVDzKuJDy43w3FNpv +vQ1sJU29Jn4x3oJSFmlv8zBKngiG4aVXngLcvjM74sGYoKUCS8+BCfTAGmVpfZz55g0 XGFAdA0+f4w9ijck7xVdT2H7o5N92ts2L/x6HuBT2xq+WYC5S+aqmeQZSQlIUPJWkgdH HWKA== 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=j7kw4CvLJkX2EjGaympe8ZZB0RtPYp/BO11dE+j3/IY=; fh=SMPGxW/KHFhQHxzd6fQZDt2aC0c5400YFwKZgkeAPhk=; b=EXouB2C2D/3sEvVv6bzp/KsQCTF3hUAnBAYlHvpHYeEymuuH6QETPtNRmqQafovUFs xVGGRxflYkNo+lSrVG6gQw0cHVfvE/A/9cF4mWhTY7POya8kH25q/di7KubFU0l/V6KW iXNi9ECU1dA/fgWmE98qEkhcvy6cPPz55SFaA2YBe8nFqrn6uTyU5MMf0x5pxn/yXfhO yyJ2kObMoLsFuTF/qzVNOnZG5LnPYKhUn7qscjLdpuGxxMYKwhB2iCsW4qiu4kPscwrF AWc7uoi1nKhIcEhC1valANwglKbyf8Iho7njoJ8DOhj1+hQMUknHn4Scx+LAmBgzTjse HRbw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=H2jq8qgV; 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-43fe4e1be60sor3422726f8f.17.2026.04.26.08.41.02 for (Google Transport Security); Sun, 26 Apr 2026 08:41:02 -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: AeBDietmdswPlFUs19KcP1DWHPwD/5SW0PZrKJRSB4rAHTc4qlcxMCMo5bFQBKSu6We UCHqXFBM/340BVbN/i2SO5yNhxrJws1gOuNgR/HpAMCP28uGcWU870JgRw57hAWGrZUM3MWip3F wxJi+0eEEqZKxuGWLxALeSUc52CtONdx/kMtK39y78Wyt+ad2g+RxF26pFTLRJ4WwuvR0/YNr+j VmVMUZjDpN+V3WuroG+lQeG2ILdogzCTlrKEdGYm2T55U7Rx/50/v9ywIwIunNBod1TX6YwrrmI gsQ1FsxZz4uespQ3X5KTRApLZQhxQHzGBmG6CvTsGQWVDtU2jNm+HnODF9U+u6a6zm1oL8WWk8F gk6La3MlJzrmrxY9iwqxjMqu3wNydUv9OLcuf6ciSNoiPK4brbNtDi1WpCRR5OEt7ILKpbzgQJA NDkBqgWqVJA31qo7vuGxU6N2w+GRpj4J2DrHK7HgKt5e8MiL8/yz24EE2WmY18W1lA9WHkFCmqc jSVSNqHKVYupIs4JrZqp/ZM1h8pANi6iHCuJdZTW4EIWAkXiKraMZlR3yHIXZc01CaUkS5b3WUB wVONgpPv6eWIbuFBglQBdm9erQLSCQ== X-Received: by 2002:a05:600c:6289:b0:488:f941:aab2 with SMTP id 5b1f17b1804b1-488fb78a561mr549098865e9.30.1777218061944; Sun, 26 Apr 2026 08:41:01 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com (host-82-56-22-134.retail.telecomitalia.it. [82.56.22.134]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4891bb3d121sm802593765e9.14.2026.04.26.08.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 08:41:01 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Simon Glass , Jerome Forissier , Mattijs Korpershoek , Tom Rini Subject: [PATCH v6 2/8] test: dm: part: add test for part_get_info_by_uuid Date: Sun, 26 Apr 2026 17:40:34 +0200 Message-ID: <20260426154054.2040932-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260426154054.2040932-1-dario.binacchi@amarulasolutions.com> References: <20260426154054.2040932-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=H2jq8qgV; 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 Reviewed-by: Simon Glass --- (no changes since v3) Changes in v3: - Add Reviewed-by tag of Simon Glass 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);