Skip to contentSkip to conversation

tests: shell: add device to sets/0075tunnel_0 to support older kernels

PATCH New Pablo Neira Ayuso 1 participant 2 messages Nov 17, 2025 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/2 tests: shell: add device to sets/0075tunnel_0 to support older kernels

Older kernels do not support netdev basechain without device, add it so this works.

Alternative is to skip it by adding:

# NFT_TEST_REQUIRES(NFT_TEST_HAVE_netdev_chain_without_device)

but it seems easier to support it.

---
 tests/shell/testcases/sets/0075tunnel_0                | 2 +-
 tests/shell/testcases/sets/dumps/0075tunnel_0.json-nft | 1 +
 tests/shell/testcases/sets/dumps/0075tunnel_0.nft      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
tests/shell/testcases/sets/0075tunnel_0 +1 -1
index f8a8cf00530a..127a4ae91829 100755
@@ -65,7 +65,7 @@ table netdev x {
 	}
 
 	chain x {
-		type filter hook ingress priority 0; policy accept;
+		type filter hook ingress device lo priority 0; policy accept;
 		tunnel name ip saddr map { 10.141.10.123 : "geneve-t", 10.141.10.124 : "vxlan-t", 10.141.10.125 : "erspan-tv1", 10.141.10.126 : "erspan-tv2" } counter
 	}
 }
tests/shell/testcases/sets/dumps/0075tunnel_0.json-nft +1 -0
index 7cd582683955..9c3e9ca0a331 100644
@@ -20,6 +20,7 @@
         "table": "x",
         "name": "x",
         "handle": 0,
+        "dev": "lo",
         "type": "filter",
         "hook": "ingress",
         "prio": 0,
tests/shell/testcases/sets/dumps/0075tunnel_0.nft +1 -1
index 9969124d1a58..d167323f41c7 100644
@@ -57,7 +57,7 @@ table netdev x {
 	}
 
 	chain x {
-		type filter hook ingress priority filter; policy accept;
+		type filter hook ingress device "lo" priority filter; policy accept;
 		tunnel name ip saddr map { 10.141.10.123 : "geneve-t", 10.141.10.124 : "vxlan-t", 10.141.10.125 : "erspan-tv1", 10.141.10.126 : "erspan-tv2" } counter packets 0 bytes 0
 	}
 }
Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH 2/2 tests: shell: refer to python3 in json prettify script

Some distros only refer to python3, update it.

---
 tests/shell/helpers/json-pretty.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/helpers/json-pretty.sh +1 -1
index 5407a8420058..31739b02bc6d 100755
@@ -10,7 +10,7 @@ exec_pretty() {
 	fi
 
 	# Fallback to python.
-	exec python -c '
+	exec python3 -c '
 import json
 import sys
 
Signature · 1 line
2.47.3