]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: net: lib: do not set ns var as readonly
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>
Fri, 7 Jun 2024 16:31:04 +0000 (18:31 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Jun 2024 02:30:25 +0000 (19:30 -0700)
commit577db6bd5750b6de70f7017dfa2ad98d8934993b
tree4f0892a891fe5ee0f238c10a89501782da08f08b
parent92fe5670271a58bb951646225ea367bb86f7feb3
selftests: net: lib: do not set ns var as readonly

It sounds good to mark the global netns variable as 'readonly', but Bash
doesn't allow the creation of local variables with the same name.

Because it looks like 'readonly' is mainly used here to check if a netns
with that name has already been set, it sounds fine to check if a
variable with this name has already been set instead. By doing that, we
avoid having to modify helpers from MPTCP selftests using the same
variable name as the one used to store the created netns name.

While at it, also avoid an unnecessary call to 'eval' to set a local
variable.

Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240607-upstream-net-next-20240607-selftests-mptcp-net-lib-v1-3-e36986faac94@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib.sh