From nobody Sun Feb 8 20:33:28 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 26CEF1A9FA0; Tue, 30 Dec 2025 12:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767099409; cv=none; b=L9h5bLSrNAkzi06qzoUWtycEReXE5kvoRxV3MGas5hhdE5DSMYhLi0Mycd/T2eVGlL3FTWoAE3ozI4yY7KXrJaWSRvi9g3UHw+gONBZe3znkcvrfaDlbUqQCoCJ9ElJuSNX/8z/KzUCNi9MLg4G2+vPgiBvE9C1lkzQYOy1nezE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767099409; c=relaxed/simple; bh=Giig3OHwXW2aMIFZvh9rP0L5qDGtG0XatO4vAB8tazs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WmeVSzlDvr/rc3K1Tc+4j0EBPuAsMv2agxN8AC452KIkKmvFI/f6SDQv9J5EG+omKdfJbFuZzDLCeA9ik50HmzHWobuiGtU6O29JHv39keAAndNNycJU00mSP3wstLsi8dSS2JIzKGncW5RJ/e9ekZrjlbhXYw5lbxBvTVTTg0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wbHe/nwh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=fMdWFEQt; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wbHe/nwh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fMdWFEQt" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1767099405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oN0tu8yRKUnPSbTz4wcXkb24pPTPrrY9IQQPWNTdpKo=; b=wbHe/nwhhrWB5uQqL53/hyyEA1Q05VbXtm+xXaTssqW41/cO0Mr3p4EmH7XBZD/dEF+tJE jn2Jbdr+gm0xhBWmiVcSNfp5AJZomxZZfDZsrvGhtxUuNzLtjk6hH9aluiKkF4co/3KAxT /hWDtxGWs685+FNtZObTH+BrJCilpTA95y/kxBP8kQ7uCkomUUoxvc92x9mrqcHK7wvqaJ OAUQErIv7GlSmV/niArZNTi7K1zzqXzLFx5q751HSBWxKsQYx0/RShJaTa0TOTaxSrw0qy Y2owM7kCtv8+IkfybDdudNWXSoy+Do4+49asssjgnOd1BZcnqKt6VaDdIJm5bA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1767099405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oN0tu8yRKUnPSbTz4wcXkb24pPTPrrY9IQQPWNTdpKo=; b=fMdWFEQt737FrSu0Vv0QUI5+6ctDFKNf3lAJ7wdexPwjCU0GTq29X8YLWLQQPhLHtTiexM HEu7EZ1zEcibv+BQ== Date: Tue, 30 Dec 2025 13:56:43 +0100 Subject: [PATCH 2/2] kunit: tool: test: Don't rely on implicit working directory change 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 Message-Id: <20251230-kunit-pytest-v1-2-e2dae0dae200@linutronix.de> References: <20251230-kunit-pytest-v1-0-e2dae0dae200@linutronix.de> In-Reply-To: <20251230-kunit-pytest-v1-0-e2dae0dae200@linutronix.de> To: Brendan Higgins , David Gow , Rae Moar Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1767099404; l=1941; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Giig3OHwXW2aMIFZvh9rP0L5qDGtG0XatO4vAB8tazs=; b=84cugWk6oLY3xF+RSfe5ulAIR9oiDc7y7y3V+mURfNdL/XSmLy7LZup5m44B6lLZLBFU7l1yQ LulbVXlj1oBBufEr9xVs4bLMIQbnxaXKHJOpW1aHs4tEM2YnLjsRRgm X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If no kunitconfig_paths are passed to LinuxSourceTree() it falls back to DEFAULT_KUNITCONFIG_PATH. This resolution only works when the current working directory is the root of the source tree. This works by chance when running the full testsuite through the default unittest runner, as some tests will change the current working directory as a side-effect of 'kunit.main()'. When running a single testcase or using pytest, which resets the working directory for each test, this assumption breaks. Explicitly specify an empty kunitconfig for the affected tests. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: David Gow --- tools/testing/kunit/kunit_tool_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/k= unit_tool_test.py index fd7ca89596c0..584275ce6ba6 100755 --- a/tools/testing/kunit/kunit_tool_test.py +++ b/tools/testing/kunit/kunit_tool_test.py @@ -466,7 +466,8 @@ class LinuxSourceTreeTest(unittest.TestCase): want_kconfig =3D kunit_config.Kconfig() want_kconfig.add_entry('NOT_REAL', 'y') =20 - tree =3D kunit_kernel.LinuxSourceTree('', kconfig_add=3D['CONFIG_NOT_REA= L=3Dy']) + tree =3D kunit_kernel.LinuxSourceTree('', kunitconfig_paths=3D[os.devnul= l], + kconfig_add=3D['CONFIG_NOT_REAL=3Dy']) self.assertTrue(want_kconfig.is_subset_of(tree._kconfig), msg=3Dtree._kc= onfig) =20 def test_invalid_arch(self): @@ -478,7 +479,7 @@ class LinuxSourceTreeTest(unittest.TestCase): return subprocess.Popen(['echo "hi\nbye"'], shell=3DTrue, text=3DTrue, = stdout=3Dsubprocess.PIPE) =20 with tempfile.TemporaryDirectory('') as build_dir: - tree =3D kunit_kernel.LinuxSourceTree(build_dir) + tree =3D kunit_kernel.LinuxSourceTree(build_dir, kunitconfig_paths=3D[o= s.devnull]) mock.patch.object(tree._ops, 'start', side_effect=3Dfake_start).start() =20 with self.assertRaises(ValueError): --=20 2.52.0