Clear parameters variable and proceed, but only once.

Signed-off-by: Alexey Kodanev <alexey.koda...@oracle.com>
---
 testcases/network/virt/vlan03.sh  |   12 ++++++++----
 testcases/network/virt/vxlan03.sh |    6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/testcases/network/virt/vlan03.sh b/testcases/network/virt/vlan03.sh
index a067065..5c49d41 100755
--- a/testcases/network/virt/vlan03.sh
+++ b/testcases/network/virt/vlan03.sh
@@ -63,18 +63,22 @@ rh1="reorder_hdr on"
 opts="$p0 $lb0 $rh0,$p0 $lb1 $rh1,$p1 $lb0 $rh0,$p1 $lb1 $rh1"
 
 for n in $(seq 1 4); do
-       params="$(echo $opts | cut -d',' -f$n)"
+       p="$(echo $opts | cut -d',' -f$n)"
 
-       virt_check_cmd virt_add ltp_v0 id 0 $params || continue
+       virt_check_cmd virt_add ltp_v0 id 0 $p
+       if [ $? -ne 0 ]; then
+               [ $n -gt 1 ] && continue
+               p=""
+       fi
 
-       virt_setup "id 4094 $params" "id 4094 $params"
+       virt_setup "id 4094 $p" "id 4094 $p"
        virt_compare_netperf || res="TFAIL"
 
        tst_resm $res "done"
 
        tst_resm TINFO "different VLAN ID shall not work together"
        res="TPASS"
-       virt_setup "id 4093 $params" "id 4094 $params"
+       virt_setup "id 4093 $p" "id 4094 $p"
        virt_compare_netperf && res="TFAIL"
 
        tst_resm $res "done"
diff --git a/testcases/network/virt/vxlan03.sh 
b/testcases/network/virt/vxlan03.sh
index 613f4c2..b105afb 100755
--- a/testcases/network/virt/vxlan03.sh
+++ b/testcases/network/virt/vxlan03.sh
@@ -69,7 +69,11 @@ opts="dstport 0,dstport 0 gbp"
 for n in $(seq 1 2); do
        p="$(echo $opts | cut -d',' -f$n)"
 
-       virt_check_cmd virt_add ltp_v0 id 0 $p || continue
+       virt_check_cmd virt_add ltp_v0 id 0 $p
+       if [ $? -ne 0 ]; then
+               [ $n -gt 1 ] && continue
+               p=""
+       fi
 
        tst_resm TINFO "the same VNI must work"
        # VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE
-- 
1.7.1


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to