]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: net: Refactor cleanup logic in lib_netcons.sh
authorBreno Leitao <leitao@debian.org>
Fri, 13 Jun 2025 11:31:36 +0000 (04:31 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 Jun 2025 22:18:34 +0000 (15:18 -0700)
commitbed365ca56cadeabb4f0484dc9e12b3c78ac0ab7
tree28d77c38c038978f32d7c1ade96edccef6ebde6e
parentd79206451f4f99a03907ab9390361ab83b607a6a
selftests: net: Refactor cleanup logic in lib_netcons.sh

Extract the network device and namespace cleanup logic from the
cleanup() function into a new do_cleanup() helper in lib_netcons.sh.

The do_cleanup() function only unconfigure the network and
printk, while cleanup() cleans the netconsole targets plus the network
and printk.

This refactoring let this code to be reused in cases netconsole dynamic
is not being used, as in the upcoming patch.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250613-rework-v3-7-0752bf2e6912@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh