From patchwork Wed Jul 24 06:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 814159 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2619946wro; Tue, 23 Jul 2024 23:12:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV4vwyyyTm6wYkB6Ur01vhWsQ2Uk14DRykn93qdKfo+GiH1cHaW8VI/3tizGai1DWfPC/prXh1UXKZTN9fwlcEM X-Google-Smtp-Source: AGHT+IGBILCs2W0y3t+TauB/4wLJmbkrC3SdHOqo1JAZLMXk6/mVmMLgcMGeqsb5B9g0rDc9EFup X-Received: by 2002:a05:6000:46:b0:368:4634:c419 with SMTP id ffacd0b85a97d-369f0a68b8emr960634f8f.58.1721801542416; Tue, 23 Jul 2024 23:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721801542; cv=none; d=google.com; s=arc-20160816; b=VXjYc6l9WN8Wta2Nc1siSYJx3WQpasegj4mIXWEs6PVTYz0AGg2mt65TenqdIoWlT0 dTBy1bgTx+73wrNmwbqRgOWbBRZ8LrzD2AQTdtDc+VKDmKyeGTpJiMG1C+3k3OQbETfm d6RA0ZnXw8kEr1WljIOEOA0U8s9zIuxTLsqiD7xFQFoTaco/aOS+IcLu9Bq02exrNZF9 lailDjnY9Zy35iSeCavjtXI8SaTIfXn1Rz6TzjkATA8VA+UVNcXz0carqzgjksNMl7Y0 zLcSbz3S2TiIP3qyRHGMzbgcs/oVe8pUO25JT1ikpAG+QK1GrSKaxmcvC+n67+0IYxpW ZKeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=OLDicswRez8kHUF5a6Y9nBjpA0ar0SSoBZP4qCwC8U8=; fh=eimiGswTlodK8yi2DcDfSicmKwvq5bxKQKpD+SkkTNY=; b=z4zvd4D/fAfql+wTgcsiYCEPXRmVNR6dtFmW/5Jdy7Z5OXiu38VyWpfkVueBYzgW+K MVGMo52Mq+FANJb2sj0EoPjGoEM+heqdjIw9u0wLqmQaIySb8j0T1tIyuX89VACubtIr Qm8o2NilrpuB8IZnGoqKJK4ASBaNZQiLnr96LtCpAYs7VfmzHuCze46qUv4qk+e6k+LB f/QXp5JdSQX+XKt3YBlvpHoVODEaNd7DzIRy+YwaiEeU3h+PfOo6chpn20WkaQanZW9z /KWPjX222x+Ovg58LoNefuqaVJx0YOpp7BHgOGMvcp4nmr8D8TPBJ5newix71QySyXRc juGQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id ffacd0b85a97d-369e3818f9dsi1348873f8f.558.2024.07.23.23.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 23:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ADC6F8897D; Wed, 24 Jul 2024 08:05:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C0F1788962; Wed, 24 Jul 2024 08:05:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 48D6088934 for ; Wed, 24 Jul 2024 08:05:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F843106F; Tue, 23 Jul 2024 23:06:10 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B0F2B3F766; Tue, 23 Jul 2024 23:05:39 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Mark Kettenis , Michal Simek , Patrick DELAUNAY , Patrice CHOTARD , Huan Wang , Angelo Dureghello , Daniel Schwierzeck , Thomas Chou , Rick Chen , Max Filippov , Sughosh Ganu Subject: [PATCH 35/40] test: lmb: run lmb tests only manually Date: Wed, 24 Jul 2024 11:32:19 +0530 Message-Id: <20240724060224.3071065-36-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240724060224.3071065-1-sughosh.ganu@linaro.org> References: <20240724060224.3071065-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The LMB code has been changed so that the memory reservations and allocations are now persistent and global. With this change, the design of the LMB tests needs to be changed accordingly. Mark the LMB tests to be run only manually. The tests won't be run as part of the unit test suite, but would be invoked through a separate test, and thus would not interfere with the running of the rest of the tests. Signed-off-by: Sughosh Ganu --- Changes since rfc: None test/lib/lmb.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/test/lib/lmb.c b/test/lib/lmb.c index aea84e7b1c..c869f58b42 100644 --- a/test/lib/lmb.c +++ b/test/lib/lmb.c @@ -200,7 +200,7 @@ static int test_multi_alloc_512mb_x2(struct unit_test_state *uts, } /* Create a memory region with one reserved region and allocate */ -static int lib_test_lmb_simple(struct unit_test_state *uts) +static int lib_test_lmb_simple_norun(struct unit_test_state *uts) { int ret; @@ -212,10 +212,10 @@ static int lib_test_lmb_simple(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 1.5GiB */ return test_multi_alloc_512mb(uts, 0xE0000000); } -LIB_TEST(lib_test_lmb_simple, 0); +LIB_TEST(lib_test_lmb_simple_norun, UT_TESTF_MANUAL); /* Create two memory regions with one reserved region and allocate */ -static int lib_test_lmb_simple_x2(struct unit_test_state *uts) +static int lib_test_lmb_simple_x2_norun(struct unit_test_state *uts) { int ret; @@ -227,7 +227,7 @@ static int lib_test_lmb_simple_x2(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 3.5GiB and 1 GiB */ return test_multi_alloc_512mb_x2(uts, 0xE0000000, 0x40000000); } -LIB_TEST(lib_test_lmb_simple_x2, 0); +LIB_TEST(lib_test_lmb_simple_x2_norun, UT_TESTF_MANUAL); /* Simulate 512 MiB RAM, allocate some blocks that fit/don't fit */ static int test_bigblock(struct unit_test_state *uts, const phys_addr_t ram) @@ -286,7 +286,7 @@ static int test_bigblock(struct unit_test_state *uts, const phys_addr_t ram) return 0; } -static int lib_test_lmb_big(struct unit_test_state *uts) +static int lib_test_lmb_big_norun(struct unit_test_state *uts) { int ret; @@ -298,7 +298,7 @@ static int lib_test_lmb_big(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 1.5GiB */ return test_bigblock(uts, 0xE0000000); } -LIB_TEST(lib_test_lmb_big, 0); +LIB_TEST(lib_test_lmb_big_norun, UT_TESTF_MANUAL); /* Simulate 512 MiB RAM, allocate a block without previous reservation */ static int test_noreserved(struct unit_test_state *uts, const phys_addr_t ram, @@ -368,7 +368,7 @@ static int test_noreserved(struct unit_test_state *uts, const phys_addr_t ram, return 0; } -static int lib_test_lmb_noreserved(struct unit_test_state *uts) +static int lib_test_lmb_noreserved_norun(struct unit_test_state *uts) { int ret; @@ -380,10 +380,9 @@ static int lib_test_lmb_noreserved(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 1.5GiB */ return test_noreserved(uts, 0xE0000000, 4, 1); } +LIB_TEST(lib_test_lmb_noreserved_norun, UT_TESTF_MANUAL); -LIB_TEST(lib_test_lmb_noreserved, 0); - -static int lib_test_lmb_unaligned_size(struct unit_test_state *uts) +static int lib_test_lmb_unaligned_size_norun(struct unit_test_state *uts) { int ret; @@ -395,13 +394,13 @@ static int lib_test_lmb_unaligned_size(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 1.5GiB */ return test_noreserved(uts, 0xE0000000, 5, 8); } -LIB_TEST(lib_test_lmb_unaligned_size, 0); +LIB_TEST(lib_test_lmb_unaligned_size_norun, UT_TESTF_MANUAL); /* * Simulate a RAM that starts at 0 and allocate down to address 0, which must * fail as '0' means failure for the lmb_alloc functions. */ -static int lib_test_lmb_at_0(struct unit_test_state *uts) +static int lib_test_lmb_at_0_norun(struct unit_test_state *uts) { const phys_addr_t ram = 0; const phys_size_t ram_size = 0x20000000; @@ -443,10 +442,10 @@ static int lib_test_lmb_at_0(struct unit_test_state *uts) return 0; } -LIB_TEST(lib_test_lmb_at_0, 0); +LIB_TEST(lib_test_lmb_at_0_norun, UT_TESTF_MANUAL); /* Check that calling lmb_reserve with overlapping regions fails. */ -static int lib_test_lmb_overlapping_reserve(struct unit_test_state *uts) +static int lib_test_lmb_overlapping_reserve_norun(struct unit_test_state *uts) { const phys_addr_t ram = 0x40000000; const phys_size_t ram_size = 0x20000000; @@ -498,7 +497,7 @@ static int lib_test_lmb_overlapping_reserve(struct unit_test_state *uts) return 0; } -LIB_TEST(lib_test_lmb_overlapping_reserve, 0); +LIB_TEST(lib_test_lmb_overlapping_reserve_norun, UT_TESTF_MANUAL); /* * Simulate 512 MiB RAM, reserve 3 blocks, allocate addresses in between. @@ -621,7 +620,7 @@ static int test_alloc_addr(struct unit_test_state *uts, const phys_addr_t ram) return 0; } -static int lib_test_lmb_alloc_addr(struct unit_test_state *uts) +static int lib_test_lmb_alloc_addr_norun(struct unit_test_state *uts) { int ret; @@ -633,7 +632,7 @@ static int lib_test_lmb_alloc_addr(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 1.5GiB */ return test_alloc_addr(uts, 0xE0000000); } -LIB_TEST(lib_test_lmb_alloc_addr, 0); +LIB_TEST(lib_test_lmb_alloc_addr_norun, UT_TESTF_MANUAL); /* Simulate 512 MiB RAM, reserve 3 blocks, check addresses in between */ static int test_get_unreserved_size(struct unit_test_state *uts, @@ -696,7 +695,7 @@ static int test_get_unreserved_size(struct unit_test_state *uts, return 0; } -static int lib_test_lmb_get_free_size(struct unit_test_state *uts) +static int lib_test_lmb_get_free_size_norun(struct unit_test_state *uts) { int ret; @@ -708,9 +707,9 @@ static int lib_test_lmb_get_free_size(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 1.5GiB */ return test_get_unreserved_size(uts, 0xE0000000); } -LIB_TEST(lib_test_lmb_get_free_size, 0); +LIB_TEST(lib_test_lmb_get_free_size_norun, UT_TESTF_MANUAL); -static int lib_test_lmb_flags(struct unit_test_state *uts) +static int lib_test_lmb_flags_norun(struct unit_test_state *uts) { struct lmb_region *mem, *used; struct alist *mem_lst, *used_lst; @@ -800,4 +799,4 @@ static int lib_test_lmb_flags(struct unit_test_state *uts) return 0; } -LIB_TEST(lib_test_lmb_flags, 0); +LIB_TEST(lib_test_lmb_flags_norun, UT_TESTF_MANUAL);