From patchwork Fri Mar 22 10:57:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 781849 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp1274875wrj; Fri, 22 Mar 2024 04:01:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXXwJgn+zjx5SrUjYNKjXDka8RGjTmv0ROqd1MQbylLnai4Ra+DmCDvJeF37HX1/MGWocjD1KXdLr4bi3BD/3P7 X-Google-Smtp-Source: AGHT+IHgUpBwxc9yrObBPmfC7mQMZzy8mQyfSU7c8L9NmrFnUQRRTcuF3jUXL9/HMKWPIBszKcZZ X-Received: by 2002:a05:600c:310c:b0:413:fff2:f40d with SMTP id g12-20020a05600c310c00b00413fff2f40dmr1357744wmo.31.1711105303165; Fri, 22 Mar 2024 04:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711105303; cv=none; d=google.com; s=arc-20160816; b=Ee5KJpg2ZKkTpQLL7oJjQKjN+94SI05yAbpR/PcIMBMbRG0n+BNbToGR6NT++qy7lg qF2iSJsV3ygPivCfJ2dkPkobwDcv8zzoBwFr56TLRvNWfDFimVIKNwHGVsDZtOaaR/BD rLwupkN4/G47OZW3lOexTfPF9UHPzzmpVIsUF3N8eNQI9AS8q4iLm559GXdV7nrgjfKx X+zA25pKevOZ/pLzzB5pTSt1Zbd+qa7HWn4j4Ozr5y+2oV40YN8Yn00v85VU83bmshws /q+NxbmI0u8Vq+6iPFprr/RDLeLg+hwZDQ0VDG4HP3wNZtJUNSjpSmjlpS+ZDJS2+ydR XQyQ== 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=45RHBIFWrIVnX3+9tlpDAuSCPhFT9RKQhGz6Gcox0/U=; fh=0OBOeNvG1YwOz62VjCAPxJsyowuZOMIwtNTktJXXBMY=; b=SrPIzbLuMMnSU0tf+WP0o9aRAhiHSXPyDZqanLwETqp0OdiT32ws7fEe0LpLz/d0bk J9hWARO5YNzZCCNWNT0v2M2BvfrwOMPQpbtpnt9Ea1DHkCj19OF0hAVuwZhUwgbfnVcR f0CakmEmuMVewdHeK0ge1cTxZNdSwCBeyfqhMI/BGKa8IghvkvFs63XziV2I5Fh4IjW/ ICG+BeC0Oec3bVVv1acSzJ0Vq7LqKuj/gfcPDSG1Zea+0Tn2aH09P9mu0b8ZdjF4BvaG Gpy78xCBIHf4AZ/J9SyS9JgCNqON7eZRoctwTGp4wybs/nmUGB71yFzvoaVcjD7yRlLD +WNQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id p4-20020a05600c204400b00414613df7e1si997407wmg.226.2024.03.22.04.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 04:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 23D41881D7; Fri, 22 Mar 2024 11:59:11 +0100 (CET) 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 D83FA8820F; Fri, 22 Mar 2024 11:59:09 +0100 (CET) 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,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 AD86F881C6 for ; Fri, 22 Mar 2024 11:59:07 +0100 (CET) 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 4EADB1063; Fri, 22 Mar 2024 03:59:41 -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 33F0F3F64C; Fri, 22 Mar 2024 03:59:03 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Yann GAUTIER , Etienne Carriere , Patrick DELAUNAY - foss , Michal Simek , Masahisa Kojima , Michal Simek , Sughosh Ganu Subject: [PATCH v3 17/20] test: fwu: make changes to the FWU metadata access test Date: Fri, 22 Mar 2024 16:27:30 +0530 Message-Id: <20240322105733.203888-18-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322105733.203888-1-sughosh.ganu@linaro.org> References: <20240322105733.203888-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 Make changes to the FWU metadata access tests corresponding to the changes in the FWU metadata access code. Signed-off-by: Sughosh Ganu --- Changes since V2: * Make changes to have the test work with v1 metadata. * Make changes to have the test work with updated logic in fwu code. test/dm/fwu_mdata.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/dm/fwu_mdata.c b/test/dm/fwu_mdata.c index 52018f610f..621ba647d9 100644 --- a/test/dm/fwu_mdata.c +++ b/test/dm/fwu_mdata.c @@ -93,6 +93,10 @@ static int dm_test_fwu_mdata_read(struct unit_test_state *uts) struct udevice *dev; struct fwu_mdata mdata = { 0 }; + ut_assertok(setup_blk_device(uts)); + ut_assertok(populate_mmc_disk_image(uts)); + ut_assertok(write_mmc_blk_device(uts)); + /* * Trigger lib/fwu_updates/fwu.c fwu_boottime_checks() * to populate g_dev global pointer in that library. @@ -100,9 +104,7 @@ static int dm_test_fwu_mdata_read(struct unit_test_state *uts) event_notify_null(EVT_MAIN_LOOP); ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev)); - ut_assertok(setup_blk_device(uts)); - ut_assertok(populate_mmc_disk_image(uts)); - ut_assertok(write_mmc_blk_device(uts)); + ut_assertok(fwu_init()); ut_assertok(fwu_get_mdata(&mdata)); @@ -118,18 +120,20 @@ static int dm_test_fwu_mdata_write(struct unit_test_state *uts) struct udevice *dev; struct fwu_mdata mdata = { 0 }; + ut_assertok(setup_blk_device(uts)); + ut_assertok(populate_mmc_disk_image(uts)); + ut_assertok(write_mmc_blk_device(uts)); + /* * Trigger lib/fwu_updates/fwu.c fwu_boottime_checks() * to populate g_dev global pointer in that library. */ event_notify_null(EVT_MAIN_LOOP); - ut_assertok(setup_blk_device(uts)); - ut_assertok(populate_mmc_disk_image(uts)); - ut_assertok(write_mmc_blk_device(uts)); ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev)); + ut_assertok(fwu_init()); ut_assertok(fwu_get_mdata(&mdata)); active_idx = (mdata.active_index + 1) % CONFIG_FWU_NUM_BANKS;