From patchwork Sun Apr 26 15:35:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4556 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B80C140CB4 for ; Sun, 26 Apr 2026 17:36:26 +0200 (CEST) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48a5775d647sf52066935e9.2 for ; Sun, 26 Apr 2026 08:36:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777217786; cv=pass; d=google.com; s=arc-20240605; b=MIQcuxeKQpqxMd2thake+dx4wIR9/0QO+UhBtXT8wvWEJGYA85NGgpCN0KBtf4W9P3 5Nq0NWXvD4b9dy7dQY8WmKPsnzYZ1dgyZuFU6txoWvFL2KgrO+BEIL7ZSm7w5tuZTQ3S Vl9xjBZCEMIRaN9eadNCt+4VQBAorH2g/tPqBtKNF7oVqOWen/HE2FddUSbaKNSl/G6A kMHI+x4Xbot/es30Z5alF8K08xtKNAX5klKUdiFrzpcYEz4Ot9NOsgHLchMZpSU8e5Is Y2Wi8sqCbz2ngd3PHdpg9tyXHRAHgQnx1Ajl3L2ugFtWwBLayHUlr9C068SH0ht0bi7f ia8A== 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=1ZKLJeeyqqzqPw1DIpZ1lVAkOFyJexNSveppYGj1hUU=; b=AS2p2tbPqLTYZ2TytS9t7sxXqj8LhcKtsqD3/rcSmSST2nC/No4XspTLZ/+q7V1gxT mK+vSt8tl6LVTFABKXU75yvO1iDp0PjfbCQdZuJacrSB9RyQlB/V46AL91YZbi6By5Vc t24krgWq7/iufKWRoMcVs8EpMTzFBrGq+zPHRrmdO3jZprzcz2lSSSC7DhcCj21b41Gv oBqtid0RrpWYKE/QMA8Br920gZj7Q87az3AieM5aayKQiGFUlCeAQC6CNDo9R1NG4+21 DTBXJUrqeTXCRIpYxsEOXixGj0ptE4zYCeudyQ7EqTPCaa3HIO06o7EsaLrm8KGChg1k gBMQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OJsNLVF0; 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=1777217786; x=1777822586; 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=RXIQXNUjDrV+gcanyHaknOiP51Xe09QW4HUlwo8FfIGcyuURiw72NOSL/cLJt88miY UdimmahA04DtCNp+gqLlzGdzH47nffvhaZBqGm39IgstA6iAl8V3ym3HYBlBqdw5Q0wW O6c9EXKoIrpXTfd8dcH67mRyIxX78RRZ+oQuA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777217786; x=1777822586; 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=dYCgymqR+Dk5QemT6yJKsoQE60vlMTeWeMviBjvog6pAIE0NDY+PmToAQ//ReE8gNm WMIzCuJsTDGu3L7V3UUMe9LmPBPsvW/+Ey4+BAQOt0GbkYnNyFvfEOmwFSqFJEab9+0b ezAT9U4vcLJeUnjaWMXMsgX8jbIz4f3KlBUElqj4cYI2AxE4u7htE8nZ5zNKDkbXjGf2 Y1ojl0yRbXeaCgYNJIq3IsWRVNbWiu/3HZDbo33+gF2ErShKNEm/bAaWiCgEptWPXa0c BdzMKMnBYVRA/LDaYrah13ZUVpDmW1yXDJRpOgbd4fmZd2+coiiJTi89olHaIjCup8DO oJCQ== X-Forwarded-Encrypted: i=2; AFNElJ8SMXdSQO5NPcIBalR0MtOQ6FGgeYzmfzVmthpixn+5ikobCCfdT9SevphvuRE3L6taE0PoSUNETLftuJPN@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzCexLb2QyIZDgFSTtpfrHU1YbTTL8LElan4zO+eBxuAscYj5g3 VW3urzX8ASnMNVAKnH0crqsEQspO2BJP0qiVlPYRlFSATjUFBtbE7t5b0G1mRLxQH+IbzA== X-Received: by 2002:a05:600c:1549:b0:48a:761:5808 with SMTP id 5b1f17b1804b1-48a07615c09mr372673905e9.0.1777217786284; Sun, 26 Apr 2026 08:36:26 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiIuniTScHrtFnYLwgXAw/bBMA6RqY5H7IzWAl6BlhWzzA==" Received: by 2002:a05:600c:3393:b0:488:9664:8b9e with SMTP id 5b1f17b1804b1-488f4d76891ls64857565e9.1.-pod-prod-02-eu; Sun, 26 Apr 2026 08:36:24 -0700 (PDT) X-Received: by 2002:a05:600c:888b:b0:480:1d0b:2d32 with SMTP id 5b1f17b1804b1-488fb74bccbmr464541655e9.12.1777217784476; Sun, 26 Apr 2026 08:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777217784; cv=none; d=google.com; s=arc-20240605; b=fb9AC5JDoli0GsT3+8syjhmvxdRxcfpfpp6iJGilhSY7nUM86XAefe2dqkUFA+y3Vx wUieZ/IEkKsUB9/py1d1uY7+Z2mEDZMYikIWBrha3hliVKQ6oij00NhTlwsxs4LMEhTN SBBkp2qRzcJi3gAHCMeMKA57nwpSgMVKMNwJ5DAXbWplwWWVO1bM4WWLePzdJarw0F2P oKgKIf+oRABMHQa15V9S3mPNBTK8+DCu8Rz4T14SgOQh0ul6kW1F/sYQZvwzek5l4Qwu cN1Nu5MBooH/1Q3e2N6ZoUTduXodEdKPu0oQsFnKp71YETbhTE+e9urahtOSLqBmyItG w7oQ== 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=QEiKkYWkRiTJ1DfE7JteN/L7faIWBKmZRL9o+ErV4VTOKi3UUgSCGzmmsyqpBsiVyw dI4j2K8aul2T2hVxXMI54OmApdHLRC2Gb5XlvbhaD7kfUmbpvqgpAV9NrsLLuZf/juh2 csaeVwie+jzOolgLi+3zJWYKaeIuQP+Pea2XPUb4wtcIbbFSxBXRc9kgTNbsBpVqr7lo LLhoom2+LZIYgzeFBcFSvCUVBMcA74JyHF/jqLuf9Tq5EKyDoCxWepy/YwH6woza2DBT N8abodZ6XECj6lsbXNDaK9Wmv/hhdrU41AR3Guj8aOupuzBNZwfFolkoqcAmxu7eY+yv AdNw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OJsNLVF0; 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-43fe4e10e17sor3302185f8f.12.2026.04.26.08.36.24 for (Google Transport Security); Sun, 26 Apr 2026 08:36:24 -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: AeBDieuMDm8JcASv1ZPC4x63SYWR70MKV73xUPxHlLbVFCvKtNt187r4JGOoqfVywUg nXuccFOEIgHrgOzs4ztk/qFEQ8sjxF8wJvBRcFsLKan6+QkfxwdCgskH0kqI9UGgwIhqJ+f5RcD jcEm8ar3GhoDw9Vp1KdpdngSOFPNVUXP5AOL99NKhyype3X1Wapwwt2qcmg3nT3juYdw0J0Ct+8 pYAzRcG2Z+n/jcrQsfe+I+174dpk6veUQ/koPavgUN/Z4zLQxNyizZPdcM0JLkVeczK6LDcIi94 Qi02386faj5KQBgfkTxeZqcLVoul/O6va4yKGJqnKXCZ8lEWMTVoyRWjPAtmw+zxDS+Irr0pCge dHv2nhJD3qZp9mhQJy1Z9SNbXLKzvAV8kyKPqd/ub+Akbn1BG/dD5UuZbvA1cgb7S6SEnAcP26t 5IJmgu1v0lxL32vRPKd4xF9NbcdwDSdUwQnLQIF8t24mUKxXr+ltBaRtcRyBgFDEsKLWSlZj02u w7jAINqfEAyAmXAjOvQ26mWV5dggRjXjakbW6HliV33JHLWx1SV8ej5JXMvBy8MJMIKds98Jnj7 qu40eyyFDaqs/GlCIFW+f/nKcI0Huw== X-Received: by 2002:a05:600c:a305:b0:48a:53cb:85f4 with SMTP id 5b1f17b1804b1-48a53cb8734mr287837415e9.24.1777217783633; Sun, 26 Apr 2026 08:36:23 -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-48a5499b0edsm388438845e9.14.2026.04.26.08.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 08:36:23 -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 v5 2/8] test: dm: part: add test for part_get_info_by_uuid Date: Sun, 26 Apr 2026 17:35:27 +0200 Message-ID: <20260426153617.2039651-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260426153617.2039651-1-dario.binacchi@amarulasolutions.com> References: <20260426153617.2039651-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=OJsNLVF0; 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);