public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/5] iptables/iptables_tests.sh: Add test cases for iptables -L
@ 2015-05-27  0:59 Cui Bixuan
  2015-05-27  1:01 ` [LTP] [PATCH 2/5] iptables/iptables_tests.sh: Add new testcases for iptables -c Cui Bixuan
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Cui Bixuan @ 2015-05-27  0:59 UTC (permalink / raw)
  To: ltp-list; +Cc: zhuyanpeng, zhanyongming

Add cases in test01 for iptables -L -t raw/security

Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
---
 testcases/network/iptables/iptables_tests.sh |   34 ++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/testcases/network/iptables/iptables_tests.sh b/testcases/network/iptables/iptables_tests.sh
index a3f90a3..f8a7981 100755
--- a/testcases/network/iptables/iptables_tests.sh
+++ b/testcases/network/iptables/iptables_tests.sh
@@ -120,6 +120,40 @@ test01()
 		fi
 	fi
 
+	local cmd="iptables -L -t raw"
+	tst_resm TINFO "$cmd will list all rules in table raw."
+	$cmd > tst_iptables.out 2>&1
+	if [ $? -ne 0 ]; then
+		tst_resm TFAIL "$cmd failed to list rules."
+		cat tst_iptables.out
+		return
+	else
+		chaincnt=$(grep -c Chain tst_iptables.out)
+		if [ $chaincnt -lt 2 ]; then
+			tst_resm TFAIL "$cmd failed to list rules."
+			cat tst_iptables.out
+		else
+			tst_resm TINFO "$cmd lists rules."
+		fi
+	fi
+
+	local cmd="iptables -L -t security"
+	tst_resm TINFO "$cmd will list all rules in table security."
+	$cmd > tst_iptables.out 2>&1
+	if [ $? -ne 0 ]; then
+		tst_resm TFAIL "$cmd failed to list rules."
+		cat tst_iptables.out
+		return
+	else
+		chaincnt=$(grep -c Chain tst_iptables.out)
+		if [ $chaincnt -lt 3 ]; then
+			tst_resm TFAIL "$cmd failed to list rules."
+			cat tst_iptables.out
+		else
+			tst_resm TINFO "$cmd lists rules."
+		fi
+	fi
+
 	tst_resm TPASS "iptables -L lists rules."
 }
 
-- 
1.6.0.2


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-06-09 14:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27  0:59 [LTP] [PATCH 1/5] iptables/iptables_tests.sh: Add test cases for iptables -L Cui Bixuan
2015-05-27  1:01 ` [LTP] [PATCH 2/5] iptables/iptables_tests.sh: Add new testcases for iptables -c Cui Bixuan
2015-06-09 14:01   ` Cyril Hrubis
2015-05-27  1:02 ` [LTP] [PATCH 3/5] iptables/iptables_tests.sh: Add new testcases for iptables -o Cui Bixuan
2015-06-09 14:13   ` Cyril Hrubis
2015-06-09 14:17   ` Cyril Hrubis
2015-05-27  1:03 ` [LTP] [PATCH 4/5] iptables/iptables_tests.sh: Add new testcases for iptables -N/E Cui Bixuan
2015-05-27  1:04 ` [LTP] [PATCH 5/5] iptables/iptables_tests.sh: Add new testcases for iptables -R Cui Bixuan
2015-06-09 13:33 ` [LTP] [PATCH 1/5] iptables/iptables_tests.sh: Add test cases for iptables -L Cyril Hrubis
2015-06-09 13:38 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox