[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260108132851.bb6b7813277a5b40ba3aec8f@linux-foundation.org>
Date: Thu, 8 Jan 2026 13:28:51 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Sun Jian <sun.jian.kdev@...il.com>
Cc: Shuah Khan <shuah@...nel.org>, David Hildenbrand <david@...nel.org>,
linux-kselftest@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests/mm: run_vmtests.sh: fix relative path
handling
On Thu, 8 Jan 2026 11:16:04 +0800 Sun Jian <sun.jian.kdev@...il.com> wrote:
> 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.
>
> ...
>
hm, why? Is that a thing people actually do?
Is anyone going to actually test this feature?
> --- 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
> +
Alternatively we could check that we're in the correct directory and
error out if not.
Powered by blists - more mailing lists