[PATCH nft 14/16] tests: shell: Add tests for concat expression.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add test cases for concat type and element mismatch.

Signed-off-by: Varsha Rao <rvarsha016@xxxxxxxxx>
---
 tests/shell/testcases/transactions/0050concat_1 | 26 +++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100755 tests/shell/testcases/transactions/0050concat_1

diff --git a/tests/shell/testcases/transactions/0050concat_1 b/tests/shell/testcases/transactions/0050concat_1
new file mode 100755
index 0000000..0e4f6e1
--- /dev/null
+++ b/tests/shell/testcases/transactions/0050concat_1
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+set -e
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+        echo "Failed to create tmp file" >&2
+        exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+RULESET="add table ip x
+add chain ip x y
+add rule ip x y ip daddr . tcp sport . tcp dport { \
+        192.168.0.1 . 22,       \
+        192.168.0.1 . 80,       \
+}
+add rule ip x y ip daddr . tcp dport { \
+        192.168.0.1 . 192.168.0.2,      \
+        192.168.0.1 . 192.168.0.3,      \
+}"
+
+echo "$RULESET" > $tmpfile
+$NFT -f $tmpfile
+echo "E: Allowed concat type and element mismatch"
-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux