From nobody Tue Apr 7 04:14:08 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D39E3E024F for ; Mon, 16 Mar 2026 18:40:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773686452; cv=none; b=VsNZon2V+gPSK9ZINJl8wbs6LsTgJklQIPMj2orUAF2Nc6iarTdLFtT3h8qr4zwCUQscToA03RUBdh3vz5L1yoyBsxa0uqRtH3+kiHPRT1tumHtot+OgAVwrf4DXpWei2czkRgP3occGkd6yk1zKDZSoS3pfjm/AyJ0aXOYmSp8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773686452; c=relaxed/simple; bh=SZ/IL34NHcZwnXFZZbmcd3SNKWhqZaJwLFTc1LsZ++U=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=aNhZNTWO7AFCe5x8eI/PmYfIugOgqTfnU59dBh1HAnx6V3WDFURvXiBp+SubIkOe6x9WJXMolCQeluTdGUTYohgnFqoLqVgMMBNjaR8tmaqgK5mWtpKp6UYwoM3W5vUHSer3jqF/tI68z0eZAfDXhw7R+++waXoL3RQXbCfJ/tk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bdeYBarW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bdeYBarW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16FD0C2BCB5; Mon, 16 Mar 2026 18:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773686452; bh=SZ/IL34NHcZwnXFZZbmcd3SNKWhqZaJwLFTc1LsZ++U=; h=Date:From:To:Cc:Subject:References:From; b=bdeYBarWzXiifzf5386sT0QMhK++YxKQAFO/b0LUo5/FwPanyYhkuYymdfD+oed8B hV3kbHoG4O1MG3RVYJNkADdHx1oNf6ang6HSW0v4HlzYqLPXRPYGOsCi/ZC8TZ/wjy Wqd5Lj2l1dlb6cZZigFZAnXvi9eOHe1acEiTcEdsgiVl9yV1apGJ6tahT2hVwIH08k Cgixfraon2wXl5RQ0UfyOcA4mZHGQMIdl9ISNLLO5j20c3X/EnWU++e0ck9IuFbLwY 4enM7w5tCIO/xpfPEd6wBqPHRhrT+HFthlyeQPYt2LkLhlNGgKa25CMMSi8Qzjll6W JA5dR+CrC3QjQ== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1w2CsO-0000000853R-1YeV; Mon, 16 Mar 2026 14:41:16 -0400 Message-ID: <20260316184116.219854590@kernel.org> User-Agent: quilt/0.69 Date: Mon, 16 Mar 2026 14:40:37 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , =?UTF-8?q?Ricardo=20B.=20Marli=C3=A8re?= , John Hawley , Andrea Righi , Marcos Paulo de Souza , Matthieu Baerts , Fernando Fernandez Mancera , Pedro Falcato Subject: [for-next][PATCH 4/9] ktest: Honor empty per-test option overrides References: <20260316184033.927944169@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: =3D?UTF-8?q?Ricardo=3D20B=3D2E=3D20Marli=3DC3=3DA8re?=3D A per-test override can clear an inherited default option by assigning an empty value, but __set_test_option() still used option_defined() to decide whether a per-test key existed. That turned an empty per-test assignment back into "fall back to the default", so tests still could not clear inherited settings. For example: DEFAULTS (...) LOG_FILE =3D /tmp/ktest-empty-override.log CLEAR_LOG =3D 1 ADD_CONFIG =3D /tmp/.config TEST_START TEST_TYPE =3D build BUILD_TYPE =3D nobuild ADD_CONFIG =3D This would run the test with ADD_CONFIG[1] =3D /tmp/.config Fix by checking whether the per-test key exists before falling back. If it does exist but is empty, treat it as unset for that test and stop the fallback chain there. Cc: John Hawley Cc: Andrea Righi Cc: Marcos Paulo de Souza Cc: Matthieu Baerts Cc: Fernando Fernandez Mancera Cc: Pedro Falcato Link: https://patch.msgid.link/20260307-ktest-fixes-v1-4-565d412f4925@suse.= com Fixes: 22c37a9ac49d ("ktest: Allow tests to undefine default options") Signed-off-by: Ricardo B. Marli=C3=A8re Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index b8fcdabffffe..42bc505e14cb 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -4191,7 +4191,8 @@ sub __set_test_option { =20 my $option =3D "$name\[$i\]"; =20 - if (option_defined($option)) { + if (exists($opt{$option})) { + return undef if (!option_defined($option)); return $opt{$option}; } =20 @@ -4199,7 +4200,8 @@ sub __set_test_option { if ($i >=3D $test && $i < $test + $repeat_tests{$test}) { $option =3D "$name\[$test\]"; - if (option_defined($option)) { + if (exists($opt{$option})) { + return undef if (!option_defined($option)); return $opt{$option}; } } --=20 2.51.0