summaryrefslogtreecommitdiffstats
path: root/tests/shell
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2016-01-13 19:25:46 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-03-03 19:54:58 +0100
commitcae7b659d179ea0bb411cc185bfcba4822b763c9 (patch)
treed241f35860949c2a99b0b8aaaab1e4f4fa088253 /tests/shell
parentbd23f7628570ace0dc60c1d05f5abba37d5d7ceb (diff)
tests/shell: add first `nft -f' tests
This patch add some basic initial tests. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell')
-rwxr-xr-xtests/shell/testcases/nft-f/0001define_slash_025
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-f/0001define_slash_0 b/tests/shell/testcases/nft-f/0001define_slash_0
new file mode 100755
index 00000000..4ce7089c
--- /dev/null
+++ b/tests/shell/testcases/nft-f/0001define_slash_0
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# tests for commit 85d6803 (parser_bison: initializer_expr must use rhs_expr)
+
+MKTEMP=$(which mktemp)
+if [ -x $MKTEMP ] ; then
+ tmpfile=$(${MKTEMP})
+else
+ tmpfile=$(/tmp/${RANDOM})
+fi
+
+if [ ! -w $tmpfile ] ; then
+ echo "Failed to create tmp file" >&2
+ exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+echo "
+define net = 1.1.1.1/24
+" > $tmpfile
+
+set -e
+
+$NFT -f $tmpfile