* [PATCH nft] tests: shell: make testcases which using tcp/udp port more rubost
@ 2016-06-11 5:05 Liping Zhang
2016-06-11 10:04 ` Arturo Borrero Gonzalez
0 siblings, 1 reply; 3+ messages in thread
From: Liping Zhang @ 2016-06-11 5:05 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel, Liping Zhang
From: Liping Zhang <liping.zhang@spreadtrum.com>
In my mechain, port 12345 is mapped to italk in /etc/services:
italk 12345/tcp # Italk Chat System
So when we add nft rule with udp port "12345", nft list ruleset
will displayed it as "italk", that cause the result is not same
with expected, then testcase fail.
Add "-nn" option when dump the rulesets from the kernel, make
testcases which using tcp/udp port more rubost.
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
---
tests/shell/testcases/netns/0001nft-f_0 | 2 +-
tests/shell/testcases/netns/0002loosecommands_0 | 2 +-
tests/shell/testcases/netns/0003many_0 | 2 +-
tests/shell/testcases/nft-f/0002rollback_rule_0 | 2 +-
tests/shell/testcases/nft-f/0003rollback_jump_0 | 2 +-
tests/shell/testcases/nft-f/0004rollback_set_0 | 2 +-
tests/shell/testcases/nft-f/0005rollback_map_0 | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/shell/testcases/netns/0001nft-f_0 b/tests/shell/testcases/netns/0001nft-f_0
index e616363..663167d 100755
--- a/tests/shell/testcases/netns/0001nft-f_0
+++ b/tests/shell/testcases/netns/0001nft-f_0
@@ -99,7 +99,7 @@ if [ $? -ne 0 ] ; then
exit 1
fi
-KERNEL_RULESET="$($IP netns exec $NETNS_NAME $NFT list ruleset)"
+KERNEL_RULESET="$($IP netns exec $NETNS_NAME $NFT list ruleset -nn)"
$IP netns del $NETNS_NAME
if [ "$RULESET" != "$KERNEL_RULESET" ] ; then
DIFF="$(which diff)"
diff --git a/tests/shell/testcases/netns/0002loosecommands_0 b/tests/shell/testcases/netns/0002loosecommands_0
index 1600d94..fbaa386 100755
--- a/tests/shell/testcases/netns/0002loosecommands_0
+++ b/tests/shell/testcases/netns/0002loosecommands_0
@@ -53,7 +53,7 @@ RULESET="table ip t {
}
}"
-KERNEL_RULESET="$($IP netns exec $NETNS_NAME $NFT list ruleset)"
+KERNEL_RULESET="$($IP netns exec $NETNS_NAME $NFT list ruleset -nn)"
$IP netns del $NETNS_NAME
if [ "$RULESET" != "$KERNEL_RULESET" ] ; then
DIFF="$(which diff)"
diff --git a/tests/shell/testcases/netns/0003many_0 b/tests/shell/testcases/netns/0003many_0
index ad71ae3..f8853ee 100755
--- a/tests/shell/testcases/netns/0003many_0
+++ b/tests/shell/testcases/netns/0003many_0
@@ -104,7 +104,7 @@ function test_netns()
exit 1
fi
- KERNEL_RULESET="$($IP netns exec $NETNS_NAME $NFT list ruleset)"
+ KERNEL_RULESET="$($IP netns exec $NETNS_NAME $NFT list ruleset -nn)"
if [ "$RULESET" != "$KERNEL_RULESET" ] ; then
echo "E: ruleset in netns $NETNS_NAME differs from the loaded" >&2
DIFF="$(which diff)"
diff --git a/tests/shell/testcases/nft-f/0002rollback_rule_0 b/tests/shell/testcases/nft-f/0002rollback_rule_0
index b1e224c..5518c0b 100755
--- a/tests/shell/testcases/nft-f/0002rollback_rule_0
+++ b/tests/shell/testcases/nft-f/0002rollback_rule_0
@@ -49,7 +49,7 @@ if [ $? -eq 0 ] ; then
exit 1
fi
-KERNEL_RULESET="$($NFT list ruleset)"
+KERNEL_RULESET="$($NFT list ruleset -nn)"
if [ "$GOOD_RULESET" != "$KERNEL_RULESET" ] ; then
DIFF="$(which diff)"
diff --git a/tests/shell/testcases/nft-f/0003rollback_jump_0 b/tests/shell/testcases/nft-f/0003rollback_jump_0
index 567a70e..5c8c685 100755
--- a/tests/shell/testcases/nft-f/0003rollback_jump_0
+++ b/tests/shell/testcases/nft-f/0003rollback_jump_0
@@ -49,7 +49,7 @@ if [ $? -eq 0 ] ; then
exit 1
fi
-KERNEL_RULESET="$($NFT list ruleset)"
+KERNEL_RULESET="$($NFT list ruleset -nn)"
if [ "$GOOD_RULESET" != "$KERNEL_RULESET" ] ; then
DIFF="$(which diff)"
diff --git a/tests/shell/testcases/nft-f/0004rollback_set_0 b/tests/shell/testcases/nft-f/0004rollback_set_0
index 3521aeb..db1c84c 100755
--- a/tests/shell/testcases/nft-f/0004rollback_set_0
+++ b/tests/shell/testcases/nft-f/0004rollback_set_0
@@ -49,7 +49,7 @@ if [ $? -eq 0 ] ; then
exit 1
fi
-KERNEL_RULESET="$($NFT list ruleset)"
+KERNEL_RULESET="$($NFT list ruleset -nn)"
if [ "$GOOD_RULESET" != "$KERNEL_RULESET" ] ; then
DIFF="$(which diff)"
diff --git a/tests/shell/testcases/nft-f/0005rollback_map_0 b/tests/shell/testcases/nft-f/0005rollback_map_0
index 21b6a63..13bb907 100755
--- a/tests/shell/testcases/nft-f/0005rollback_map_0
+++ b/tests/shell/testcases/nft-f/0005rollback_map_0
@@ -52,7 +52,7 @@ if [ $? -eq 0 ] ; then
exit 1
fi
-KERNEL_RULESET="$($NFT list ruleset)"
+KERNEL_RULESET="$($NFT list ruleset -nn)"
if [ "$GOOD_RULESET" != "$KERNEL_RULESET" ] ; then
DIFF="$(which diff)"
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nft] tests: shell: make testcases which using tcp/udp port more rubost
2016-06-11 5:05 [PATCH nft] tests: shell: make testcases which using tcp/udp port more rubost Liping Zhang
@ 2016-06-11 10:04 ` Arturo Borrero Gonzalez
2016-06-15 11:58 ` Pablo Neira Ayuso
0 siblings, 1 reply; 3+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-06-11 10:04 UTC (permalink / raw)
To: Liping Zhang
Cc: Pablo Neira Ayuso, Netfilter Development Mailing list,
Liping Zhang
On 11 June 2016 at 07:05, Liping Zhang <zlpnobody@163.com> wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
>
> In my mechain, port 12345 is mapped to italk in /etc/services:
> italk 12345/tcp # Italk Chat System
>
> So when we add nft rule with udp port "12345", nft list ruleset
> will displayed it as "italk", that cause the result is not same
> with expected, then testcase fail.
>
> Add "-nn" option when dump the rulesets from the kernel, make
> testcases which using tcp/udp port more rubost.
>
> Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
> ---
> tests/shell/testcases/netns/0001nft-f_0 | 2 +-
> tests/shell/testcases/netns/0002loosecommands_0 | 2 +-
> tests/shell/testcases/netns/0003many_0 | 2 +-
> tests/shell/testcases/nft-f/0002rollback_rule_0 | 2 +-
> tests/shell/testcases/nft-f/0003rollback_jump_0 | 2 +-
> tests/shell/testcases/nft-f/0004rollback_set_0 | 2 +-
> tests/shell/testcases/nft-f/0005rollback_map_0 | 2 +-
> 7 files changed, 7 insertions(+), 7 deletions(-)
>
Acked-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
--
Arturo Borrero González
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH nft] tests: shell: make testcases which using tcp/udp port more rubost
2016-06-11 10:04 ` Arturo Borrero Gonzalez
@ 2016-06-15 11:58 ` Pablo Neira Ayuso
0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2016-06-15 11:58 UTC (permalink / raw)
To: Arturo Borrero Gonzalez
Cc: Liping Zhang, Netfilter Development Mailing list, Liping Zhang
On Sat, Jun 11, 2016 at 12:04:57PM +0200, Arturo Borrero Gonzalez wrote:
> On 11 June 2016 at 07:05, Liping Zhang <zlpnobody@163.com> wrote:
> > From: Liping Zhang <liping.zhang@spreadtrum.com>
> >
> > In my mechain, port 12345 is mapped to italk in /etc/services:
> > italk 12345/tcp # Italk Chat System
> >
> > So when we add nft rule with udp port "12345", nft list ruleset
> > will displayed it as "italk", that cause the result is not same
> > with expected, then testcase fail.
> >
> > Add "-nn" option when dump the rulesets from the kernel, make
> > testcases which using tcp/udp port more rubost.
> >
> > Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
> > ---
> > tests/shell/testcases/netns/0001nft-f_0 | 2 +-
> > tests/shell/testcases/netns/0002loosecommands_0 | 2 +-
> > tests/shell/testcases/netns/0003many_0 | 2 +-
> > tests/shell/testcases/nft-f/0002rollback_rule_0 | 2 +-
> > tests/shell/testcases/nft-f/0003rollback_jump_0 | 2 +-
> > tests/shell/testcases/nft-f/0004rollback_set_0 | 2 +-
> > tests/shell/testcases/nft-f/0005rollback_map_0 | 2 +-
> > 7 files changed, 7 insertions(+), 7 deletions(-)
> >
>
> Acked-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-15 11:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-11 5:05 [PATCH nft] tests: shell: make testcases which using tcp/udp port more rubost Liping Zhang
2016-06-11 10:04 ` Arturo Borrero Gonzalez
2016-06-15 11:58 ` Pablo Neira Ayuso
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).