On Tue, Sep 09, 2025 at 10:12:16PM +0100, Andre Carvalho wrote: > diff --git a/tools/testing/selftests/drivers/net/Makefile > b/tools/testing/selftests/drivers/net/Makefile > index > 984ece05f7f92e836592107ba4c692da6d8ce1b3..f47c4d57f7b4ce82b0b59bee4c87a9660819675e > 100644 > --- a/tools/testing/selftests/drivers/net/Makefile > +++ b/tools/testing/selftests/drivers/net/Makefile > @@ -17,6 +17,7 @@ TEST_PROGS := \ > netcons_fragmented_msg.sh \ > netcons_overflow.sh \ > netcons_sysdata.sh \ > + netcons_resume.sh \
we try to keep these tests alphabetically ordered. > netpoll_basic.py \ > ping.py \ > queues.py \ > diff --git a/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh > b/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh > index > 8e1085e896472d5c87ec8b236240878a5b2d00d2..ba7c865b1be3b60f53ea548aba269059ca74aee6 > 100644 > --- a/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh > +++ b/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh > @@ -350,6 +350,29 @@ function check_netconsole_module() { > fi > } > > +function wait_target_state() { > + local TARGET=${1} > + local STATE=${2} > + local FILENAME="${NETCONS_CONFIGFS}"/"${TARGET}"/"enabled" > + > + if [ "${STATE}" == "enabled" ] > + then > + ENABLED=1 > + else > + ENABLED=0 > + fi > + > + if [ ! -f "$FILENAME" ]; then > + echo "FAIL: Target does not exist." >&2 > + exit "${ksft_fail}" > + fi > + > + slowwait 2 sh -c 'test -n "$(grep '"'${ENABLED}'"' '"'${FILENAME}'"')"' > || { shellcheck is not very happy with this line: https://netdev.bots.linux.dev/static/nipa/1000727/14224835/shellcheck/stderr > diff --git a/tools/testing/selftests/drivers/net/netcons_resume.sh > b/tools/testing/selftests/drivers/net/netcons_resume.sh > new file mode 100755 > index > 0000000000000000000000000000000000000000..7e8ea74821fffdac8be0c3db2f1aa7953b4d5bd5 > --- /dev/null > +++ b/tools/testing/selftests/drivers/net/netcons_resume.sh > @@ -0,0 +1,68 @@ > +#!/usr/bin/env bash > +# SPDX-License-Identifier: GPL-2.0 > + > +# This test validates that netconsole is able to resume a target that was > +# deactivated when its interface was removed. > +# > +# The test configures a netconsole dynamic target and then removes netdevsim > +# module to cause the interface to disappear. The test veries that the target nit: s/veries/verifies/