From patchwork Wed Apr 15 18:31: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: 4536 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1A1A53F2F2 for ; Wed, 15 Apr 2026 20:33:09 +0200 (CEST) Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-43d7b7bacddsf2398639f8f.0 for ; Wed, 15 Apr 2026 11:33:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1776277989; cv=pass; d=google.com; s=arc-20240605; b=NNx+dD1CYJ5PbKy6VM6bG5nKyCCz1ba4hOaEdi4rHcjg5gJlQ3CQh+fVslk/I6UNF8 ASw8FJQOWSpcTB3x0OUzJOvtN5rP8IaWkLyksn35WX6gzvw/a7J2iFljze4+SqACiITs +WIX7WaDvvPH0UjZz5VChAYzwi7qDOFJSfZ3i57IWGcZMwTkSOyJxLXrdVCu2+H7p1ZJ 1Fa3JQuC8RS/MdZH35AUZDYO+QFVLFNeEFe0J6jsqPVUDY1/OuArzyw5ZxmDSx8FoZVP Q5OR50J0dKQLhDW2F+XPnsjq2RlVNMBjTzErICE/+Cg7ErC5OkDGrMTwZ4vC//OIFSRl mLQg== 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=P2ts/Y3K46GPQ5qb56/cMPgBR0xfM8JhYn3/7G6Qovg=; fh=+LmAztGSMCCLv8GPfr1K+NQXqt8B4RYfVXvmU8RZGT8=; b=KnWG3qjOyA2CWoaHJdC8KJXhYBCpw7eDvw+ikGqvHQdm4BtlZxMpIEDjAyDNxi2wsh c1dOq7N+zSZg2Ixfqv+Y8f4mBILRCPMrYgqYD4Tq2WsmTBRyeFSz0BEj6Yu7jFZLrk6H iXLmE80Msc+AQDp2X8WerOphdzHQ4Smb+DP2cBrKx0Sn73th0f5ff+5ZV9WZ4TdoaCbK WKbVhm1EfaHmEMoUcaMkocATFkmL4YAWxHIDrYYoCdJzG/4hM9AS5qz5OLDErLA950dF YmrAavr5bEvXjrc9s8+GO6hGKyUM32ZdWuO1C6T2Ajm0bA8yEc+HU3h1G0u+v35imSEV rOhg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y9clb7JY; 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=1776277988; x=1776882788; 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=P2ts/Y3K46GPQ5qb56/cMPgBR0xfM8JhYn3/7G6Qovg=; b=TgWgM7KeKDNaJyFSN4709q3WoyIHihmNuskRXSU9oECVP/fFZr5sLWyn12Nz4zsVKW q+GGWzqMYD3SrLxbUGLm8j5cJ3cS6/DTwY5CbzACYH38+RkRXPFK5+7oVJ+uPI8YFlSL B3/NU0hCEH73q5xhXpYA5afYYSNZ1/4FO7BWw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776277988; x=1776882788; 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=P2ts/Y3K46GPQ5qb56/cMPgBR0xfM8JhYn3/7G6Qovg=; b=QIIH8PnEne2OTGk7fRruXLS9f7M2mLqaC8gSJy808taduKL+i7D2n5W61JzIxxUm4D ZHOjHMsxBMc8sREHO+KmCIbLDZdRe0HtiLvay2WjlXH+lsEb0MfgLmqYmkF9v8DSGO54 P0qpoakKlGiH9XmGKY5ZS18kZefCLGZj1kGJI4KeLhYKv75D9ifkNHfpY/ayIjHPu9WZ nuOhr4ugfvx0cC/bKzmbmqW4+uyHau4tnu0VX4GQn6KU2qgIRv7eDuIomve0pocpNKy0 Jhh4NsVx563GtMV7dAiwN4KM2AAt/IfKGZqhAWbA+iMl/KAueGBBrKRRxzrSpJRvz+dH m8fg== X-Forwarded-Encrypted: i=2; AFNElJ9gRN+QVlaTcDUrYJoCS7hc7PoY1AMHfAEI8FeTZsRDgd5R5xp4bsyvQMsQqfdWMW2araBYTzscepXut311@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwVBkhSConA7W4IG2+JE3VqJKu27+J6Ci+gJEk5ojJReyzv4qjD h30bppgDk/qb9d3IsaMasPpJDOIGlQhvA55mSz0Cuv1PA5wjZnYj3Zx34UJcn5DdwovCbDvLxS8 h4A== X-Received: by 2002:a05:600c:3f0a:b0:488:afb5:6a21 with SMTP id 5b1f17b1804b1-488d68764b0mr314186025e9.15.1776277988632; Wed, 15 Apr 2026 11:33:08 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiIXSZ509ruGIKGNW/XUABfaJ8TIzTfTZbZBuNGybtVBvQ==" Received: by 2002:a05:600c:5254:b0:483:7631:bef7 with SMTP id 5b1f17b1804b1-488f4b18c95ls604695e9.2.-pod-prod-08-eu; Wed, 15 Apr 2026 11:33:07 -0700 (PDT) X-Received: by 2002:a05:600c:5292:b0:486:fe39:28b7 with SMTP id 5b1f17b1804b1-488d67fa48emr329120295e9.9.1776277986816; Wed, 15 Apr 2026 11:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776277986; cv=none; d=google.com; s=arc-20240605; b=S1Ltk6Azzt0FG5+wiqpOPwJEdU7A0R3YOWKsZswxDNsv3K65oek8eGBZFcRYLJRxSa MAVHJJXU/Y1zvLrwEBT2hICG3pr2FPZk9QAPilP4nJCQNnC2zfKiLIcfMTxqXia9ABOE BVRO+BZ6GYNLGSA8tcGS7IMcgfGRZPgBMWF0FXEMkYMIfCd9L73Oeh96wYP131MtBR26 CWt2rJxyHLA3fs6/omll26Ea0ESTt0jlqWSEweqD/7uXOfPfmeYHM/U9k50BaYrORdVJ mzTCDOEF5bUwQVhgzN0KTv9yQLvzDqTTmT9YESH0+x9UAaEgiNKyzGpz7KLUSZc6C1Xc 4eMg== 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=4qwQtwx0F7OAHSpH2BRtevmG2YeLdtKDK5EN3GCzcuk=; fh=SMPGxW/KHFhQHxzd6fQZDt2aC0c5400YFwKZgkeAPhk=; b=c1pWmZp53aNgmG5hrA7HBcYOJkobWNP5rTXAJuT1uw6MAQhlVfFS0iR/nndvwsrtI5 SQ/rChOoSyP4+BZeR9h+AjQZARPYwiEqhT8TViak3iPFTSW/AiYbTQvB00RqtYhbcyBF hl9aMcsEUhuC5EOKxpG1QladwWa5QSekKAGdOMQlyeYBA5whhU28AJbWfxb6ZRB0PSRk CEJXmwZQui/v5L8wWuG2exO5yi81vldbobWzZCfZ9FNHRHvU0SQU9L1m7pH6M7/Syjuy clKFJtd/KQhadFJhL2Yx9kXM43fjLoZacCSRdkct2z8wCAK/vNCAk4+13U2yRVluy7u7 LyWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Y9clb7JY; 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 5b1f17b1804b1-488f208655dsor4686255e9.19.2026.04.15.11.33.06 for (Google Transport Security); Wed, 15 Apr 2026 11:33:06 -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: AeBDiev89D8tryyOlOqemv8RoCbbmRyWS3pegkLn7lJqzf0r4mpCDlbF/VGkLzNTtFb MG2gwfqMMPSENuOtgd2LCj64xHSE0jCfL3xe/WP4HKH+39cJQ56WEL8bDdt2DO+ZEEdFj4OceoF CawPohUCyw6/pOpoG7/pVXHdrZ8bSwzWBFMukHIHMEbQbwN2miEI2g3SK97plTO9KO8zhYbEbku aEwLreyIL0AIIN4PV4MIOOZjv2FPcUylXO2oRRXp8ItNhhTpm4mgjLS1GbfB1APHpkruHBBrNLE XEz6iIatb4UI9g/1HEjMJZNBPYeAX3H6zDy4hjHMe6IF4KCHlBjdKo7XNKR9S08WGevbZeckhQC PNDZBGW1DWzxHvYkeKsVKZqz3QIVnKaD0yPsroKTugr+Vsbbv8D4FxQMiNipPS7xqS51VjFvr6M TgyHaCGq9ECphCZjLAMIGxbWB0Mg+tADakN0Q+OuJY3STXyMkd1x01t879ZcZbeqwWqx60sGPjF eyMxoELV4cvxQBFaQDiK/fyev78KfYTTGyqA5rfYaohmA7XdbM3ZoPZzA== X-Received: by 2002:a05:600c:45cd:b0:488:a82f:bb96 with SMTP id 5b1f17b1804b1-488d68c7fc2mr298052595e9.29.1776277986317; Wed, 15 Apr 2026 11:33:06 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com ([2.196.40.93]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488f0e72980sm34953115e9.5.2026.04.15.11.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2026 11:33:05 -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 v3 2/7] test: dm: part: add test for part_get_info_by_uuid Date: Wed, 15 Apr 2026 20:31:29 +0200 Message-ID: <20260415183250.3031030-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260415183250.3031030-1-dario.binacchi@amarulasolutions.com> References: <20260415183250.3031030-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=Y9clb7JY; 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 --- 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);