From: Varsha Rao <rvarsha016@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Cc: Varsha Rao <rvarsha016@gmail.com>
Subject: [PATCH nft 09/16] tests: shell: Add test for ct expression.
Date: Mon, 30 Oct 2017 02:19:24 +0530 [thread overview]
Message-ID: <20171029204931.7792-9-rvarsha016@gmail.com> (raw)
In-Reply-To: <20171029204931.7792-1-rvarsha016@gmail.com>
This patch adds test cases for ct expression.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
tests/shell/testcases/transactions/0025rule_0 | 36 +++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100755 tests/shell/testcases/transactions/0025rule_0
diff --git a/tests/shell/testcases/transactions/0025rule_0 b/tests/shell/testcases/transactions/0025rule_0
new file mode 100755
index 0000000..b8df747
--- /dev/null
+++ b/tests/shell/testcases/transactions/0025rule_0
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Test for ct statements.
+
+set -e
+
+$NFT add table x
+$NFT add chain x y { type filter hook output priority 0\; }
+$NFT add rule x y ct state new,established
+$NFT add rule x y ct direction original
+$NFT add rule x y ct direction reply
+$NFT add rule x y ct status expected
+$NFT add rule x y ct mark 0
+$NFT add rule x y ct expiration 30
+$NFT add rule x y ct helper "ftp"
+
+EXPECTED="table ip x {
+ chain y {
+ type filter hook output priority 0; policy accept;
+ ct state established,new
+ ct direction original
+ ct direction reply
+ ct status expected
+ ct mark 0x00000000
+ ct expiration 30s
+ ct helper \"ftp\"
+ }
+}"
+
+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
next prev parent reply other threads:[~2017-10-29 20:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-29 20:39 [PATCH nft 00/16] tests: files: Remove test files Varsha Rao
2017-10-29 20:49 ` [PATCH nft 01/16] tests: files: Remove tests for ipv4 Varsha Rao
2017-10-29 20:49 ` [PATCH nft 02/16] tests: files: Remove tests for ipv6 Varsha Rao
2017-10-29 20:49 ` [PATCH nft 03/16] tests: shell: Add test for log statement Varsha Rao
2017-10-29 20:49 ` [PATCH nft 04/16] tests: files: Remove log statement tests Varsha Rao
2017-10-29 20:49 ` [PATCH nft 05/16] tests: shell: Add test for log flags Varsha Rao
2017-10-29 20:49 ` [PATCH nft 06/16] tests: shell: Add tests for payload expression Varsha Rao
2017-10-29 20:49 ` [PATCH nft 07/16] tests: files: Remove payload expression tests Varsha Rao
2017-10-29 20:49 ` [PATCH nft 08/16] tests: files: Remove test for syntactical errors Varsha Rao
2017-10-29 20:49 ` Varsha Rao [this message]
2017-10-29 20:49 ` [PATCH nft 10/16] tests: files: Remove test for ct expression Varsha Rao
2017-10-29 20:49 ` [PATCH nft 11/16] tests: files: Remove prefix file Varsha Rao
2017-10-29 20:49 ` [PATCH nft 12/16] tests: files: Test for meta expressions Varsha Rao
2017-10-29 20:49 ` [PATCH nft 13/16] tests: files: Remove test for meta expression Varsha Rao
2017-10-29 20:49 ` [PATCH nft 14/16] tests: shell: Add tests for concat expression Varsha Rao
2017-10-29 20:49 ` [PATCH nft 15/16] tests: files: Remove " Varsha Rao
2017-10-29 20:49 ` [PATCH nft 16/16] tests: shell: Add test case for map expression Varsha Rao
2017-11-06 15:04 ` [PATCH nft 00/16] tests: files: Remove test files Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171029204931.7792-9-rvarsha016@gmail.com \
--to=rvarsha016@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).