test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V1] tests/flow_classify_softnic: optimize script
@ 2019-08-14 18:16 Wenjie Li
  2019-08-14  9:22 ` Wu, ChangqingX
  0 siblings, 1 reply; 2+ messages in thread
From: Wenjie Li @ 2019-08-14 18:16 UTC (permalink / raw)
  To: dts; +Cc: Wenjie Li

optimize script:
1. verify the link is up before send packets
2. in test case inconsistent_rules, if the output of "flow create" does
not contain keyword "error", it will fail and return "timeout to flow 
create ...". This is not clear and would take more time to wait for the
timeout. Change it to self.verify("error" in out, "....").

Signed-off-by: Wenjie Li <wenjiex.a.li@intel.com>
---
 tests/TestSuite_flow_classify_softnic.py | 58 ++++++++++++++++++++++--
 1 file changed, 54 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_flow_classify_softnic.py b/tests/TestSuite_flow_classify_softnic.py
index a649a44..d936df3 100644
--- a/tests/TestSuite_flow_classify_softnic.py
+++ b/tests/TestSuite_flow_classify_softnic.py
@@ -421,6 +421,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(src_mask="255.192.0.0", src_spec="2.128.0.0", protomask=self.protomask, protospec=132, l4type="sctp", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, index=[1])
         self.generate_rules(dst_mask="255.192.0.0", dst_spec="4.0.0.0", protomask=self.protomask, sportspec=100, sportmask=self.portmask, dportmask=self.portmask, dportspec=200, index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -522,6 +524,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="100.0.0.3", dst_spec="200.0.0.3", protomask=self.protomask, protospec=132, l4type="sctp", sportmask=self.portmask, dportmask=self.portmask, sportspec=103, dportspec=203, index=[1])
         self.generate_rules(src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="100.0.0.4", dst_spec="200.0.0.4", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=104, dportspec=204, index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -562,6 +566,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(src_mask=self.ipv4_mask, src_spec="100.0.0.3", dst_spec="200.0.0.1", sportspec=100, dportspec=200, index=[1])
         self.generate_rules(src_mask=self.ipv4_mask, src_spec="100.0.0.4", dst_spec="200.0.0.1", sportspec=100, dportspec=200, index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -595,6 +601,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(dst_mask="255.255.255.0", src_spec="100.0.0.1", dst_spec="200.0.2.1", protospec=132, l4type="sctp", sportspec=100, dportspec=200, index=[1])
         self.generate_rules(dst_mask="255.255.255.0", src_spec="100.0.0.1", dst_spec="200.0.3.1", l4type="", index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -628,6 +636,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(src_spec="100.0.0.1", dst_spec="200.0.0.1", protospec=132, l4type="sctp", sportmask=self.portmask, sportspec=102, dportspec=200, index=[1])
         self.generate_rules(src_spec="100.0.0.1", dst_spec="200.0.0.1", sportmask=self.portmask, sportspec=103, dportspec=200, index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -671,6 +681,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, src_spec="ABCD:EF01:2345:6789:ABCD:EF01:2345:7789", protomask=self.protomask, protospec=132, l4type="sctp", index=[1])
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, src_spec="ABCD:EF01:2345:6789:ABCD:EF01:2345:8789", protomask=self.protomask, sportmask=self.portmask, sportspec=100, index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -728,6 +740,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, src_spec="ABCD:EF01:2345:6789:ABCD:EF01:2345:7789", index=[1])
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, src_spec="ABCD:EF01:2345:6789:ABCD:EF01:2345:8789", index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -767,6 +781,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(iptype="ipv6", dst_mask=self.ipv6_mask, dst_spec="ABCD:EF01:2345:6789:ABCD:EF01:2345:7789", index=[1])
         self.generate_rules(iptype="ipv6", dst_mask=self.ipv6_mask, dst_spec="ABCD:EF01:2345:6789:ABCD:EF01:2345:8789", index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -810,6 +826,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="2001::3", dst_spec="0::3", protomask=self.protomask, protospec=132, l4type="sctp", sportmask=self.portmask, dportmask=self.portmask, sportspec=103, dportspec=203, index=[1])
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="2001::4", dst_spec="0::4", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=104, dportspec=204, index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -849,28 +867,32 @@ class TestFlowClassifySoftnic(TestCase):
         self.start_testpmd(filename, self.port_num)
 
         # create rule
-        self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv4 proto mask 0 src mask 0.0.0.0 dst mask 255.255.255.255 src spec 100.0.0.1 dst spec 200.0.0.1 proto spec 17 / udp src mask 0 dst mask 0 src spec 100 dst spec 200 / end actions queue index 3 / end", "error", 60)
+        out = self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv4 proto mask 0 src mask 0.0.0.0 dst mask 255.255.255.255 src spec 100.0.0.1 dst spec 200.0.0.1 proto spec 17 / udp src mask 0 dst mask 0 src spec 100 dst spec 200 / end actions queue index 3 / end", "testpmd>", 60)
         self.dut.send_expect("quit", "# ", 60)
+        self.verify("error" in out, "should fail to create the rule")
 
         cmd = "pipeline RX table match hash ext key 8 mask FFFFFF0000000000 offset 286 buckets 16K size 64K action AP0"
         self.set_table(cmd, filename)
         self.start_testpmd(filename, self.port_num)
-        self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv4 proto mask 0 src mask 0.0.0.0 dst mask 255.255.255.255 src spec 100.0.0.1 dst spec 200.0.0.1 proto spec 17 / udp src mask 0 dst mask 0 src spec 100 dst spec 200 / end actions queue index 3 / end", "error", 60)
+        out = self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv4 proto mask 0 src mask 0.0.0.0 dst mask 255.255.255.255 src spec 100.0.0.1 dst spec 200.0.0.1 proto spec 17 / udp src mask 0 dst mask 0 src spec 100 dst spec 200 / end actions queue index 3 / end", "testpmd>", 60)
         self.dut.send_expect("quit", "# ", 60)
+        self.verify("error" in out, "should fail to create the rule")
 
         # ipv6
         filename = "flow_ipv6_5tuple_hash_firmware.cli"
         cmd = "pipeline RX table match hash ext key 64 mask 0000FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 offset 274 buckets 16K size 64K action AP0"
         self.set_table(cmd, filename)
         self.start_testpmd(filename, self.port_num)
-        self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv6 proto mask 255 src mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff dst mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff src spec 2001::1 dst spec 0::1 proto spec 17 / udp src mask 0 dst mask 65535 src spec 31 dst spec 41 / end actions queue index 3 / end", "error", 60)
+        out = self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv6 proto mask 255 src mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff dst mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff src spec 2001::1 dst spec 0::1 proto spec 17 / udp src mask 0 dst mask 65535 src spec 31 dst spec 41 / end actions queue index 3 / end", "testpmd>", 60)
         self.dut.send_expect("quit", "# ", 60)
+        self.verify("error" in out, "should fail to create the rule")
 
         cmd = "pipeline RX table match hash ext key 16 mask FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF offset 294 buckets 16K size 64K action AP0"
         self.set_table(cmd, filename)
         self.start_testpmd(filename, self.port_num)
-        self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv6 proto mask 0  src mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff dst mask 0:0:0:0:0:0:0:0 src spec ABCD:EF01:2345:6789:ABCD:EF01:2345:5789 dst spec 0:0:0:0:0:0:0:0 proto spec 17 / udp src mask 0 dst mask 0 src spec 0 dst spec 0 / end actions queue index 3 / end", "error", 60)
+        out = self.dut.send_expect("flow create 4 group 0 ingress pattern eth / ipv6 proto mask 0  src mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff dst mask 0:0:0:0:0:0:0:0 src spec ABCD:EF01:2345:6789:ABCD:EF01:2345:5789 dst spec 0:0:0:0:0:0:0:0 proto spec 17 / udp src mask 0 dst mask 0 src spec 0 dst spec 0 / end actions queue index 3 / end", "testpmd>", 60)
         self.dut.send_expect("quit", "# ", 60)
+        self.verify("error" in out, "should fail to create the rule")
 
     def test_ipv4_hash_rss_action(self):
         """
@@ -889,6 +911,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="100.0.0.3", dst_spec="200.0.0.3", protomask=self.protomask, protospec=132, l4type="sctp", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[1])
         self.generate_rules(src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="100.0.0.4", dst_spec="200.0.0.4", protomask=self.protomask, protospec=6, l4type="tcp", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -926,6 +950,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(src_mask="255.255.255.0", dst_mask=self.ipv4_mask, src_spec="100.0.0.1", dst_spec="200.0.0.1", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[0, 1, 2, 3])
         self.generate_rules(src_mask="255.255.255.0", dst_mask=self.ipv4_mask, src_spec="100.0.1.2", dst_spec="200.0.0.1", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[0, 1, 2, 3])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         self.send_continuous_packet("ipv4", "src", "100.0.0.1", "200.0.0.1", self.tester_itf)
         out = self.dut.send_expect("stop", "testpmd> ", 120)
@@ -945,6 +971,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(src_mask="255.255.0.0", dst_mask=self.ipv4_mask, src_spec="100.0.0.1", dst_spec="200.0.0.2", sportspec=100, dportspec=200, action="rss", index=[2, 3])
         self.generate_rules(src_mask="255.255.0.0", dst_mask=self.ipv4_mask, src_spec="200.0.0.1", dst_spec="200.0.0.2", sportspec=100, dportspec=200, action="rss", index=[1, 2])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         self.send_continuous_packet("ipv4", "src", "100.0.0.1", "200.0.0.1", self.tester_itf)
         out = self.dut.send_expect("stop", "testpmd> ", 120)
@@ -977,6 +1005,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="2001::3", dst_spec="1001::3", protomask=self.protomask, protospec=132, l4type="sctp", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[1])
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="2001::4", dst_spec="1001::4", protomask=self.protomask, protospec=6, l4type="tcp", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[0])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1014,6 +1044,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(iptype="ipv6", src_mask="ffff:ffff:ffff:ffff:ffff:ffff:ffff:0", dst_mask=self.ipv6_mask, src_spec="ABCD:EF01:2345:6789:ABCD:EF01:2345:0", dst_spec="0::1", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[0, 1, 2, 3])
         self.generate_rules(iptype="ipv6", src_mask="ffff:ffff:ffff:ffff:ffff:ffff:ffff:0", dst_mask=self.ipv6_mask, src_spec="ABCD:EF01:2345:6789:ABCD:EF01:2346:0", dst_spec="0::1", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[0, 1, 2, 3])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         self.send_continuous_packet("ipv6", "src", "ABCD:EF01:2345:6789:ABCD:EF01:2345:0", "0::1", self.tester_itf)
         out = self.dut.send_expect("stop", "testpmd> ", 120)
@@ -1033,6 +1065,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, dst_mask="ffff:ffff:ffff:ffff:ffff:ffff:ffff:0", src_spec="2001::2", dst_spec="1001::1", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[2, 3])
         self.generate_rules(iptype="ipv6", src_mask=self.ipv6_mask, dst_mask="ffff:ffff:ffff:ffff:ffff:ffff:ffff:0", src_spec="2001::1", dst_spec="1002::1", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="rss", index=[1, 2])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         self.send_continuous_packet("ipv6", "dst", "2001::1", "1001::1", self.tester_itf)
         out = self.dut.send_expect("stop", "testpmd> ", 120)
@@ -1061,6 +1095,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, dst_mask="255.192.0.0", dst_spec="200.0.0.0", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, dst_mask="255.192.0.0", dst_spec="200.64.0.0", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1105,6 +1141,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="1.10.11.0", dst_spec="2.20.21.0", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="1.10.11.1", dst_spec="2.20.21.1", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1149,6 +1187,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="1.10.11.0", dst_spec="2.20.21.0", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, src_mask=self.ipv4_mask, dst_mask=self.ipv4_mask, src_spec="1.10.11.1", dst_spec="2.20.21.1", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1189,6 +1229,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, src_mask=self.ipv4_mask, dst_mask="255.255.255.0", src_spec="1.10.11.0", dst_spec="2.20.21.0", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, src_mask=self.ipv4_mask, dst_mask="255.255.255.0", src_spec="1.10.11.1", dst_spec="2.20.21.1", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1229,6 +1271,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, iptype="ipv6", dst_mask=self.ipv6_mask, src_spec="1001::1", dst_spec="2001::1", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, iptype="ipv6", dst_mask=self.ipv6_mask, src_spec="1001::1", dst_spec="2001::2", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1266,6 +1310,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="1001::1", dst_spec="2001::1", protomask=self.protomask, sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="1001::2", dst_spec="2001::2", protomask=self.protomask, protospec=6, l4type="tcp", sportmask=self.portmask, dportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1310,6 +1356,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, iptype="ipv6", dst_mask=self.ipv6_mask, src_spec="1001::1", dst_spec="2001::1", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, iptype="ipv6", dst_mask=self.ipv6_mask, src_spec="1001::2", dst_spec="2001::2", protomask=self.protomask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
@@ -1348,6 +1396,8 @@ class TestFlowClassifySoftnic(TestCase):
         self.generate_rules(port=port_num, iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="1001::1", dst_spec="2001::1", protomask=self.protomask, sportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.generate_rules(port=port_num, iptype="ipv6", src_mask=self.ipv6_mask, dst_mask=self.ipv6_mask, src_spec="1001::2", dst_spec="2001::2", protomask=self.protomask, sportmask=self.portmask, sportspec=100, dportspec=200, action="jump", index=[1])
         self.dut.send_expect("start", "testpmd> ", 60)
+        ret = self.pmdout.wait_link_status_up("all", 15)
+        self.verify(ret is True, "port link is down")
 
         # rule 0 test
         pcap_file = '/tmp/route_0.pcap'
-- 
2.17.1


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14 18:16 [dts] [PATCH V1] tests/flow_classify_softnic: optimize script Wenjie Li
2019-08-14  9:22 ` Wu, ChangqingX

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox