From: Nicolas Schier <n.schier@fritz.com>
To: Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>,
Julian Braha <julianbraha@gmail.com>,
Pengpeng Hou <pengpeng@iscas.ac.cn>,
Ulf Magnusson <ulfalizer@gmail.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Nicolas Schier <n.schier@fritz.com>
Subject: [PATCH v2 1/4] kconfig: tests: Reset all KCONFIG_* env variables by default
Date: Tue, 29 Sep 2026 09:59:44 +0200 [thread overview]
Message-ID: <20260929-kconfig-tests-minor-updates-v2-1-c5902bee1d0c@fritz.com> (raw)
In-Reply-To: <20260929-kconfig-tests-minor-updates-v2-0-c5902bee1d0c@fritz.com>
Reset all environment variables with names starting with 'KCONFIG_' from
the user-provided environment.
This fixes the 'warn_changed_input' test on systems with
KCONFIG_WARN_CHANGED_INPUT=1 and ensures a cleaner test environment.
Fixes: 645323a7f4e5 ("kconfig: add optional warnings for changed input values")
Signed-off-by: Nicolas Schier <n.schier@fritz.com>
---
Changes in v2:
* Reset all KCONFIG_* env variables, not just
KCONFIG_WARN_CHANGED_INPUT (Julian, Nathan)
---
scripts/kconfig/tests/conftest.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/tests/conftest.py b/scripts/kconfig/tests/conftest.py
index 66f95e4ed58c..de8e555cd951 100644
--- a/scripts/kconfig/tests/conftest.py
+++ b/scripts/kconfig/tests/conftest.py
@@ -57,9 +57,12 @@ class Conf:
# Override 'srctree' environment to make the test as the top directory
extra_env['srctree'] = self._test_dir
- # Clear KCONFIG_DEFCONFIG_LIST to keep unit tests from being affected
- # by the user's environment.
- extra_env['KCONFIG_DEFCONFIG_LIST'] = ''
+ # Clear all KCONFIG_* environment variables
+ env = {
+ varname: os.environ[varname]
+ for varname in os.environ.keys()
+ if not varname.startswith("KCONFIG_")
+ }
# Run Kconfig in a temporary directory.
# This directory is automatically removed when done.
@@ -75,7 +78,7 @@ class Conf:
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=temp_dir,
- env=dict(os.environ, **extra_env))
+ env=dict(env, **extra_env))
# If input key sequence is given, feed it to stdin.
if in_keys:
--
2.55.0
next prev parent reply other threads:[~2026-09-29 8:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 7:59 [PATCH v2 0/4] kconfig: tests: Minor fixes and cleanups for warn_changed_input Nicolas Schier
2026-09-29 7:59 ` Nicolas Schier [this message]
2026-09-29 21:14 ` [PATCH v2 1/4] kconfig: tests: Reset all KCONFIG_* env variables by default Julian Braha
2026-09-29 7:59 ` [PATCH v2 2/4] kconfig: tests: Provide defconfig outfile for savedefconfig Nicolas Schier
2026-09-29 7:59 ` [PATCH v2 3/4] kconfig: tests: warn_changed_input: Simplify by reusing the extra env Nicolas Schier
2026-09-29 7:59 ` [PATCH v2 4/4] kconfig: tests: {old,save}defconfig: Forward dynamic keyword arguments Nicolas Schier
2026-09-30 13:47 ` [PATCH v2 0/4] kconfig: tests: Minor fixes and cleanups for warn_changed_input Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260929-kconfig-tests-minor-updates-v2-1-c5902bee1d0c@fritz.com \
--to=n.schier@fritz.com \
--cc=julianbraha@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=pengpeng@iscas.ac.cn \
--cc=ulfalizer@gmail.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®