linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: run_vmtests.sh: fix relative path handling
@ 2026-01-08  3:16 Sun Jian
  2026-01-08 21:28 ` Andrew Morton
  2026-01-09 17:28 ` [PATCH v2] selftests/mm: run_vmtests.sh: fail if invoked from the wrong directory Sun Jian
  0 siblings, 2 replies; 6+ messages in thread
From: Sun Jian @ 2026-01-08  3:16 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Andrew Morton, David Hildenbrand, linux-kselftest, linux-mm,
	linux-kernel, Sun Jian

run_vmtests.sh relies on being invoked from its own directory and uses
relative paths to run tests.

Change to the script directory at startup so it can be run from any
working directory without failing.

Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 tools/testing/selftests/mm/run_vmtests.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
index d9173f2312b7..74c33fd07764 100755
--- a/tools/testing/selftests/mm/run_vmtests.sh
+++ b/tools/testing/selftests/mm/run_vmtests.sh
@@ -5,6 +5,10 @@
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
 
+# Ensure relative paths work regardless of caller's cwd.
+SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
+cd "$SCRIPT_DIR" || exit 1
+
 count_total=0
 count_pass=0
 count_fail=0
-- 
2.43.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-10  1:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-08  3:16 [PATCH] selftests/mm: run_vmtests.sh: fix relative path handling Sun Jian
2026-01-08 21:28 ` Andrew Morton
2026-01-09  2:08   ` sun jian
2026-01-09 13:41     ` David Hildenbrand (Red Hat)
2026-01-09 17:28 ` [PATCH v2] selftests/mm: run_vmtests.sh: fail if invoked from the wrong directory Sun Jian
2026-01-10  1:00   ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox