* [nft PATCH] tests/shell: Skip netdev_chain_dev_addremove on tainted kernels
@ 2025-05-08 10:26 Phil Sutter
2025-05-08 11:15 ` Pablo Neira Ayuso
2025-05-08 21:50 ` Phil Sutter
0 siblings, 2 replies; 3+ messages in thread
From: Phil Sutter @ 2025-05-08 10:26 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
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 <phil@nwl.cc>
---
.../chains/netdev_chain_dev_addremove | 21 ++++++++++---------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/tests/shell/testcases/chains/netdev_chain_dev_addremove b/tests/shell/testcases/chains/netdev_chain_dev_addremove
index 14260d54b778e..6103e82b10603 100755
--- a/tests/shell/testcases/chains/netdev_chain_dev_addremove
+++ b/tests/shell/testcases/chains/netdev_chain_dev_addremove
@@ -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
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [nft PATCH] tests/shell: Skip netdev_chain_dev_addremove on tainted kernels
2025-05-08 10:26 [nft PATCH] tests/shell: Skip netdev_chain_dev_addremove on tainted kernels Phil Sutter
@ 2025-05-08 11:15 ` Pablo Neira Ayuso
2025-05-08 21:50 ` Phil Sutter
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2025-05-08 11:15 UTC (permalink / raw)
To: Phil Sutter; +Cc: netfilter-devel
On Thu, May 08, 2025 at 12:26:54PM +0200, Phil Sutter wrote:
> 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 <phil@nwl.cc>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Thanks, Florian made similar patch quite recently for selftests.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [nft PATCH] tests/shell: Skip netdev_chain_dev_addremove on tainted kernels
2025-05-08 10:26 [nft PATCH] tests/shell: Skip netdev_chain_dev_addremove on tainted kernels Phil Sutter
2025-05-08 11:15 ` Pablo Neira Ayuso
@ 2025-05-08 21:50 ` Phil Sutter
1 sibling, 0 replies; 3+ messages in thread
From: Phil Sutter @ 2025-05-08 21:50 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
On Thu, May 08, 2025 at 12:26:54PM +0200, Phil Sutter wrote:
> 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 <phil@nwl.cc>
Patch applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-08 21:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08 10:26 [nft PATCH] tests/shell: Skip netdev_chain_dev_addremove on tainted kernels Phil Sutter
2025-05-08 11:15 ` Pablo Neira Ayuso
2025-05-08 21:50 ` Phil Sutter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.