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

Signed-off-by: Cui Bixuan <cuibix...@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

Reply via email to