From patchwork Sun Apr 26 15:46:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4574 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 4482A3F206 for ; Sun, 26 Apr 2026 17:47:34 +0200 (CEST) Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-4440c5944fbsf292812f8f.2 for ; Sun, 26 Apr 2026 08:47:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777218454; cv=pass; d=google.com; s=arc-20240605; b=HBGbyIi3+LuI0DtWLyz3Kvrba90OO4ZUvyNF3ZUXVVvJ2m+7aEfgtcpMmjJVI7qQRY XNtLItT4GXzCZXfetBkRKNLXmEyYr+uq5BKILyQvSL6X0Gz5AOB9bMsvblJC4Zay3VyJ qBq/V0UGUzfslMDb567WyauMYckKG5hzLMgyJH2J7hj67VfPEzpWrj0KdARdAYc870xl Hgkbx2GRn21hNUlp+DuP0Mcf4EY0hLa8JVaZbIMwkVEN5d35Gi65etr/+EcwAYE8XQxL lFHJs2LZ9spDH61SpVZuEVebVaO76w0CfJ5SjD17SDJJG4JzJU43qdOo1LLey6cgc4Te Ht0Q== 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=7wVwrMIacPe5/fwKmM+OEX4MlotKEk20JsygJUdvync=; b=jfpwJgDFETrMpowv1T2P5AJ6cgfX2jaV9GYYCuvSKB90P0v72crh9P+Y/npvxk4P2u UbZQkmb0fuBPNT8xY8tjxxn/dg7Rp9Mqx6VOmcYrseBr3QY0XP7yx4yzQ0TjVdQbYy4t NzPGouyJFRtcq3O+2+w9xO+HGji17+I9ZzHFNermbP+LyHxFX9OsmS8wjS4FCwit7JPD FQnuLYmkUyn02Yo9U5/uLXs8C6qg6ho4+/wRRZv9m/XeVdBlw/n5de2P9tpqJi9rjtcq H1Pm2lJbIwbw3Sd2Z9gOkhbeCS3sGnvEAcqIN7fOHu83RlWUzo+VcyANtOtNiVt7swHM caEA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="A6/WH9nC"; 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=1777218454; x=1777823254; 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=ZYvWe8SjzlSgobdg/uVQTDrwvtsqCGkSBTK5SfwnJwbWrbXR8tOgra68Zi8N0+ut69 rRpJkscOWJ8HyZEpUSU9xKCequZaDxVii45vrZcMpuYCWbM0nLxj9KVLJ1Azd/LEm/L4 4U3xzu0oRx6kj8ZdhmuMpV1lZZhoFMvdfSix0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777218454; x=1777823254; 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=Z9f96HZ4+SAJPcMliTvue84qIXCN/1f3FDZI8GXHGuUlFKQSXNPa3NU+fGjHgfI7z/ k7xJFTWcEAsUdHx6Ut5dmsy+Haw2B2x9RN5ny2Mjhjj9ir2E6hs2zHc0Zsku03IN4zxD O/2e5LNoggCnqMdFtcaWAqUhvLC2PYCYGSJMejGgKVCbwm+qmdMJG2sLa3nBmlq3baDI AQ/9EF2I7jakqxdN7NEfCxXdn1fLkSOR9iD1qkEpyX4x4d9gVcSJZHPdmRdsYq+Tqj7g Uuz4ci/UltR9wWa+cf+m7kESD4S7Dk1wuz4rZyA8GorlybYCkMu2JozmOQbRUSbsfHNL h/xA== X-Forwarded-Encrypted: i=2; AFNElJ9cJzR7xdmtCFWcW9rgiKtXhuzYHvXAXqE1urKOIQ3zq4dcxyJVcWyGvfLQgmNqN7MlsbM0gi59MlOj08pZ@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyziBP8MJQJvXnJE50/GnYeMJ5CSH/CUGQuYNpoBxjFdDJsKgDB TvwgofBj6B80wvwGujVx2r1M4iFtbB1nncTcLcTU58DmLxEv13KZunWmOEugv+qgQHHR1w== X-Received: by 2002:a05:600c:8183:b0:488:b187:d898 with SMTP id 5b1f17b1804b1-488fb771445mr475064995e9.14.1777218453848; Sun, 26 Apr 2026 08:47:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiK9+dofB+a3hrMwkJJpbVfvhtwNIEzpGiI/Sg7flaW1gw==" Received: by 2002:a05:600c:548f:b0:488:ab54:fc08 with SMTP id 5b1f17b1804b1-488f4a77b0fls112249495e9.0.-pod-prod-02-eu; Sun, 26 Apr 2026 08:47:32 -0700 (PDT) X-Received: by 2002:a05:6000:18a3:b0:439:b8b2:fabc with SMTP id ffacd0b85a97d-43fe3dd4b7dmr61664222f8f.21.1777218452194; Sun, 26 Apr 2026 08:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777218452; cv=none; d=google.com; s=arc-20240605; b=glhZlz1Sq4HorYiLZgPBgaP6ixkc3OB7kL0NceBdv2pydy+vY1O4o0/Cj7tsGNwTTq cqahnaQzE3YAhCPHppvSkJTt6t3NvnsVFejs45JKJ36U6Kq6CBMCfAOihzIIHcn1d4y/ b5dD773mWCRO6jcbXUD+/9K0M6aKOjclKW1CY86AoeiUygBF1dBY2aQ+0LacwBkvpfpd N/jjbKKx9j6k5nVyJbX3apBV7+EiX99cxCwxtT0APYz4vd7WfT/GlCePS4MCPOtaf5/z 15m8gemS41tKseubVzah2czWi1AKVqBRL6llIMElItN+/9REztRJjQZpjiFHdpv37IcB OasQ== 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=hjpJPwpvOeA9ueXp9JAl0ltnSCoOdBlR51a10Sfx5oet1g2IhyCUc6zbwmptNY+rNm /fFS/ptzd+E/wXMCskksjBnEaPTcMQrrJStWyC1XqefYnTlWaaTnrfJDFM77WH9e3jvy MmqK0yyb02+V3fB45xCkRGpTgDbcKaF3wS7z0BHZPeJBhgEO6u04W8kUSl01NRvvHRVM 3nlcx0OGojOhG1g/ynd+Sc+iGhM6FhqIxIStLFEp7SqHnIxQv3u4jPXoQMtMpi2+m2dY rsSgsAiOlGRD6eNcIFkTJk4qqWFN4IdfhLPfthVXTbIpoogTpx8ByaJYQf+BisPf9Bvr rioA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="A6/WH9nC"; 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-43fe4e10c32sor3810971f8f.10.2026.04.26.08.47.32 for (Google Transport Security); Sun, 26 Apr 2026 08:47:32 -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: AeBDievNaZaPeXoixTsLY/2WF27YByMHZ8cdTRc0EJGjbYoF+MXdUux8ToQEXnyWlPf 5m6DhBQaXawl8B+3LcPIqjeDlK/r4pvtt6/hxQt6tH2inhSR9r3gZ/KT5W0JCdyqvTTbNuzWsj9 M8WC0NivEy3QL/wq/YP8YbuWz96PX8nXYtwQYsUI+wSjdNCvlboEMS+ZOGhNP0GI5lEBPxz5rJ/ hxe0/EbWxm2QqtlZWNSRkdvgraRqE24udcyvURSUieiCtM2OnHm/Yk684tb1rKvjUdVpCL2h+4K phpWsfBrGt92GLuV3twkitypWkY9WstFsBHwUnzHwANM/zdawmRFAlVBVTxFSiu1cWpR+G8jiWw WUa8/MeBdPMDz+rZkdTJvdxx0zkPx/UZjserq4L7fp+fRB2/vLkxtFhtvrWPJpjNg1zztXs4L6i 7v0aGA5aQtEZtkAgVDdrY4vLnm/QhMzHsdU6av8ZlPoD5vQgg4aGQ3bOuaTEVeGHXzCHzxaA9lJ QSoPlESffwrvGoXAlC7kQRiLXvS4DrmdqRulSfZwQe9jYkpvJxWjUzussainJC/OaIImZVvT+w1 8NgXk069OP2vA4NCRzjrxbONbksKGw== X-Received: by 2002:a05:6000:2508:b0:43d:7e6f:3816 with SMTP id ffacd0b85a97d-43fe3e14ecbmr59468933f8f.40.1777218451696; Sun, 26 Apr 2026 08:47:31 -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 ffacd0b85a97d-44123d23e0bsm34489985f8f.15.2026.04.26.08.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 08:47:31 -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 v7 2/8] test: dm: part: add test for part_get_info_by_uuid Date: Sun, 26 Apr 2026 17:46:55 +0200 Message-ID: <20260426154724.2042569-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260426154724.2042569-1-dario.binacchi@amarulasolutions.com> References: <20260426154724.2042569-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="A6/WH9nC"; 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);