[PATCH nft 03/16] tests: shell: Add test for log statement.

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

 



Add test case for log statement.

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

diff --git a/tests/shell/testcases/optionals/log_0 b/tests/shell/testcases/optionals/log_0
new file mode 100755
index 0000000..672cff7
--- /dev/null
+++ b/tests/shell/testcases/optionals/log_0
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+EXPECTED="table ip x {
+	chain y {
+		type filter hook output priority 0; policy accept;
+		tcp dport ssh log group 0 counter packets 0 bytes 0
+	}
+}"
+
+$NFT add table ip x
+$NFT add chain ip x y { type filter hook output priority 0\; }
+$NFT add rule ip x y tcp dport 22 log group 0 counter
+
+GET="$($NFT list ruleset)"
+
+if [ "$EXPECTED" != "$GET" ] ; then
+        DIFF="$(which diff)"
+        [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
+        exit 1
+fi
-- 
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