From patchwork Sat Mar 14 23:16:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1986 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773530271; bh=b+x4P6VsTsySO0tv9AGHuCberh3HzQjWX2d3CXVm/NE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=BT5eLOwtMHoFGfxJNchlKY8AoSubl333ITPdUHM62C0htEEql9PucqUDgTIhwVMwA DghbgSCVcOIgkrZas7qz+zLcN9buhExFGyskJShoXm10dO6O9rebdSzhTMwFkmDtGb 013AVHkCPiy3wr89R4dAkGJMl9mcyq28S5pkkBwl/6RMP9BTW1+EMiLqnYHkp0NAq/ GAfAUTu6vFEw9QyyAqksQCR25TxCWeJYlKjWMAdyze6bDtUyfJTpakmZ7AdJj6JiOm atYm88XiJwnBTamlzrwN82+2Kz4U74l/fcYXhDj+SNNHYAXv3N9G8AdtpHDO7k8TyN rvsnux/bXVGgA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F05866A03C for ; Sat, 14 Mar 2026 17:17:51 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ljpkTiiGrkf8 for ; Sat, 14 Mar 2026 17:17:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773530269; bh=b+x4P6VsTsySO0tv9AGHuCberh3HzQjWX2d3CXVm/NE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=SlC8xb+OmqZcFdgfgL5hdFALstlyVpEmW6uHNeXBZvfYIPgf4ijV+cRxtd4nB+L+A fR5IbxW2IuPE7id9frYbD+D6h8zgMEEJP0a0GXikNvIyoJQ7m8wH+lo1BptP2wyAo/ VqvPSyJJn05APsmkXR0p1/MPpfynQs8DQgAox3eBROw95TLwTqBJZ3e9cdLVHm7UjR MITQsW4TlcsQkwqX7+uS4DdIav5zG5V2+/HNdLetT0DXOdExsqfyTAiGYpM1Vn4Hpm T6CX8qFa3qEyasSFdyoBN0locCDLO0aNDOVzrkWfrk2PwtrhcUVwFS79ZWpbvmKB9H L+2NibHoWxoMQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D9D816A048 for ; Sat, 14 Mar 2026 17:17:49 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773530264; bh=O+l3jb0KEneZMRxYmCwnqSBOz7haYD5skz/mwT3yLmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=smN3aJ2QXRo2dd+8HGPMBo6EdW2qLZVnCYCoIdqZA6Dt0eMHKVkCMOcX6mP/8FFNg YCGzY8/Xk0W3yQZlGhZmH+i5E+UMGYVobTE648yo/4sFC6mNPHpDsZBCQGdfvWTHI1 rP/070ORZLZwZ+KX+5e+BHGut2VjmlnrywPcFnuvi7S75ugu46jnKK5OPWQB5jfKxO rrMjc4Wbo+1N3MOqt6o8A8lWuzpyyMVY/YzT9dapjEdYnqJJogQKmXXlcrQfygth+T mULpUSoLOh8ipTLdsEXp9BoVm8WWjJ/CSTobmgYUjHGbPm4oVPK0cjz4UpIGsyxJfV w+wp6yhtnkt7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2B30669ECF; Sat, 14 Mar 2026 17:17:44 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id bQpvHiZwXIkS; Sat, 14 Mar 2026 17:17:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773530261; bh=EFEvUERBjvebStUtIt813wFD5oasqwk+NKcCmO/E5Hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j8hd7fwW/nAeB16FrCJhkldY+MdAXxXsO9ONJaLgSnLJxlA+UkM+R5X9jFXDdEqco 5A3aZrEyX/5nJt6BkpJJ0FulIquv94JHaer74nQetMaBZayYlGrdOaHxQWwp1qy2zb vZNnO9uIwcm88IoyGgudFTrA5MCi3y5VHt8zqR2OEaxw7vYys1GKRZfrLrxfXkXyoU H7d/ALqB2Fea8/CoJbxGKsmFuHyxh9WKJjiRhHm9S6pPm2gjg4e8FMGM0guhCiSvZ/ Wp/nvCjmurRjqkZeUjHtz1TW+7q2Mtz7SyYyonl5S1cEb5dpXtih5cy8CtVjYxbBbs FfAq61iWG+Z2g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 63B756A031; Sat, 14 Mar 2026 17:17:41 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sat, 14 Mar 2026 17:16:03 -0600 Message-ID: <20260314231618.338113-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260314231618.338113-1-sjg@u-boot.org> References: <20260314231618.338113-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OHT2WOHUAKBF4T76HPITOOEHOJUZRZVK X-Message-ID-Hash: OHT2WOHUAKBF4T76HPITOOEHOJUZRZVK X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/19] test: py: Fix test_source breaking later tests List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The source command's ':' and '#' variants use the global image_load_addr variable, not the loadaddr env var. Prior tests (e.g. PXE) can change image_load_addr via load commands, causing test_source to look for the FIT at the wrong address. Fix this by explicitly setting loadaddr before loading the FIT, which triggers the env callback that synchronises image_load_addr. Also restore the control FDT and clean up loadaddr at the end so that later tests are not affected by the modified FDT pointer. Signed-off-by: Simon Glass --- test/py/tests/test_source.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/py/tests/test_source.py b/test/py/tests/test_source.py index 970d8c79869..4b9a12890c7 100644 --- a/test/py/tests/test_source.py +++ b/test/py/tests/test_source.py @@ -15,6 +15,12 @@ def test_source(ubman): its = os.path.join(ubman.config.source_dir, 'test/py/tests/source.its') fit = os.path.join(ubman.config.build_dir, 'source.itb') utils.run_and_log(ubman, (mkimage, '-f', its, fit)) + + # Set loadaddr to match CONFIG_SYS_LOAD_ADDR, in case a previous test + # (e.g. PXE) changed image_load_addr. The 'source :' and 'source #' + # variants use image_load_addr, which is synchronised via the loadaddr + # env-var callback. + ubman.run_command('setenv loadaddr 0') ubman.run_command(f'host load hostfs - $loadaddr {fit}') assert '2' in ubman.run_command('source') @@ -34,3 +40,7 @@ def test_source(ubman): ubman.run_command('fdt rm /images default') assert 'Fail' in ubman.run_command('source || echo Fail') assert 'Fail' in ubman.run_command('source \\# || echo Fail') + + # Restore the control FDT and clean up + ubman.run_command('fdt addr $fdtcontroladdr') + ubman.run_command('setenv loadaddr')