tests/shell: Skip netdev_chain_dev_addremove on tainted kernels
Phil Sutter
reviewerPATCH 1/1 tests/shell: Skip netdev_chain_dev_addremove on tainted kernels
The test checks taint state to indicate success or failure. Since this won't work if the kernel is already tainted at start, skip the test instead of failing it.
Fixes 02dbf86f39410 ("tests: shell: add a test case for netdev ruleset flush + parallel link down")
Signed-off-by Phil Sutter <[email protected]>
--- .../chains/netdev_chain_dev_addremove | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-)
tests/shell/testcases/chains/netdev_chain_dev_addremove +11 -10
@@ -4,6 +4,12 @@ set -e +read taint < /proc/sys/kernel/tainted +if [ "$taint" -ne 0 ]; then + echo "Kernel already tainted up front." + exit 77 +fi + iface_cleanup() { ip link del d0 &>/dev/null || : }
@@ -26,10 +32,6 @@ EOF } for i in $(seq 1 500);do - read taint < /proc/sys/kernel/tainted - if [ "$taint" -ne 0 ]; then - exit 1 - fi ip link add dummy0 type dummy load_rules
@@ -37,12 +39,11 @@ for i in $(seq 1 500);do $NFT flush ruleset & ip link del dummy0 & wait -done -read taint < /proc/sys/kernel/tainted - -if [ "$taint" -ne 0 ]; then - exit 1 -fi + read taint < /proc/sys/kernel/tainted + if [ "$taint" -ne 0 ]; then + exit 1 + fi +done exit 0
Signature · 1 line
2.49.0
Quoted 6 lines · Phil Sutter
The test checks taint state to indicate success or failure. Since this won't work if the kernel is already tainted at start, skip the test instead of failing it.
Fixes 02dbf86f39410 ("tests: shell: add a test case for netdev ruleset flush + parallel link down")Signed-off-by Phil Sutter <[email protected]>
Reviewed-by Pablo Neira Ayuso <[email protected]>
Thanks, Florian made similar patch quite recently for selftests.
Phil Sutter
reviewerQuoted 6 lines · Phil Sutter
The test checks taint state to indicate success or failure. Since this won't work if the kernel is already tainted at start, skip the test instead of failing it.
Fixes 02dbf86f39410 ("tests: shell: add a test case for netdev ruleset flush + parallel link down")Signed-off-by Phil Sutter <[email protected]>
Patch applied.