Skip to contentSkip to conversation

tests: shell: exercise validate with nft -c

PATCH New Pablo Neira Ayuso 1 participant 1 message Oct 30, 2020 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 tests: shell: exercise validate with nft -c

Using oif in fib from prerouting is not support, make sure -c reports an error.

---
 tests/shell/testcases/nft-f/0023check_1 | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100755 tests/shell/testcases/nft-f/0023check_1
tests/shell/testcases/nft-f/0023check_1 new file +12 -0
new file mode 100755
index 000000000000..42793b6ec68c
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+RULESET="table ip foo {
+	chain bar {
+		type filter hook prerouting priority 0;
+	}
+}"
+
+$NFT -f - <<< "$RULESET"
+
+$NFT -c add rule foo bar fib saddr . oif type local && exit 1
+exit 0
Signature · 1 line
2.20.1