From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EBD58E72 for ; Wed, 20 Jan 2016 09:43:55 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 20 Jan 2016 00:43:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,320,1449561600"; d="scan'208";a="730935647" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 20 Jan 2016 00:43:54 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 20 Jan 2016 00:43:53 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.218]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.215]) with mapi id 14.03.0248.002; Wed, 20 Jan 2016 16:43:51 +0800 From: "Liu, Yong" To: "dts@dpdk.org" Thread-Topic: [dts][PATCH] tests: support RRC nic Thread-Index: AQHRUyk35J3lTxHXVka4n6uLZ/0FMZ8EFrUA Date: Wed, 20 Jan 2016 08:43:50 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E13B11642@SHSMSX103.ccr.corp.intel.com> References: <1453256446-12238-1-git-send-email-yong.liu@intel.com> In-Reply-To: <1453256446-12238-1-git-send-email-yong.liu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2JmZTdhMDctYWJkZi00MGQ0LTk5MmYtNWRiZjNiZjUxOTRmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYkorSXdGQ2FkY0ZIQkdEQTNueThxZ01tVytNU3JxTWpJZ1dBVVp5bTg0bz0ifQ== x-ctpclassification: CTP_IC 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] tests: support RRC nic 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: , X-List-Received-Date: Wed, 20 Jan 2016 08:43:57 -0000 All RRC/Atwood related patches will be merged into next branch. After all t= ests done, will merge back to master. Thanks. > -----Original Message----- > From: Liu, Yong > Sent: Wednesday, January 20, 2016 10:21 AM > To: dts@dpdk.org > Cc: Liu, Yong > Subject: [dts][PATCH] tests: support RRC nic >=20 > RRC validation enabled on checksum offload, jumboframe, mac > filter, rss, queue start stop, scatter, tso and vlan. >=20 > Signed-off-by: Marvin Liu >=20 > diff --git a/tests/TestSuite_checksum_offload.py > b/tests/TestSuite_checksum_offload.py > index 7a53452..3522c80 100644 > --- a/tests/TestSuite_checksum_offload.py > +++ b/tests/TestSuite_checksum_offload.py > @@ -68,7 +68,6 @@ class TestChecksumOffload(TestCase): > (self.portMask) + "--disable-hw- > vlan --enable-rx-cksum --crc-strip", socket=3Dself.ports_socket) > self.dut.send_expect("set verbose 1", "testpmd>") > self.dut.send_expect("set fwd csum", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") >=20 > def checksum_enablehw(self, port): > self.dut.send_expect("csum set ip hw %d" % port, "testpmd>") > @@ -89,15 +88,13 @@ class TestChecksumOffload(TestCase): > tx_interface =3D > self.tester.get_interface(self.tester.get_local_port(self.dut_ports[1])) > rx_interface =3D > self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0])) >=20 > - sniff_src =3D self.dut.get_mac_address(self.dut_ports[0]) > + sniff_src =3D self.dut.get_mac_address(self.dut_ports[0]) > checksum_pattern =3D re.compile("chksum.*=3D.*(0x[0-9a-z]+)") >=20 > chksum =3D dict() > result =3D dict() >=20 > self.tester.send_expect("scapy", ">>> ") > - self.tester.send_expect('sys.path.append("./")', ">>> ") > - self.tester.send_expect('from sctp import *', ">>> ") >=20 > for packet_type in packets_expected.keys(): > self.tester.send_expect("p =3D %s" % > packets_expected[packet_type], ">>>") > @@ -108,9 +105,6 @@ class TestChecksumOffload(TestCase): > self.tester.send_expect("exit()", "#") >=20 > self.tester.scapy_background() > - self.tester.scapy_append('sys.path.append("./")') > - self.tester.scapy_append('import sctp') > - self.tester.scapy_append('from sctp import *') > self.tester.scapy_append('p =3D sniff(filter=3D"ether src %s", > iface=3D"%s", count=3D%d)' % (sniff_src,rx_interface, len(packets_sent))) > self.tester.scapy_append('nr_packets=3Dlen(p)') > self.tester.scapy_append('reslist =3D > [p[i].sprintf("%IP.chksum%;%TCP.chksum%;%UDP.chksum%;%SCTP.chksum%") for = i > in range(nr_packets)]') > @@ -119,9 +113,6 @@ class TestChecksumOffload(TestCase): >=20 > # Send packet. > self.tester.scapy_foreground() > - self.tester.scapy_append('sys.path.append("./")') > - self.tester.scapy_append('import sctp') > - self.tester.scapy_append('from sctp import *') >=20 > for packet_type in packets_sent.keys(): > self.tester.scapy_append('sendp([%s], iface=3D"%s")' % > (packets_sent[packet_type], tx_interface)) > diff --git a/tests/TestSuite_jumboframes.py > b/tests/TestSuite_jumboframes.py > index 1cceba8..e4ea10a 100644 > --- a/tests/TestSuite_jumboframes.py > +++ b/tests/TestSuite_jumboframes.py > @@ -119,6 +119,12 @@ class TestJumboframes(TestCase): >=20 > self.port_mask =3D dts.create_mask([self.rx_port, self.tx_port]) >=20 > + if self.nic =3D=3D "redrockcanyou": > + netobj =3D self.dut.ports_info[self.tx_port]['port'] > + netobj.enable_jumbo(framesize =3D ETHER_JUMBO_FRAME_MTU) > + netobj =3D self.dut.ports_info[self.rx_port]['port'] > + netobj.enable_jumbo(framesize =3D ETHER_JUMBO_FRAME_MTU) > + > self.tester.send_expect("ifconfig %s mtu %s" % > (self.tester.get_interface(self.tester.get_local_port(self.rx_port)), > ETHER_JUMBO_FRAME_MTU + 200), "# ") > self.tester.send_expect("ifconfig %s mtu %s" % > (self.tester.get_interface(self.tester.get_local_port(self.tx_port)), > ETHER_JUMBO_FRAME_MTU + 200), "# ") >=20 > @@ -136,9 +142,7 @@ class TestJumboframes(TestCase): > frame on testpmd app. > """ > self.pmdout.start_testpmd("Default", "--max-pkt-len=3D%d" % > (ETHER_STANDARD_MTU)) > - if self.nic =3D=3D "redrockcanyou": > - self.dut.send_expect("set promisc all off", "testpmd> ") > - self.dut.send_expect("set fwd mac", "testpmd> ") > + self.dut.send_expect("set fwd mac", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") >=20 > self.jumboframes_send_packet(ETHER_STANDARD_MTU - 1) > @@ -171,9 +175,7 @@ class TestJumboframes(TestCase): > packet forwrding should be support correct. > """ > self.pmdout.start_testpmd("Default", "--max-pkt-len=3D%s" % > (ETHER_JUMBO_FRAME_MTU)) > - if self.nic =3D=3D "redrockcanyou": > - self.dut.send_expect("set promisc all off", "testpmd> ") > - self.dut.send_expect("set fwd mac", "testpmd> ") > + self.dut.send_expect("set fwd mac", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") >=20 > self.jumboframes_send_packet(1517) > @@ -188,9 +190,7 @@ class TestJumboframes(TestCase): > packet can be forwarded correct. > """ > self.pmdout.start_testpmd("Default", "--max-pkt-len=3D%s" % > (ETHER_JUMBO_FRAME_MTU)) > - if self.nic =3D=3D "redrockcanyou": > - self.dut.send_expect("set promisc all off", "testpmd> ") > - self.dut.send_expect("set fwd mac", "testpmd> ") > + self.dut.send_expect("set fwd mac", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") >=20 > self.jumboframes_send_packet(ETHER_STANDARD_MTU + 1) > @@ -206,9 +206,7 @@ class TestJumboframes(TestCase): > packet which the length bigger than MTU can not be forwarded. > """ > self.pmdout.start_testpmd("Default", "--max-pkt-len=3D%s" % > (ETHER_JUMBO_FRAME_MTU)) > - if self.nic =3D=3D "redrockcanyou": > - self.dut.send_expect("set promisc all off", "testpmd> ") > - self.dut.send_expect("set fwd mac", "testpmd> ") > + self.dut.send_expect("set fwd mac", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") >=20 > """ > diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.p= y > index 3ca7387..7cae09c 100644 > --- a/tests/TestSuite_mac_filter.py > +++ b/tests/TestSuite_mac_filter.py > @@ -38,6 +38,7 @@ import dts > import time > from test_case import TestCase > from pmd_output import PmdOutput > +from packet import Packet >=20 > class TestWhitelist(TestCase): >=20 > @@ -58,7 +59,7 @@ class TestWhitelist(TestCase): > self.pmdout =3D PmdOutput(self.dut) > self.pmdout.start_testpmd("Default", "--portmask=3D%s" % portMas= k) > self.dut.send_expect("set verbose 1", "testpmd> ") > - self.dut.send_expect("set fwd mac", "testpmd> ") > + self.dut.send_expect("set fwd rxonly", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") >=20 > # get dest address from self.target port > @@ -85,11 +86,9 @@ class TestWhitelist(TestCase): > Send 1 packet to portid. > """ > itf =3D > self.tester.get_interface(self.tester.get_local_port(portid)) > - self.tester.scapy_foreground() > - self.tester.scapy_append('sendp([Ether(dst=3D"%s", > src=3D"52:00:00:00:00:00")/Raw(load=3D"X"*26)], iface=3D"%s", count=3D%d)= ' % > (destMac, > - > itf, self.frames_to_send)) > - self.tester.scapy_execute() > - time.sleep(5) > + pkt =3D Packet(pkt_type=3D'UDP') > + pkt.config_layer('ether', {'src': '52:00:00:00:00:00', 'dst': > destMac}) > + pkt.send_pkt(tx_port=3Ditf) >=20 > def test_add_remove_mac_address(self): > """ > @@ -97,19 +96,20 @@ class TestWhitelist(TestCase): > Remove mac address and check packet can't received > """ > # initialise first port without promiscuous mode > - fake_mac_addr =3D "01:01:01:00:00:00" > + fake_mac_addr =3D "00:01:01:00:00:00" > portid =3D self.dutPorts[0] > txportid =3D self.dutPorts[1] > self.dut.send_expect("set promisc %d off" % portid, "testpmd> ") >=20 > - out =3D self.dut.send_expect("show port stats %d" % txportid, > "testpmd> ") > - pre_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + self.dut.send_expect("clear port stats all", "testpmd> ") > + > + out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > + pre_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") >=20 > # send one packet with the portid MAC address > - self.dut.send_expect("clear port stats all", "testpmd> ") > self.whitelist_send_packet(portid, self.dest) > - out =3D self.dut.send_expect("show port stats %d" % txportid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > # check the packet increase > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) + > self.frames_to_send, > "Packet has not been received on default address") > @@ -118,8 +118,8 @@ class TestWhitelist(TestCase): > self.whitelist_send_packet(portid, fake_mac_addr) >=20 > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % txportid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") >=20 > # check the packet DO NOT increase > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt), > @@ -131,8 +131,8 @@ class TestWhitelist(TestCase): > self.whitelist_send_packet(portid, fake_mac_addr) >=20 > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % txportid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") >=20 > # check the packet increase > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) + > self.frames_to_send, > @@ -145,8 +145,8 @@ class TestWhitelist(TestCase): > self.whitelist_send_packet(portid, fake_mac_addr) >=20 > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % txportid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") >=20 > # check the packet increase > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt), > @@ -180,7 +180,7 @@ class TestWhitelist(TestCase): >=20 > # add 1 address more that max number > i =3D 0 > - base_addr =3D "01:00:00:00:00:" > + base_addr =3D "00:01:00:00:00:" > while i <=3D int(self.max_mac_addr): > new_addr =3D base_addr + "%0.2X" % i > out =3D self.dut.send_expect("mac_addr add %d" % portid + > " %s" % new_addr, "testpmd>") > diff --git a/tests/TestSuite_pmdrss_hash.py > b/tests/TestSuite_pmdrss_hash.py > index 7456d0a..860bfbd 100644 > --- a/tests/TestSuite_pmdrss_hash.py > +++ b/tests/TestSuite_pmdrss_hash.py > @@ -63,44 +63,42 @@ class TestPmdrssHash(TestCase): > """ > global reta_lines > self.tester.scapy_foreground() > - self.tester.scapy_append('sys.path.append("./")') > - self.tester.scapy_append('from sctp import *') > self.dut.send_expect("start", "testpmd>") > mac =3D self.dut.get_mac_address(0) >=20 > # send packet with different source and dest ip > if tran_type =3D=3D "ipv4-other": > for i in range(10): > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")], iface=3D"%s")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d")= ], > iface=3D"%s")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv4-tcp": > for i in range(10): > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"192.168.0.%d", > dst=3D"192.168.0.%d")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv4-udp": > for i in range(10): > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"192.168.0.%d", > dst=3D"192.168.0.%d")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv4-sctp": > for i in range(10): > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/SCTP(sport=3D1024,dport=3D1024,tag=3D1)], iface=3D"= %s")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"192.168.0.%d", > dst=3D"192.168.0.%d")/SCTP(sport=3D1024,dport=3D1024,tag=3D1)], iface=3D"= %s")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv4-frag": > for i in range(10): > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d",frag=3D1,flags=3D"MF")], iface=3D"%s")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"192.168.0.%d", > dst=3D"192.168.0.%d",frag=3D1,flags=3D"MF")], iface=3D"%s")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > @@ -114,71 +112,68 @@ class TestPmdrssHash(TestCase): >=20 > elif tran_type =3D=3D "ipv6-other": > for i in range(10): > - packet =3D > r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")], iface=3D"%s")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")], iface=3D"%s")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv6-tcp": > for i in range(10): > - packet =3D > r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv6-udp": > for i in range(10): > - packet =3D > r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv6-sctp": > for i in range(10): > - packet =3D > r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/SCTP(sport=3D1024,dport=3D1024,tag=3D1)], > iface=3D"%s")' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/SCTP(sport=3D1024,dport=3D1024,tag=3D1)], > iface=3D"%s")' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv6-frag": > for i in range(10): > - packet =3D > r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d",nh=3D44)/IPv6ExtHdrFragment()], iface=3D"%s")= ' % ( > - mac, i + 1, i + 2, itf) > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d",nh=3D44)/IPv6ExtHdrFragment()], iface=3D"%s")= ' % ( > + mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > else: > print "\ntran_type error!\n" >=20 > - out =3D self.dut.send_expect("stop", "testpmd>") > - print "******************************************************" > - print out > - print "*****************************************************" > + out =3D self.dut.get_session_output(timeout=3D1) > + self.dut.send_expect("stop", "testpmd>") > lines =3D out.split("\r\n") > reta_line =3D {} > # collect the hash result and the queue id > for line in lines: > line =3D line.strip() > - if len(line) !=3D 0 and line.startswith(("src=3D",)): > + if len(line) !=3D 0 and line.strip().startswith("port "): > + reta_line =3D {} > + rexp =3D r"port (\d)/queue (\d{1,2}): received (\d) > packets" > + m =3D re.match(rexp, line.strip()) > + if m: > + reta_line["port"] =3D m.group(1) > + reta_line["queue"] =3D m.group(2) > + > + elif len(line) !=3D 0 and line.startswith(("src=3D",)): > + if "RSS hash" not in line: > + continue > for item in line.split("-"): > item =3D item.strip() > - print item > if(item.startswith("RSS hash")): > name, value =3D item.split("=3D", 1) >=20 > reta_line[name.strip()] =3D value.strip() > reta_lines.append(reta_line) > - reta_line =3D {} > - elif len(line) !=3D 0 and line.strip().startswith("port "): > - rexp =3D r"port (\d)/queue (\d{1,2}): received (\d) > packets" > - m =3D re.match(rexp, line.strip()) > - if m: > - reta_line["port"] =3D m.group(1) > - reta_line["queue"] =3D m.group(2) > - elif len(line) !=3D 0 and line.startswith("stop"): > - break > - else: > - pass > + > self.verifyResult() >=20 > def verifyResult(self): > @@ -219,8 +214,6 @@ class TestPmdrssHash(TestCase): > """ > global reta_lines > self.tester.scapy_foreground() > - self.tester.scapy_append('sys.path.append("./")') > - self.tester.scapy_append('from sctp import *') > self.dut.send_expect("start", "testpmd>") > mac =3D self.dut.get_mac_address(0) >=20 > @@ -358,14 +351,21 @@ class TestPmdrssHash(TestCase): > else: > print "\ntran_type error!\n" >=20 > - out =3D self.dut.send_expect("stop", "testpmd>") > + out =3D self.dut.get_session_output(timeout=3D1) > + self.dut.send_expect("stop", "testpmd>") > lines =3D out.split("\r\n") > - reta_line =3D {} >=20 > # collect the hash result of five tuple and the queue id > for line in lines: > line =3D line.strip() > - if len(line) !=3D 0 and line.startswith(("src=3D",)): > + if len(line) !=3D 0 and line.strip().startswith("port "): > + reta_line =3D {} > + rexp =3D r"port (\d)/queue (\d{1,2}): received (\d) > packets" > + m =3D re.match(rexp, line.strip()) > + if m: > + reta_line["port"] =3D m.group(1) > + reta_line["queue"] =3D m.group(2) > + elif len(line) !=3D 0 and line.startswith(("src=3D",)): > for item in line.split("-"): > item =3D item.strip() > if(item.startswith("RSS hash")): > @@ -373,17 +373,6 @@ class TestPmdrssHash(TestCase): >=20 > reta_line[name.strip()] =3D value.strip() > reta_lines.append(reta_line) > - reta_line =3D {} > - elif len(line) !=3D 0 and line.strip().startswith("port "): > - rexp =3D r"port (\d)/queue (\d{1,2}): received (\d) > packets" > - m =3D re.match(rexp, line.strip()) > - if m: > - reta_line["port"] =3D m.group(1) > - reta_line["queue"] =3D m.group(2) > - elif len(line) !=3D 0 and line.startswith("stop"): > - break > - else: > - pass >=20 > self.verifyResult_symmetric() >=20 > @@ -422,23 +411,21 @@ class TestPmdrssHash(TestCase): > self.verify( > sum(result) =3D=3D 0, "the symmetric RSS hash function faile= d!") >=20 > - # > - # > - # > - # Test cases. > - # > def set_up_all(self): > """ > Run at the start of each test suite. > """ >=20 > - self.verify( > - self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single"], "NIC Unsupported: " + str(self.nic)) > + self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > + "fortville_spirit_single", "redrockcanyou"], > + "NIC Unsupported: " + str(self.nic)) > global reta_num > if self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single"]: > reta_num =3D 512 > elif self.nic in ["niantic"]: > reta_num =3D 128 > + elif self.nic in ["redrockcanyou"]: > + reta_num =3D 128 > else: > self.verify(False, "NIC Unsupported:%s" % str(self.nic)) > ports =3D self.dut.get_ports(self.nic) > @@ -582,15 +569,17 @@ class TestPmdrssHash(TestCase): > (self.target, self.dut.get_memory_channels(), queue, > queue), "testpmd> ", 120) >=20 > for iptype, rsstype in iptypes.items(): > - print "***********************%s rss > test********************************" % iptype > + self.logger.info("***********************%s rss > test********************************" % iptype) > self.dut.send_expect("set verbose 8", "testpmd> ") > self.dut.send_expect("set fwd rxonly", "testpmd> ") > self.dut.send_expect( > "set nbcore %d" % (queue + 1), "testpmd> ") >=20 > self.dut.send_expect("port stop all", "testpmd> ") > - self.dut.send_expect( > - "set_hash_global_config 0 simple_xor %s enable" % > iptype, "testpmd> ") > + # some nic not support change hash algorithm > + if self.nic not in ["redrockcanyou"]: > + self.dut.send_expect( > + "set_hash_global_config 0 simple_xor %s enable" = % > iptype, "testpmd> ") > # self.dut.send_expect("port config all rss ip", "testpm= d> > ") > self.dut.send_expect("port start all", "testpmd> ") > self.dut.send_expect( > diff --git a/tests/TestSuite_queue_start_stop.py > b/tests/TestSuite_queue_start_stop.py > index f59333c..1d84992 100644 > --- a/tests/TestSuite_queue_start_stop.py > +++ b/tests/TestSuite_queue_start_stop.py > @@ -141,11 +141,10 @@ class TestQueueStartStop(TestCase): > """ > #dpdk start > try: > - self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- = - > i --portmask=3D0x3", "testpmd>", 120) > + self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- = - > i --portmask=3D0x1 --port-topology=3Dloop", "testpmd>", 120) > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("start", "testpmd>") > - self.check_forwarding([0, 1], self.nic) > + self.check_forwarding([0, 0], self.nic) > except Exception, e: > raise IOError("dpdk start and first forward failure: %s" % e= ) >=20 > @@ -155,15 +154,15 @@ class TestQueueStartStop(TestCase): > self.dut.send_expect("stop", "testpmd>") > self.dut.send_expect("port 0 rxq 0 stop", "testpmd>") > self.dut.send_expect("start", "testpmd>") > - self.check_forwarding([0, 1], self.nic, received=3DFalse) > + self.check_forwarding([0, 0], self.nic, received=3DFalse) >=20 > # start rx queue test > print "test start rx queue stop tx queue" > self.dut.send_expect("stop", "testpmd>") > self.dut.send_expect("port 0 rxq 0 start", "testpmd>") > - self.dut.send_expect("port 1 txq 0 stop", "testpmd>") > + self.dut.send_expect("port 0 txq 0 stop", "testpmd>") > self.dut.send_expect("start", "testpmd>") > - self.check_forwarding([0, 1], self.nic, received=3DFalse) > + self.check_forwarding([0, 0], self.nic, received=3DFalse) > out =3D self.dut.get_session_output() > except Exception, e: > raise IOError("queue start/stop forward failure: %s" % e) > @@ -174,9 +173,9 @@ class TestQueueStartStop(TestCase): > # start tx queue test > print "test start rx and tx queue" > self.dut.send_expect("stop", "testpmd>") > - self.dut.send_expect("port 1 txq 0 start", "testpmd>") > + self.dut.send_expect("port 0 txq 0 start", "testpmd>") > self.dut.send_expect("start", "testpmd>") > - self.check_forwarding([0, 1], self.nic) > + self.check_forwarding([0, 0], self.nic) > except Exception, e: > raise IOError("queue start/stop forward failure: %s" % e) >=20 > diff --git a/tests/TestSuite_scatter.py b/tests/TestSuite_scatter.py > index ea1e0ee..1953185 100644 > --- a/tests/TestSuite_scatter.py > +++ b/tests/TestSuite_scatter.py > @@ -36,6 +36,7 @@ Test Scattered Packets. > import dts > from test_case import TestCase > from pmd_output import PmdOutput > +from packet import Packet, sniff_packets, load_sniff_packets, > strip_pktload > import time > # > # > @@ -54,47 +55,31 @@ class TestScatter(TestCase): > """ > dutPorts =3D self.dut.get_ports(self.nic) > # Verify that enough ports are available > - self.verify(len(dutPorts) >=3D 2, "Insufficient ports") > + self.verify(len(dutPorts) >=3D 1, "Insufficient ports") > + self.port =3D dutPorts[0] > self.pmdout =3D PmdOutput(self.dut) > if self.nic in ["niantic", "sageville", "fortpark", > "fortville_eagle", "fortville_spirit", "fortville_spirit_single", > "redrockcanyou", "ironpond", "twinpond", "springfountain"]: > self.mbsize =3D 2048 > else: > self.mbsize =3D 1024 >=20 > - def start_tcpdump(self, tester_rx_intf): > - self.tester.send_expect("rm -rf ./scatter.cap", "#") > - self.tester.send_expect("tcpdump -i %s -x -w ./scatter.cap > 2>/dev/null &" % tester_rx_intf, "#") > - > - def get_tcpdump_packet(self): > - self.tester.send_expect("killall tcpdump", "#") > - return self.tester.send_expect("tcpdump -nn -x -r ./scatter.cap"= , > "#") > - > - def scatter_pktgen_send_packet(self, sPortid, rPortid, pktsize, > num=3D1): > + def scatter_pktgen_send_packet(self, pktsize): > """ > Functional test for scatter packets. > """ > - sport =3D self.tester.get_local_port(sPortid) > - sintf =3D self.tester.get_interface(sport) > - smac =3D self.tester.get_mac(sport) > - dmac =3D self.dut.get_mac_address(sPortid) > - rport =3D self.tester.get_local_port(rPortid) > - rintf =3D self.tester.get_interface(rport) > - self.tester.send_expect("ifconfig %s mtu 9000" % sintf, "#") > - self.tester.send_expect("ifconfig %s mtu 9000" % rintf, "#") > - > - self.start_tcpdump(rintf) > + tester_port =3D self.tester.get_local_port(self.port) > + intf =3D self.tester.get_interface(tester_port) > + dmac =3D self.dut.get_mac_address(self.port) > + self.tester.send_expect("ifconfig %s mtu 9000" % intf, "#") >=20 > - pktlen =3D pktsize - 18 > - padding =3D pktlen - 20 > + inst =3D sniff_packets(intf) > + pkt =3D Packet(pkt_type=3D"IP_RAW", pkt_len=3Dpktsize) > + pkt.config_layer('ether', {'dst': dmac}) > + pkt.send_pkt(tx_port=3Dintf) > + sniff_pkts =3D load_sniff_packets(inst) >=20 > - self.tester.scapy_append( > - > 'sendp([Ether(src=3D"%s",dst=3D"%s")/IP(len=3D%s)/Raw(load=3D"\x50"*%s)], > iface=3D"%s")' % (smac, dmac,pktlen, padding, sintf)) > - time.sleep(3) > - self.tester.scapy_execute() > - time.sleep(5) #wait for scapy capture subprocess exit > - res =3D self.get_tcpdump_packet() > - self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#") > - self.tester.send_expect("ifconfig %s mtu 1500" % rintf, "#") > + res =3D strip_pktload(sniff_pkts[0], layer=3D"L4") > + self.tester.send_expect("ifconfig %s mtu 1500" % intf, "#") > return res >=20 > def set_up(self): > @@ -107,23 +92,18 @@ class TestScatter(TestCase): > """ > Scatter 2048 mbuf > """ > - cores =3D self.dut.get_core_list('1S/2C/2T') > - coreMask =3D dts.create_mask(cores) > - dutPorts =3D self.dut.get_ports(self.nic) > - portMask =3D dts.create_mask(dutPorts[:2]) > - > # set the mbuf size to 1024 > out =3D self.pmdout.start_testpmd( > - "1S/2C/2T", "--mbcache=3D200 --mbuf-size=3D%d --portmask= =3D%s - > -max-pkt-len=3D9000" % (self.mbsize, portMask)) > + "1S/2C/1T", "--mbcache=3D200 --mbuf-size=3D%d --portmask= =3D0x1 > --max-pkt-len=3D9000 --port-topology=3Dloop" % (self.mbsize)) > + > self.verify("Error" not in out, "launch error 1") >=20 > self.dut.send_expect("set fwd mac", "testpmd> ", 120) > self.dut.send_expect("start", "testpmd> ") >=20 > for offset in [-1, 0, 1, 4, 5]: > - ret =3D self.scatter_pktgen_send_packet( > - dutPorts[0], dutPorts[1], self.mbsize + offset) > - self.verify("5050 5050 5050 5050 5050 5050 5050" in ret, > "packet receive error") > + ret =3D self.scatter_pktgen_send_packet(self.mbsize + offset= ) > + self.verify("58 58 58 58 58 58 58 58" in ret, "packet receiv= e > error") >=20 > self.dut.send_expect("stop", "testpmd> ") > self.dut.send_expect("quit", "# ", 30) > diff --git a/tests/TestSuite_shutdown_api.py > b/tests/TestSuite_shutdown_api.py > index efbe934..6329649 100644 > --- a/tests/TestSuite_shutdown_api.py > +++ b/tests/TestSuite_shutdown_api.py > @@ -166,6 +166,10 @@ class TestShutdownApi(TestCase): > """ > Check link status of the ports. > """ > + # RRC not support link speed change > + if self.nic in ['redrockcanyou']: > + return > + > for port in self.ports: > out =3D self.tester.send_expect( > "ethtool %s" % > self.tester.get_interface(self.tester.get_local_port(port)), "# ") > @@ -187,7 +191,6 @@ class TestShutdownApi(TestCase): > self.pmdout.start_testpmd("Default", "--portmask=3D%s" % > dts.create_mask(self.ports), socket=3Dself.ports_socket) >=20 > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") > self.check_forwarding() > self.dut.send_expect("stop", "testpmd> ") > @@ -257,7 +260,6 @@ class TestShutdownApi(TestCase): > self.dut.send_expect("port config all txq 2", "testpmd> ") > self.dut.send_expect("set coremask %s" % fwdcoremask, "testpmd> = ") > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd> ") > self.dut.send_expect("port start all", "testpmd> ", 100) > out =3D self.dut.send_expect("show config rxtx", "testpmd> ") > self.verify("RX queues=3D2" in out, "RX queues not reconfigured > properly") > @@ -275,7 +277,6 @@ class TestShutdownApi(TestCase): > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("port config all crc-strip on", "testpmd> "= ) > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("port start all", "testpmd> ", 100) > out =3D self.dut.send_expect("show config rxtx", "testpmd> ") > self.verify( > @@ -383,7 +384,6 @@ class TestShutdownApi(TestCase): > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("port config rss ip", "testpmd> ") > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("port start all", "testpmd> ", 100) > self.dut.send_expect("start", "testpmd> ") > self.check_forwarding() > @@ -398,7 +398,6 @@ class TestShutdownApi(TestCase): > self.dut.send_expect("port config all rxd 1024", "testpmd> ") > self.dut.send_expect("port config all txd 1024", "testpmd> ") > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("port start all", "testpmd> ", 100) > out =3D self.dut.send_expect("show config rxtx", "testpmd> ") > self.verify( > @@ -418,7 +417,6 @@ class TestShutdownApi(TestCase): > self.dut.send_expect("port config all rxd 1024", "testpmd> ") > self.dut.send_expect("port config all txd 1024", "testpmd> ") > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("port start all", "testpmd> ", 100) > out =3D self.dut.send_expect("show config rxtx", "testpmd> ") > self.verify( > @@ -470,7 +468,6 @@ class TestShutdownApi(TestCase): > self.verify("hthresh=3D64" in out, "TX descriptor not reconfigur= ed > properly") > self.verify("wthresh=3D64" in out, "TX descriptor not reconfigur= ed > properly") > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("start", "testpmd> ") > self.check_forwarding() >=20 > @@ -490,7 +487,6 @@ class TestShutdownApi(TestCase): > for _ in range(stress_iterations): > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("port start all", "testpmd> ", 100) > self.dut.send_expect("start", "testpmd> ") > self.check_forwarding() > @@ -508,7 +504,6 @@ class TestShutdownApi(TestCase): >=20 > self.pmdout.start_testpmd("Default", "--portmask=3D%s" % > dts.create_mask(self.ports), socket=3Dself.ports_socket) > self.dut.send_expect("set fwd mac", "testpmd>") > - self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("start", "testpmd>") >=20 > ports_num =3D len(self.ports) > diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py > index 1f7ecd2..65b30b7 100644 > --- a/tests/TestSuite_tso.py > +++ b/tests/TestSuite_tso.py > @@ -83,7 +83,8 @@ class TestTSO(TestCase): > # this feature support Fortville, Niantic > self.verify(self.nic in ["kawela_2", "niantic", "bartonhills", > "82545EM", > "82540EM", "springfountain", > "fortville_eagle", > - "fortville_spirit", > "fortville_spirit_single"], > + "fortville_spirit", > "fortville_spirit_single", > + "redrockcanyou"], > "NIC Unsupported: " + str(self.nic)) >=20 > # Based on h/w type, choose how many ports to use > diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py > index cc23dc5..570c59e 100644 > --- a/tests/TestSuite_vlan.py > +++ b/tests/TestSuite_vlan.py > @@ -43,6 +43,7 @@ import time >=20 > from test_case import TestCase > from pmd_output import PmdOutput > +from packet import Packet, sniff_packets, load_sniff_packets >=20 >=20 > class TestVlan(TestCase): > @@ -61,37 +62,37 @@ class TestVlan(TestCase): > ports =3D self.dut.get_ports() >=20 > # Verify that enough ports are available > - self.verify(len(ports) >=3D 2, "Insufficient ports") > + self.verify(len(ports) >=3D 1, "Insufficient ports") >=20 > valports =3D [_ for _ in ports if self.tester.get_local_port(_) = !=3D > -1] > dutRxPortId =3D valports[0] > - dutTxPortId =3D valports[1] > - portMask =3D dts.create_mask(valports[:2]) > + dutTxPortId =3D valports[0] > + portMask =3D dts.create_mask(valports[:1]) >=20 > self.pmdout =3D PmdOutput(self.dut) > - self.pmdout.start_testpmd("Default", "--portmask=3D%s" % portMas= k) > + self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % portMask) >=20 > self.dut.send_expect("set verbose 1", "testpmd> ") > out =3D self.dut.send_expect("set fwd mac", "testpmd> ") >=20 > if self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single", "redrockcanyou"]: > - self.dut.send_expect("set promisc all off", "testpmd> ") > self.dut.send_expect("vlan set filter on %s" % dutRxPortId, > "testpmd> ") >=20 > self.dut.send_expect("vlan set strip off %s" % dutRxPortId, > "testpmd> ") > self.verify('Set mac packet forwarding mode' in out, "set fwd > rxonly error") > self.vlan =3D 51 >=20 > - def start_tcpdump(self): > - port =3D self.tester.get_local_port(dutTxPortId) > - rxItf =3D self.tester.get_interface(port) > - > - self.tester.send_expect("rm -rf ./vlan_test.cap", "#") > - self.tester.send_expect("tcpdump -i %s -w ./vlan_test.cap 2> > /dev/null& " % rxItf, "#") > + if self.nic =3D=3D "redrockcanyou": > + netobj =3D self.dut.ports_info[dutRxPortId]['port'] > + netobj.add_vlan(vlan_id =3D self.vlan) >=20 > def get_tcpdump_package(self): > - self.tester.send_expect("killall tcpdump", "#") > - return self.tester.send_expect("tcpdump -nn -e -v - > r ./vlan_test.cap", "#") > + pkts =3D load_sniff_packets(self.inst) > + vlans =3D [] > + for packet in pkts: > + vlan =3D packet.strip_element_dot1q("vlan") > + vlans.append(vlan) > + return vlans >=20 > def vlan_send_packet(self, vid, num=3D1): > """ > @@ -99,22 +100,26 @@ class TestVlan(TestCase): > """ > # The package stream : testTxPort->dutRxPort->dutTxport- > >testRxPort > port =3D self.tester.get_local_port(dutRxPortId) > - txItf =3D self.tester.get_interface(port) > + self.txItf =3D self.tester.get_interface(port) > self.smac =3D self.tester.get_mac(port) >=20 > port =3D self.tester.get_local_port(dutTxPortId) > - rxItf =3D self.tester.get_interface(port) > + self.rxItf =3D self.tester.get_interface(port) >=20 > # the package dect mac must is dut tx port id when the port > promisc is off > self.dmac =3D self.dut.get_mac_address(dutRxPortId) >=20 > + self.inst =3D sniff_packets(self.rxItf) > # FIXME send a burst with only num packet > if vid =3D=3D -1: > - > self.tester.scapy_append('sendp([Ether(src=3D"%s",dst=3D"%s")/IP(len=3D46= )], > iface=3D"%s")' % (self.smac, self.dmac, txItf)) > + pkt =3D Packet(pkt_type=3D'UDP') > + pkt.config_layer('ether', {'dst': self.dmac, 'src': > self.smac}) > else: > - > self.tester.scapy_append('sendp([Ether(src=3D"%s",dst=3D"%s")/Dot1Q(vlan= =3D%s)/I > P(len=3D46)], iface=3D"%s")' % (self.smac, self.dmac, vid, txItf)) > + pkt =3D Packet(pkt_type=3D'VLAN_UDP') > + pkt.config_layer('ether', {'dst': self.dmac, 'src': > self.smac}) > + pkt.config_layer('dot1q', {'vlan': vid}) >=20 > - self.tester.scapy_execute() > + pkt.send_pkt(tx_port=3Dself.txItf) >=20 > def set_up(self): > """ > @@ -135,10 +140,9 @@ class TestVlan(TestCase): > self.dut.send_expect("start", "testpmd> ", 120) > out =3D self.dut.send_expect("show port info %s" % dutRxPortId, > "testpmd> ", 20) >=20 > - self.start_tcpdump() > self.vlan_send_packet(self.vlan) > out =3D self.get_tcpdump_package() > - self.verify("vlan %d" % self.vlan in out, "Wrong vlan:" + out) > + self.verify(self.vlan in out, "Wrong vlan:" + str(out)) >=20 > self.dut.send_expect("stop", "testpmd> ") >=20 > @@ -149,13 +153,11 @@ class TestVlan(TestCase): >=20 > self.dut.send_expect("rx_vlan rm %d %s" % (self.vlan, > dutRxPortId), "testpmd> ") > self.dut.send_expect("start", "testpmd> ", 120) > - self.start_tcpdump() > self.vlan_send_packet(self.vlan) >=20 > out =3D self.get_tcpdump_package() > - # fm10k switch will redirect package if not send to nic > - if (not((self.nic =3D=3D "redrockcanyou") and ("%s > %s" % (self= .smac, > self.dmac) in out))): > - self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:" = + > out) > + self.verify(len(out) =3D=3D 0, "Received unexpected packet, filt= er > not work!!!") > + self.verify(self.vlan not in out, "Wrong vlan:" + str(out)) >=20 > out =3D self.dut.send_expect("stop", "testpmd> ") >=20 > @@ -167,10 +169,10 @@ class TestVlan(TestCase): > self.verify("strip on" in out, "Wrong strip:" + out) >=20 > self.dut.send_expect("start", "testpmd> ", 120) > - self.start_tcpdump() > self.vlan_send_packet(self.vlan) > out =3D self.get_tcpdump_package() > - self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:" + ou= t) > + self.verify(len(out), "Forwarded vlan packet not received!!!") > + self.verify(self.vlan not in out, "Wrong vlan:" + str(out)) > out =3D self.dut.send_expect("stop", "testpmd> ", 120) >=20 > def test_vlan_strip_config_off(self): > @@ -184,32 +186,39 @@ class TestVlan(TestCase): > self.verify("strip off" in out, "Wrong strip:" + out) > self.dut.send_expect("set nbport 2", "testpmd> ") > self.dut.send_expect("start", "testpmd> ", 120) > - self.start_tcpdump() > self.vlan_send_packet(self.vlan) > out =3D self.get_tcpdump_package() > - self.verify("vlan %d" % self.vlan in out, "Wrong strip vlan:" + > out) > + self.verify(self.vlan in out, "Vlan not found:" + str(out)) > out =3D self.dut.send_expect("stop", "testpmd> ", 120) >=20 > def test_vlan_enable_vlan_insertion(self): > """ > Enable VLAN header insertion in transmitted packets > """ > + if self.nic =3D=3D "redrockcanyou": > + netobj =3D self.dut.ports_info[dutTxPortId]['port'] > + netobj.add_vlan(vlan_id =3D self.vlan) > + netobj.add_txvlan(vlan_id =3D self.vlan) >=20 > - port =3D self.tester.get_local_port(dutTxPortId,) > + port =3D self.tester.get_local_port(dutTxPortId) > intf =3D self.tester.get_interface(port) >=20 > self.dut.send_expect("set nbport 2", "testpmd> ") > self.dut.send_expect("tx_vlan set %s %d" % (dutTxPortId, > self.vlan), "testpmd> ") > - self.start_tcpdump() >=20 > self.dut.send_expect("start", "testpmd> ") > self.vlan_send_packet(-1) >=20 > out =3D self.get_tcpdump_package() > - self.verify("vlan %d" % self.vlan in out, "Wrong vlan: " + out) > + self.verify(self.vlan in out, "Vlan not found:" + str(out)) > self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> > ", 30) > self.dut.send_expect("stop", "testpmd> ", 30) >=20 > + if self.nic =3D=3D "redrockcanyou": > + netobj =3D self.dut.ports_info[dutTxPortId]['port'] > + # not delete vlan for self.vlan will used later > + netobj.delete_txvlan(vlan_id =3D self.vlan) > + > def tear_down(self): > """ > Run after each test case. > @@ -221,4 +230,7 @@ class TestVlan(TestCase): > Run after each test suite. > """ > self.dut.kill_all() > - pass > + if self.nic =3D=3D "redrockcanyou": > + netobj =3D self.dut.ports_info[dutRxPortId]['port'] > + netobj.delete_txvlan(vlan_id =3D self.vlan) > + netobj.delete_vlan(vlan_id =3D self.vlan) > -- > 2.4.3