selftests: support interpreted scripts with ksft_runner.sh
authorWillem de Bruijn <willemb@google.com>
Thu, 5 Sep 2024 23:15:51 +0000 (19:15 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Sep 2024 00:38:02 +0000 (17:38 -0700)
commitdbd61921a6adbd231d8ca91537f1e7b62e9fea61
tree79fe9342d38a64fa37d114c88c3f8af3ec8859bc
parentbcd138b179f2701459d404880d018d065a958fc9
selftests: support interpreted scripts with ksft_runner.sh

Support testcases that are themselves not executable, but need an
interpreter to run them.

If a test file is not executable, but an executable file
ksft_runner.sh exists in the TARGET dir, kselftest will run

    ./ksft_runner.sh ./$BASENAME_TEST

Packetdrill may add hundreds of packetdrill scripts for testing. These
scripts must be passed to the packetdrill process.

Have kselftest run each test directly, as it already solves common
runner requirements like parallel execution and isolation (netns).
A previous RFC added a wrapper in between, which would have to
reimplement such functionality.

Link: https://lore.kernel.org/netdev/66d4d97a4cac_3df182941a@willemb.c.googlers.com.notmuch/T/
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20240905231653.2427327-2-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/kselftest/runner.sh