From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C8E26A0096 for ; Mon, 6 May 2019 04:34:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 802F52BAB; Mon, 6 May 2019 04:34:16 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 42D781F28 for ; Mon, 6 May 2019 04:34:14 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2019 19:34:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,435,1549958400"; d="scan'208";a="140317153" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 05 May 2019 19:34:12 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 5 May 2019 19:34:12 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 5 May 2019 19:34:11 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.10]) with mapi id 14.03.0415.000; Mon, 6 May 2019 10:34:09 +0800 From: "Ma, LihongX" To: "dts@dpdk.org" Thread-Topic: [dts][PATCH V2] improve the method of verify_result Thread-Index: AQHU/lUzARB95nhQeESq2BYYtAJmZqZda5ew Date: Mon, 6 May 2019 02:34:09 +0000 Message-ID: References: <1556493078-5927-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1556493078-5927-1-git-send-email-lihongx.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2] improve the method of verify_result X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Tested-by: lihong -----Original Message----- From: Ma, LihongX=20 Sent: Monday, April 29, 2019 7:11 AM To: dts@dpdk.org Cc: Ma, LihongX Subject: [dts][PATCH V2] improve the method of verify_result when the testpmd receive the miscellaneous packet, we should judge to wheth= er the packet is expeceted, so modify the verify method. Signed-off-by: lihong --- tests/TestSuite_generic_flow_api.py | 209 +++++++++++++++++++++-----------= ---- 1 file changed, 120 insertions(+), 89 deletions(-) diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_= flow_api.py index af27477..feaddce 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -155,36 +155,65 @@ class TestGeneric_flow_api(TestCase): elif module =3D=3D "nvgre": self.tester.scapy_append('from nvgre import NVGRE') =20 - def verify_result(self, pf_vf, expect_rxpkts, expect_queue): + def verify_result(self, pf_vf, expect_rxpkts, expect_queue, verify_mac= ): """ verify the packet to the expected queue or be dropped """ self.tester.scapy_execute() time.sleep(2) + verify_mac =3D verify_mac.upper() =20 if self.vf_flag =3D=3D 1: + out_vf0 =3D=20 + self.session_secondary.get_session_before(timeout=3D2) outstring_vf0 =3D self.session_secondary.send_expect("stop", "= testpmd> ", 120) + out_vf1 =3D self.session_third.get_session_before(timeout=3D2) outstring_vf1 =3D self.session_third.send_expect("stop", "test= pmd> ", 120) + self.logger.info("vf0: %s" % out_vf0) + self.logger.info("vf1: %s" % out_vf1) + out_pf =3D self.dut.get_session_output(timeout=3D2) outstring_pf =3D self.dut.send_expect("stop", "testpmd> ", 120) + self.logger.info("pf: %s" % out_pf) time.sleep(2) + if expect_rxpkts =3D=3D "0": if pf_vf =3D=3D "pf": - self.verify("Queue" not in outstring_pf, "the packet is no= t dropped.") + self.verify(verify_mac not in out_pf, "the packet is=20 + not dropped.") elif pf_vf =3D=3D "vf0": - self.verify("Queue" not in outstring_vf0, "the packet is n= ot dropped.") + self.verify(verify_mac not in out_vf0, "the packet is=20 + not dropped.") else: - self.verify("Queue" not in outstring_vf1, "the packet is n= ot dropped.") + self.verify(verify_mac not in out_vf1, "the packet is=20 + not dropped.") else: - result_scanner =3D r"Forward Stats for RX Port=3D %s/Queue=3D\= s?([0-9]+)" % self.dut_ports[0] + result_scanner =3D r"port\s*%s/queue\s?[0-9]+" %=20 + self.dut_ports[0] scanner =3D re.compile(result_scanner, re.DOTALL) if pf_vf =3D=3D "pf": - m =3D scanner.search(outstring_pf) + self.verify(verify_mac in out_pf, "the pf not receive the = expect packet.") + out_info =3D out_pf elif pf_vf =3D=3D "vf0": - m =3D scanner.search(outstring_vf0) + self.verify(verify_mac in out_vf0, "the vf0 not receive th= e expect packet.") + out_info =3D out_vf0 else: - m =3D scanner.search(outstring_vf1) - queue_id =3D m.group(1) - self.verify(int(expect_queue) =3D=3D int(queue_id), "the actua= l queue doesn't equal to the expected queue.") + self.verify(verify_mac in out_vf1, "the vf1 not receive th= e expect packet.") + out_info =3D out_vf1 + + # find the expected packet receive position + mac_index =3D out_info.find("dst=3D%s" % verify_mac) + m =3D scanner.findall(out_info) + # get all the port 0/queue X str position + # and calculate the port 0/queue X info of expected packet + all_queue_index =3D [] + queue_index =3D 0 + find_index =3D False + for i in range(len(m)): + cur =3D out_info.find(m[i], all_queue_index[i-1] + len(m[i= -1]) if i > 0 else 0) + if cur > mac_index: + queue_index =3D i - 1 + find_index =3D True + break + all_queue_index.append(cur) + if find_index is False: + queue_index =3D len(m) - 1 + curr_queue =3D int(m[queue_index][len("port 0/queue"):]) + self.verify(int(expect_queue) =3D=3D curr_queue, "the actual=20 + queue doesn't equal to the expected queue.") =20 self.dut.send_expect("start", "testpmd> ") =20 @@ -287,28 +316,30 @@ class TestGeneric_flow_api(TestCase): =20 # The rule is created successfully, so send the consistent= packet. self.tester.scapy_append('sendp(%s, iface=3D"%s")' % (flow= _pkt, self.tester_itf)) + cur_mac =3D re.search("dst=3D'(\S\S:\S\S:\S\S:\S\S:\S\S:\S= \S)'", flow_pkt) + cur_mac =3D cur_mac.group(1) if ("queue" in flow_action['actions']) or ("passthru" in f= low_action['actions']): if ("vf0" in flow_action['flows']) or ("vf0" in flow_a= ction['actions']): - self.verify_result("vf0", expect_rxpkts=3D"1", exp= ect_queue=3Dflow_queue) + self.verify_result("vf0", expect_rxpkts=3D"1",=20 + expect_queue=3Dflow_queue, verify_mac=3Dcur_mac) elif "vf1" in flow_action['flows'] or "vf1" in flow_ac= tion['actions']: - self.verify_result("vf1", expect_rxpkts=3D"1", exp= ect_queue=3Dflow_queue) + self.verify_result("vf1", expect_rxpkts=3D"1",=20 + expect_queue=3Dflow_queue, verify_mac=3Dcur_mac) else: - self.verify_result("pf", expect_rxpkts=3D"1", expe= ct_queue=3Dflow_queue) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dflow_queue, verify_mac=3Dcur_mac) elif "drop" in flow_action['actions']: if ("vf0" in flow_action['flows']) or ("vf0" in flow_a= ction['actions']): - self.verify_result("vf0", expect_rxpkts=3D"0", exp= ect_queue=3D"NULL") + self.verify_result("vf0", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dcur_mac) elif ("vf1" in flow_action['flows']) or ("vf1" in flow= _action['actions']): - self.verify_result("vf1", expect_rxpkts=3D"0", exp= ect_queue=3D"NULL") + self.verify_result("vf1", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dcur_mac) else: - self.verify_result("pf", expect_rxpkts=3D"0", expe= ct_queue=3D"NULL") + self.verify_result("pf", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dcur_mac) # L2-tunnel filter else: if "vf0" in flow_action['actions']: - self.verify_result("vf0", expect_rxpkts=3D"1", exp= ect_queue=3D"0") + self.verify_result("vf0", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dcur_mac) elif "vf1" in flow_action['actions']: - self.verify_result("vf1", expect_rxpkts=3D"1", exp= ect_queue=3D"0") + self.verify_result("vf1", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dcur_mac) elif "pf" in flow_action['actions']: - self.verify_result("pf", expect_rxpkts=3D"1", expe= ct_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dcur_mac) # Return the status of the rule. return rule_created =20 @@ -629,11 +660,11 @@ class TestGeneric_flow_api(TestCase): # send the packets and verify the results self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(dport=3D80,flags=3D"S")/Raw("x" * 20)], iface=3D"%s")' % (self= .pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"3") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"3",= =20 + verify_mac=3Dself.pf_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(dport=3D80,flags=3D"PA")/Raw("x" * 20)], iface=3D"%s")' % (sel= f.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) =20 # the ipv6 rule is conflicted with ipv4 rule. self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ", 120) @@= -644,11 +675,11 @@ class TestGeneric_flow_api(TestCase): # send the packets and verify the results self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D"2001::2= ")/TCP(dport=3D80,flags=3D"S")/Raw("x" * 20)], iface=3D"%s")' % (self.pf_ma= c, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"4") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"4",= =20 + verify_mac=3Dself.pf_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D"2001::2= ")/TCP(dport=3D80,flags=3D"PA")/Raw("x" * 20)], iface=3D"%s")' % (self.pf_m= ac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) =20 self.verify_rulenum(1) =20 @@ -676,13 +707,13 @@ class TestGeneric_flow_api(TestCase): # send the packets inconsistent to the rules. self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"%s", dst=3D"%s")/Raw("x" *= 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[0]['dip'], extra_packet[= 0]['sip'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"%s", dst=3D"%s")/SCTP(spor= t=3D%s,dport=3D%s)/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, extra_pac= ket[3]['dip'], extra_packet[3]['sip'], extra_packet[3]['sport'], extra_pack= et[3]['dport'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"%s", dst=3D"%s")/SCTP(spor= t=3D%s,dport=3D%s)/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, extra_pac= ket[0]['sip'], extra_packet[0]['dip'], extra_packet[3]['sport'], extra_pack= et[3]['dport'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][0]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][0], verify_mac=3Dself.pf_mac) =20 rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) @@ -710,10 +741,10 @@ class TestGeneric_flow_api(TestCase): # send the packets inconsistent to the rules. self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/UDP(sport=3D22,dport=3D24)/Raw("x" * 20)], iface=3D"%s")' % (self.= pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(sport=3D32,dport=3D34)/Raw("x" * 20)], iface=3D"%s")' % (self.= pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 @@ -765,7 +796,7 @@ class TestGeneric_flow_api(TestCase): extrapkt_rulenum =3D self.all_flows_process(basic_flow_actions= ) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s",type=3D0x88E5)/Raw("x" * 20)], if= ace=3D"%s")' % (self.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 @@ -810,7 +841,7 @@ class TestGeneric_flow_api(TestCase): extra_packet =3D extrapkt_rulenum['extrapacket'] self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1BR(GRP=3D0x2, ECIDbase=3D%s)/Raw= ("x" * 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[0]['etag'], self.t= ester_itf)) - self.verify_result("pf", expect_rxpkts=3D"0", expect_queue=3D"NULL= ") + self.verify_result("pf", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 @@ -884,46 +915,46 @@ class TestGeneric_flow_api(TestCase): # send the packets with dst/src ip and dst/src port. self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0= .1", dst=3D"192.168.0.2", proto=3D3)/Raw("x" * 20)], iface=3D"%s")' % (self= .pf_mac, extra_packet[0]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][0]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][0], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0= .1", dst=3D"192.168.0.2", tos=3D3)/UDP()/Raw("x" * 20)], iface=3D"%s")' % (= self.pf_mac, extra_packet[1]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][1]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][1], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0= .1", dst=3D"192.168.0.2", ttl=3D3)/TCP()/Raw("x" * 20)], iface=3D"%s")' % (= self.pf_mac, extra_packet[2]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][2]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][2], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0= .1", dst=3D"192.168.0.2", tos=3D3, ttl=3D3)/SCTP()/Raw("x" * 20)], iface=3D= "%s")' % (self.pf_mac, extra_packet[3]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][3]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][3], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0= .1", dst=3D"192.168.0.2", ttl=3D3)/TCP()/Raw("x" * 20)], iface=3D"%s")' % (= self.pf_mac, extra_packet[3]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP()/UDP()/Raw("x" = * 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[2]['vlan'], self.tester= _itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0= .5", dst=3D"192.168.0.6", tos=3D3, ttl=3D3)/SCTP(sport=3D44,dport=3D45,tag= =3D1)/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[6]['vlan'= ], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"0", expect_queue=3D"NULL= ") + self.verify_result("pf", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0= .5", dst=3D"192.168.0.6", tos=3D3, ttl=3D3)/UDP(sport=3D44,dport=3D45)/SCTP= ChunkData(data=3D"X" * 20)], iface=3D"%s")' % (self.outer_mac, extra_packet= [7]['vlan'], self.tester_itf)) - self.verify_result("vf1", expect_rxpkts=3D"0", expect_queue=3D"NUL= L") + self.verify_result("vf1", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1= ", dst=3D"2001::2", tc=3D1, nh=3D5, hlim=3D10)/Raw("x" * 20)], iface=3D"%s"= )' % (self.pf_mac, extra_packet[8]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][8]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][8], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1= ", dst=3D"2001::2", tc=3D2, hlim=3D20)/UDP(sport=3D22,dport=3D23)/Raw("x" *= 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[9]['vlan'], self.tester_= itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][9]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][9], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1= ", dst=3D"2001::2", tc=3D2, hlim=3D20)/TCP(sport=3D32,dport=3D33)/Raw("x" *= 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[10]['vlan'], self.tester= _itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][10]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][10], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1= ", dst=3D"2001::2", tc=3D4, nh=3D132, hlim=3D40)/SCTP(sport=3D44,dport=3D45= ,tag=3D1)/SCTPChunkData(data=3D"X" * 20)], iface=3D"%s")' % (self.pf_mac, e= xtra_packet[11]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][11]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][11], verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1= ", dst=3D"2001::2", tc=3D4, nh=3D132, hlim=3D40)/SCTP(sport=3D44,dport=3D45= ,tag=3D1)/SCTPChunkData(data=3D"X" * 20)], iface=3D"%s")' % (self.pf_mac, e= xtra_packet[14]['vlan'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"0", expect_queue=3D"NULL= ") + self.verify_result("pf", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1= ", dst=3D"2001::2", tc=3D2, hlim=3D20)/TCP(sport=3D32,dport=3D33)/Raw("x" *= 20)], iface=3D"%s")' % (self.outer_mac, extra_packet[15]['vlan'], self.tes= ter_itf)) - self.verify_result("vf1", expect_rxpkts=3D"0", expect_queue=3D"NUL= L") + self.verify_result("vf1", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dself.outer_mac) =20 rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) @@ -977,7 +1008,7 @@ class TestGeneric_flow_api(TestCase): extra_packet =3D extrapkt_rulenum['extrapacket'] self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.3", dst=3D"1= 92.168.0.4", proto=3D%s)/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, ext= ra_packet[0]['proto'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 @@ -1001,7 +1032,7 @@ class TestGeneric_flow_api(TestCase): extra_packet =3D extrapkt_rulenum['extrapacket'] self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"%s", dst=3D"%s")/S= CTP(sport=3D%s,dport=3D%s)/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, e= xtra_packet[2]['sip'], extra_packet[2]['dip'], extra_packet[2]['dport'], ex= tra_packet[2]['sport'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) else: @@ -1015,7 +1046,7 @@ class TestGeneric_flow_api(TestCase): extra_packet =3D extrapkt_rulenum['extrapacket'] self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"%s", dst=3D"%s")/S= CTP()/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[2]['dip']= , extra_packet[2]['sip'], self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 @@ -1061,7 +1092,7 @@ class TestGeneric_flow_api(TestCase): extra_packet =3D extrapkt_rulenum['extrapacket'] self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"200= 1::1", dst=3D"2001::2", tc=3D2, hlim=3D20)/UDP(sport=3D22,dport=3D23)/Raw("= x" * 20)], iface=3D"%s")' % (self.pf_mac, extra_packet[1]['vlan'], self.tes= ter_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 @@ -1089,13 +1120,13 @@ class TestGeneric_flow_api(TestCase): extra_packet =3D extrapkt_rulenum['extrapacket'] self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D= "2001::2",nh=3D132)/SCTP()/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, s= elf.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst= =3D"192.168.0.2")/SCTP()/Raw("x" * 20)], iface=3D"%s")' % (self.pf_mac, sel= f.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D= "2001::2")/UDP(sport=3D22,dport=3D23)/Raw("x" * 20)], iface=3D"%s")' % (sel= f.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"1") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"1", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num+1) elif (self.nic in ["sagepond", "sageville"]): @@ -1113,13 +1144,13 @@ class TestGeneric_flow_api(TestCase): extra_packet =3D extrapkt_rulenum['extrapacket'] self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"%s", dst=3D"%s",= nh=3D132)/SCTP(sport=3D32,dport=3D33,tag=3D1)/Raw("x" * 20)], iface=3D"%s"= )' % (self.pf_mac, extra_packet[3]['sip'], extra_packet[3]['dip'], self.tes= ter_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"%s", dst=3D"%s", p= roto=3D132)/SCTP(sport=3D32,dport=3D33)/Raw("x" * 20)], iface=3D"%s")' % (s= elf.pf_mac, extra_packet[4]['dip'], extra_packet[4]['sip'], self.tester_itf= )) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.pf_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D= "2001::2")/UDP(sport=3D22,dport=3D23)/Raw("x" * 20)], iface=3D"%s")' % (sel= f.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"1") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"1", verify_mac=3Dself.pf_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num+1) =20 @@ -1162,27 +1193,27 @@ class TestGeneric_flow_api(TestCase): # send the packets and verify the results self.tester.scapy_append( 'sendp([Ether(dst=3D"%s", type=3D0x0807)/Raw(load=3D"abcde= fghijklmnop")], iface=3D"%s")' % (self.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 1") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"1", verify_mac=3Dself.pf_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D4095)/IP(src=3D"192= .168.0.1", dst=3D"192.168.0.2", proto=3D255, ttl=3D40)/Raw(load=3D"xxabxxxx= xxxxxxabcdefghijabcdefg")], iface=3D"%s")' % (self.pf_mac, self.tester_itf)= ) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 2") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"2", verify_mac=3Dself.pf_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"2.2.2.4", dst=3D"2.2.2= .5")/UDP(sport=3D22,dport=3D23)/Raw(load=3D"fhfhdsdsfwef")], iface=3D"%s")'= % (self.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 3") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"3", verify_mac=3Dself.pf_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"2.2.2.4", dst=3D"2.2.2= .5", tos=3D4, ttl=3D3)/TCP(sport=3D32,dport=3D33)/Raw(load=3D"fhhijk")], if= ace=3D"%s")' % (self.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 4") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"4", verify_mac=3Dself.pf_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"2.2.2.4", dst=3D"2.2.2= .5")/SCTP(sport=3D42,dport=3D43,tag=3D1)/Raw(load=3D"xxabcdefghijklmnopqrst= ")], iface=3D"%s")' % (self.pf_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 5") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"5", verify_mac=3Dself.pf_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"2.2.2.4", dst=3D"2.2.2= .5")/SCTP(sport=3D42,dport=3D43,tag=3D1)/Raw(load=3D"xxabxxxabcddxxabcdefgh= ijklmn")], iface=3D"%s")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.outer_mac) =20 self.verify_rulenum(5) =20 @@ -1202,7 +1233,7 @@ class TestGeneric_flow_api(TestCase): # send the packet and verify the result self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D1)/IPv6(src=3D"2001= ::1", dst=3D"2001::2", tc=3D3, hlim=3D30)/TCP(sport=3D32,dport=3D33)/Raw(lo= ad=3D"hijkabcdefghabcdefghijklmn")], iface=3D"%s")' % (self.outer_mac, self= .tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 6") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"6", verify_mac=3Dself.outer_mac) =20 # ixgbe else: @@ -1219,7 +1250,7 @@ class TestGeneric_flow_api(TestCase): # send the packet and verify the result self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"1= 92.168.0.2")/UDP(sport=3D24,dport=3D25)/Raw(load=3D"xx86ddef")], iface=3D"%= s")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 1") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"1", verify_mac=3Dself.outer_mac) =20 self.dut.send_expect("quit", "# ") time.sleep(2) @@ -1238,11 +1269,11 @@ class TestGeneric_flow_api(TestCase): # send the packet and verify the result self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.3", dst=3D"1= 92.168.0.4")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"abcdxxx")], iface=3D"%s= ")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.outer_mac) =20 self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.3", dst=3D"1= 92.168.0.4")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"cdcdxxx")], iface=3D"%s= ")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 2") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"2", verify_mac=3Dself.outer_mac) =20 self.dut.send_expect("quit", "# ") time.sleep(2) @@ -1265,10 +1296,10 @@ class TestGeneric_flow_api(TestCase): # send the packet and verify the result self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"1= 92.168.0.2")/SCTP(sport=3D24,dport=3D25)/Raw(load=3D"xxabcdef")], iface=3D"= %s")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 3") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"3", verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"1= 92.168.0.2")/SCTP(sport=3D24,dport=3D25)/Raw(load=3D"xxaccdef")], iface=3D"= %s")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"= 0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.outer_mac) =20 # ipv6-other-flexbytes if (self.nic in ["niantic", "twinville"]): @@ -1285,10 +1316,10 @@ class TestGeneric_flow_api(TestCase): "flow create 0 ingress pattern fuzzy thresh is 6 / ipv= 6 src is 2001::1 dst is 2001::2 / raw relative is 0 search is 0 offset is 5= 6 limit is 0 pattern is 86 / end actions queue index 4 / end", "created") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D= "2001::2")/Raw(load=3D"xx86abcd")], iface=3D"%s")' % (self.outer_mac, self.= tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"4") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"4", verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D= "2001::2")/Raw(load=3D"xxx86abcd")], iface=3D"%s")' % (self.outer_mac, self= .tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue= =3D"0") + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3D"0", verify_mac=3Dself.outer_mac) =20 def test_flexbytes_filter(self): """ @@ -1325,31 +1356,31 @@ class TestGeneric_flow_api(TestCase): # send the packet and verify the result self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Raw(load=3D"fhdsab")], iface=3D"%s")= ' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"1") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"1",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/Raw(load=3D"afhdsb")], iface=3D"%s")= ' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/Raw(load=3D"abcdef")], iface=3D"%s")' % (self.outer_mac, self.test= er_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"2") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"2",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D"2001::2= ")/Raw(load=3D"xxxxefgh")], iface=3D"%s")' % (self.outer_mac, self.tester_i= tf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"3") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"3",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IPv6(src=3D"2001::1", dst=3D"2001::2= ")/TCP(sport=3D32,dport=3D33)/Raw(load=3D"abcdefgh")], iface=3D"%s")' % (se= lf.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/Raw(load=3D"cdxxabxxefghxxxx")], iface=3D"%s")' % (self.outer_mac,= self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"4") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"4",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2", tos=3D4, ttl=3D3)/UDP(sport=3D32,dport=3D33)/Raw(load=3D"xxefghabc= dxxxxxxhijklmnopqxxxx")], iface=3D"%s")' % (self.outer_mac, self.tester_itf= )) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"5") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"5",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"xxxxxxxxxxabxxklmnefgh")], = iface=3D"%s")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"6") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"6",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"xxxxxxxxxxabxxklcdefgh")], = iface=3D"%s")' % (self.outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) =20 self.dut.send_expect("flow flush 0", "testpmd> ", 120) =20 @@ -1369,16 +1400,16 @@ class TestGeneric_flow_api(TestCase): # send the packet and verify the result self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"xxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxab")], iface=3D"%s")' % (self.= outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"1") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"1",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"xxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcb")], iface=3D"%s")' % (self.= outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"xxxxxxxxxxxxxxabxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcd")], iface=3D"%s")' % (self.= outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"2") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"2",= =20 + verify_mac=3Dself.outer_mac) self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1", dst=3D"192.1= 68.0.2")/TCP(sport=3D22,dport=3D23)/Raw(load=3D"xxxxxxxxxxxxxxabxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxce")], iface=3D"%s")' % (self.= outer_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) =20 self.verify_rulenum(2) =20 @@ -1488,22 +1519,22 @@ class TestGeneric_flow_api(TestCase): self.load_module("vxlan") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/UDP()/Vxlan()/Ether(dst=3D"%s")= /Dot1Q(vlan=3D11)/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self.outer_m= ac, self.inner_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][0]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][0], verify_mac=3Dself.outer_mac) =20 self.load_module("vxlan") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/UDP()/Vxlan(vni=3D5)/Ether(dst= =3D"%s")/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self.outer_mac, self.= wrong_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) =20 self.load_module("vxlan") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/UDP()/Vxlan(vni=3D%s)/Ether(dst= =3D"%s")/Dot1Q(vlan=3D%s)/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self= .outer_mac, extra_packet[5]['vni'], self.wrong_mac, extra_packet[5]['invlan= '], self.tester_itf)) - self.verify_result("vf0", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("vf0", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) =20 self.load_module("vxlan") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/UDP()/Vxlan(vni=3D%s)/Ether(dst= =3D"%s")/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self.wrong_mac, extra= _packet[6]['vni'], self.inner_mac, self.tester_itf)) - self.verify_result("vf1", expect_rxpkts=3D"0", expect_queue=3D"NUL= L") + self.verify_result("vf1", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dself.wrong_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 @@ -1547,22 +1578,22 @@ class TestGeneric_flow_api(TestCase): self.load_module("nvgre") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/NVGRE()/Ether(dst=3D"%s")/Dot1Q= (vlan=3D1)/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self.outer_mac, sel= f.inner_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3Dextra= pkt_rulenum['queue'][0]) + self.verify_result("pf", expect_rxpkts=3D"1",=20 + expect_queue=3Dextrapkt_rulenum['queue'][0], verify_mac=3Dself.outer_mac) =20 self.load_module("nvgre") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/NVGRE(TNI=3D%s)/Ether(dst=3D"%s= ")/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self.outer_mac, extra_packe= t[4]['tni'], self.wrong_mac, self.tester_itf)) - self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("pf", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) =20 self.load_module("nvgre") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/NVGRE(TNI=3D%s)/Ether(dst=3D"%s= ")/Dot1Q(vlan=3D%s)/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self.outer= _mac, extra_packet[5]['tni'], self.wrong_mac, extra_packet[5]['invlan'], se= lf.tester_itf)) - self.verify_result("vf0", expect_rxpkts=3D"1", expect_queue=3D"0") + self.verify_result("vf0", expect_rxpkts=3D"1", expect_queue=3D"0",= =20 + verify_mac=3Dself.outer_mac) =20 self.load_module("nvgre") self.tester.scapy_append( 'sendp([Ether(dst=3D"%s")/IP()/NVGRE(TNI=3D%s)/Ether(dst=3D"%s= ")/IP()/TCP()/Raw("x" * 20)], iface=3D"%s")' % (self.wrong_mac, extra_packe= t[6]['tni'], self.inner_mac, self.tester_itf)) - self.verify_result("vf1", expect_rxpkts=3D"0", expect_queue=3D"NUL= L") + self.verify_result("vf1", expect_rxpkts=3D"0",=20 + expect_queue=3D"NULL", verify_mac=3Dself.wrong_mac) rule_num =3D extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) =20 -- 2.7.4