path: root/tests/shell/testcases/transactions/0023rule_1
diff options
authorPablo Neira Ayuso <>2016-06-22 13:18:56 +0200
committerPablo Neira Ayuso <>2016-06-22 19:07:43 +0200
commit1b25bfa4b2f6b14dbee569ff467ea4d495abcc81 (patch)
tree58f38c440a527bb84a1a5d5b26c2be3d17e5b390 /tests/shell/testcases/transactions/0023rule_1
parent24c9e993eeff0ed41875aa7efef5dd69db4eb537 (diff)
tests: shell: cover transactions via nft -f using flat syntax
This patch covers transactions using the flat syntax representation, eg. add table x add chain x y { type filter hook forward priority 0; } add chain x y { policy drop; } This also covers things like: add element x whitelist { } delete element x whitelist { } The one above may look silly from a human behaviour point of view, but silly robots may very well behave like this. These tests require several kernel patches though in order to pass successfully. Signed-off-by: Pablo Neira Ayuso <> Acked-by: Arturo Borrero Gonzalez <>
Diffstat (limited to 'tests/shell/testcases/transactions/0023rule_1')
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/shell/testcases/transactions/0023rule_1 b/tests/shell/testcases/transactions/0023rule_1
new file mode 100755
index 00000000..4c4e24cd
--- /dev/null
+++ b/tests/shell/testcases/transactions/0023rule_1
@@ -0,0 +1,20 @@
+set -e
+if [ ! -w $tmpfile ] ; then
+ echo "Failed to create tmp file" >&2
+ exit 0
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+RULESET="add table x
+add chain x y
+add rule x y jump y"
+echo "$RULESET" > $tmpfile
+# kernel must return ELOOP
+$NFT -f $tmpfile 2>/dev/null
+echo "E: allowing jump to chain loop"