summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/cache/0001_cache_handling_0
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/cache/0001_cache_handling_0')
-rwxr-xr-xtests/shell/testcases/cache/0001_cache_handling_029
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/shell/testcases/cache/0001_cache_handling_0 b/tests/shell/testcases/cache/0001_cache_handling_0
new file mode 100755
index 00000000..9a737695
--- /dev/null
+++ b/tests/shell/testcases/cache/0001_cache_handling_0
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+ echo "Failed to create tmp file" >&2
+ exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+echo "
+table inet test {
+ set test {
+ type ipv4_addr
+ elements = { 1.1.1.1}
+ }
+
+ chain test {
+ ip saddr @test counter accept
+ ip daddr { 2.2.2.2} counter accept
+ }
+}" > $tmpfile
+
+set -e
+
+$NFT -f $tmpfile
+$NFT delete rule inet test test handle 2
+$NFT delete set inet test test
+$NFT -f $tmpfile