From patchwork Mon Sep 22 18:00:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 387 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=1758564104; bh=JMoiWwNIJQ/CBa/GHuUOfh+PprxLmOQ2W+eRphVyLgc=; 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=lVpgsFJUg715/v5NZ6mm7kHrNXpBE0TtIEH+Cc6ddN+GiKIhIAIGCfyzIT0BlUbnM hDg091JQcuWXiTXJjojqHa0K+Uv2okt0zOI9zC/Ls3wlplQ3CwSZWGJqzalYlfKDug nOF/18hfFDfBSn5z7jl0BGMI7jK9yCV/7jrR5MYLv82U7yHZG10+DjARqdyWtMZJOi WNHtQ0sdFA0imSRClj68P852hXuSadEpzkYFFSgQ4MEGrSHLSj3O+Xc/MVFgsSH7Vz b1W6q9W/j4iID38kqaErF+ekX8jN9isJv32n8HnahxS3guyFu20YJul1QlIqCGV7Uk rZAYgM6UVjkWg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 381D167B38 for ; Mon, 22 Sep 2025 12:01: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 10024) with ESMTP id OTS4MO8PFhaV for ; Mon, 22 Sep 2025 12:01:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564103; bh=JMoiWwNIJQ/CBa/GHuUOfh+PprxLmOQ2W+eRphVyLgc=; 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=InSTn0jlRnb1guNI/4Pkapu5uvbymXpm7wXm2F77NB/o9dhSdJm9buTuj33srBa4v igFOhR6o7vHnj1G2jhgzMYxqmyblJpt+B5ofjhBmUbdEHfXugcO7jRgJGGOE9F3fw2 ebxjZo86D1lIMNju8s+olctyDcAoMVmuzWYIcPEwcg33INpGL6prbQ/xuG077A7u4S /C0BZ0T7td2WD1vT0ahBHgBEk5HerB/wc6VamIkfPpEEC5sk/IUwMnOvPgRaqDT4Nc 87MURfQexCGM7quIbwEQsKVCWBfK1Q3CAs8WqmS1knc+ZY9qw9IFPuCge9RqTcAmD8 qEHhd6Nt3PKgA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E0AD267BCF for ; Mon, 22 Sep 2025 12:01:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564101; bh=1bA0V1r//SHn++lpsNVj5RRw/2F0m+ZyYRyfG2vYwvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VI3zo6g6T7NfUi7r1WSDoK6wFtQA/M45oPIW3+v6bTmsvLjDtz3XgljttHIc+YdhR +1uNymrroyZHUvb3INP2aY80vo+aTn7iUSnlgjDQhHEy/vau9C9TX0iP2cy6McU1Cf VNPHpm8ncvNWw77Fs2v6wo/s0i+th+ZxGakUsqRyHuZnE3af0It72HHHx6APousXH9 xH+r2KjXpYdr6a/kXRr7jwRaEY/oPVbKwR9U7e+c9Zb84Q7XgPyTc6gI35JmvGqTyk W7Shnf898SYhmay2uUSTjx9wucpa0Zteqs2zWrcqV4JkXhRxD508OEq8dXV5IIBQZK XvP5JN2jan2Wg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E25FB67CA9; Mon, 22 Sep 2025 12:01:41 -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 n5_pNwx3MCep; Mon, 22 Sep 2025 12:01:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564098; bh=I3eJg9F1rI9Ikxdcv+W1mlM6JWlDEPpumfan4KPn+N0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRAhC3HqFVX97lp8MAv4z797Gp02XREWbo5C2SwFBTE/U8ri1eXruPGq+c1GdAwSz u4P2P2NmkpNELPpAzE0dKs/upu0WbsOEzbygQYoWU7qtbgB+obPxDfuMes6fYY4DHj QXzQqy5AiGxKCrfx/ySmx1YCDODCfseqLR4QIwv8qs2A621K3ZfWPEZUuEsQ1t2KFE STPrce+b1aGUMnuBeXxcdzIzIlT0U0LI/h7F4ynPpJeE56weF0+W8+Do1TLLrFpfOK LWRNDw60s4wM9xiwOC5ay3ryDqykMbe5/c0nMH+mCakx8i/cwiBOVHsMxUsgz/4fsg Ed44a0L+Acxhw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 80D2D67C60; Mon, 22 Sep 2025 12:01:38 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:47 -0600 Message-ID: <20250922180116.3088502-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BWS4ZAZWRGW6JVYD73DYW7LT2ZHRGH4C X-Message-ID-Hash: BWS4ZAZWRGW6JVYD73DYW7LT2ZHRGH4C 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/24] console: Restore old pager test-bypass value 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 test.py tests pass -P to sandbox to tell it to bypass the pager. Tests which change this value must restore it to the old value. Fix this, so that the -P setting remains in place across test runs. Signed-off-by: Simon Glass --- test/common/pager.c | 7 ++++--- test/test-main.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/common/pager.c b/test/common/pager.c index 1ec27c14527..53902ab29a3 100644 --- a/test/common/pager.c +++ b/test/common/pager.c @@ -403,12 +403,13 @@ static int pager_test_bypass_mode(struct unit_test_state *uts) struct pager *pag; const char *text = "This text should be returned directly"; const char *result; + bool was_bypassed; /* Init with small page length to ensure paging would normally occur */ ut_assertok(pager_init(&pag, 2, 1024)); /* Enable bypass mode */ - pager_set_test_bypass(pag, true); + was_bypassed = pager_set_test_bypass(pag, true); /* Post text - should get original string back directly */ result = pager_post(pag, true, text); @@ -418,8 +419,8 @@ static int pager_test_bypass_mode(struct unit_test_state *uts) result = pager_next(pag, true, 0); ut_assertnull(result); - /* Disable bypass mode */ - pager_set_test_bypass(pag, false); + /* Restore old bypass mode */ + pager_set_test_bypass(pag, was_bypassed); /* Now pager should work normally */ result = pager_post(pag, true, text); diff --git a/test/test-main.c b/test/test-main.c index 77d8a9f689d..b27f892140c 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -708,7 +708,7 @@ int ut_run_list(struct unit_test_state *uts, const char *category, const char *test_insert) { ; - bool has_dm_tests = false; + bool was_bypassed, has_dm_tests = false; ulong start_offset = 0; ulong test_offset = 0; int ret; @@ -748,10 +748,10 @@ int ut_run_list(struct unit_test_state *uts, const char *category, memcpy(uts->fdt_copy, gd->fdt_blob, uts->fdt_size); } uts->force_run = force_run; - pager_set_test_bypass(gd_pager(), true); + was_bypassed = pager_set_test_bypass(gd_pager(), true); ret = ut_run_tests(uts, prefix, tests, count, select_name, test_insert); - pager_set_test_bypass(gd_pager(), false); + pager_set_test_bypass(gd_pager(), was_bypassed); /* Best efforts only...ignore errors */ if (has_dm_tests)