summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/cache
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo@debian.org>2016-11-03 13:04:42 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-11-09 00:21:38 +0100
commit51c506797a1b23921b66b9184f77ea8c02752cdb (patch)
tree9198a8d975e19db672a8269627986743542ed4dd /tests/shell/testcases/cache
parent1d6bc94bbfa05ddfe3463e3cc5f05b6566d9fe60 (diff)
tests: shell: introduce the cache testcases directory
This directory is for testcases related to the nft cache. Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/cache')
-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