From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 96CD55A58 for ; Wed, 8 Jul 2015 03:57:28 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 07 Jul 2015 18:57:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,428,1432623600"; d="scan'208";a="520490735" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jul 2015 18:57:27 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 8 Jul 2015 09:55:13 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.246]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.168]) with mapi id 14.03.0224.002; Wed, 8 Jul 2015 09:54:20 +0800 From: "Qiu, Michael" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 3/3] tests: Add RRC support with vlan suite Thread-Index: AQHQuJiqCVxG7I2VgUeFOBG5768Lcw== Date: Wed, 8 Jul 2015 01:54:19 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286046B216F@SHSMSX101.ccr.corp.intel.com> References: <1436261880-22395-1-git-send-email-michael.qiu@intel.com> <1436261880-22395-4-git-send-email-michael.qiu@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E10E5AE52@SHSMSX103.ccr.corp.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 3/3] tests: Add RRC support with vlan suite 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, 08 Jul 2015 01:57:29 -0000 On 7/8/2015 9:43 AM, Liu, Yong wrote:=0A= > Hi Michael,=0A= > Some comments below.=0A= >=0A= >> -----Original Message-----=0A= >> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Michael Qiu=0A= >> Sent: Tuesday, July 07, 2015 5:38 PM=0A= >> To: dts@dpdk.org=0A= >> Subject: [dts] [PATCH 3/3] tests: Add RRC support with vlan suite=0A= >>=0A= >> Add RRC support with vlan suite=0A= >>=0A= >> Signed-off-by: Michael Qiu =0A= >> ---=0A= >> tests/TestSuite_vlan.py | 56 ++++++++++++++++++++++++++++++------------= --=0A= >> -----=0A= >> 1 file changed, 34 insertions(+), 22 deletions(-)=0A= >>=0A= >> diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py=0A= >> index fba68e3..6f443de 100644=0A= >> --- a/tests/TestSuite_vlan.py=0A= >> +++ b/tests/TestSuite_vlan.py=0A= >> @@ -74,12 +74,13 @@ class TestVlan(TestCase):=0A= >> self.dut.send_expect("set verbose 1", "testpmd> ")=0A= >> out =3D self.dut.send_expect("set fwd mac", "testpmd> ")=0A= >>=0A= >> - if self.nic in ["fortville_eagle", "fortville_spirit",=0A= >> "fortville_spirit_single"]:=0A= >> + if self.nic in ["fortville_eagle", "fortville_spirit",=0A= >> "fortville_spirit_single", "redrockcanyou"]:=0A= >> self.dut.send_expect("set promisc all off", "testpmd> ")=0A= >> self.dut.send_expect("vlan set filter on %s"%dutRxPortId,= =0A= >> "testpmd> ")=0A= >>=0A= >> self.dut.send_expect("vlan set strip off %s" % dutRxPortId,=0A= >> "testpmd> ")=0A= >> self.verify('Set mac packet forwarding mode' in out, "set fwd= =0A= >> rxonly error")=0A= >> + self.vlan =3D 51=0A= >>=0A= > Is there any specified reason to set vlan to 51? We used to use value 1 t= o check vlan feature.=0A= =0A= Because RRC default will be set vlan 1, so if we change to 51 will=0A= verify it correctly.=0A= =0A= Thanks,=0A= Michael=0A= >=0A= >> def start_tcpdump(self):=0A= >> port =3D self.tester.get_local_port(dutTxPortId)=0A= >> @@ -98,16 +99,17 @@ class TestVlan(TestCase):=0A= >> # The package stream : testTxPort->dutRxPort->dutTxport-=0A= >>> testRxPort=0A= >> port =3D self.tester.get_local_port(dutRxPortId)=0A= >> txItf =3D self.tester.get_interface(port)=0A= >> + self.smac =3D self.tester.get_mac(port)=0A= >>=0A= >> port =3D self.tester.get_local_port(dutTxPortId)=0A= >> rxItf =3D self.tester.get_interface(port)=0A= >>=0A= >> # the package dect mac must is dut tx port id when the port=0A= >> promisc is off=0A= >> - mac =3D self.dut.get_mac_address(dutRxPortId)=0A= >> + self.dmac =3D self.dut.get_mac_address(dutRxPortId)=0A= >>=0A= >> # FIXME send a burst with only num packet=0A= >>=0A= >> -=0A= >> self.tester.scapy_append('sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(l= en=3D46)=0A= >> ], iface=3D"%s")' % (mac, vid, txItf))=0A= >> +=0A= >> self.tester.scapy_append('sendp([Ether(src=3D"%s",dst=3D"%s")/Dot1Q(vlan= =3D%s)/I=0A= >> P(len=3D46)], iface=3D"%s")' % (self.smac, self.dmac, vid, txItf))=0A= >>=0A= >> self.tester.scapy_execute()=0A= >> def set_up(self):=0A= >> @@ -120,16 +122,19 @@ class TestVlan(TestCase):=0A= >> Enable receipt of VLAN packets=0A= >> """=0A= >>=0A= >> - self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd= >=0A= >> ")=0A= >> + if self.nic =3D=3D "redrockcanyou" :=0A= >> + print "fm10k not support this case\n"=0A= >> + return=0A= >> + self.dut.send_expect("rx_vlan add %d %s" % (self.vlan,=0A= >> dutRxPortId), "testpmd> ")=0A= >> self.dut.send_expect("vlan set strip off %s" % dutRxPortId,=0A= >> "testpmd> ")=0A= >> self.dut.send_expect("start", "testpmd> ", 120)=0A= >> out =3D self.dut.send_expect("show port info %s" % dutRxPortId,= =0A= >> "testpmd> ", 20)=0A= >>=0A= >> self.start_tcpdump()=0A= >> - self.vlan_send_packet(1)=0A= >> + self.vlan_send_packet(self.vlan)=0A= >> #out =3D self.tester.scapy_get_result()=0A= >> out =3D self.get_tcpdump_package()=0A= >> - self.verify("vlan 1" in out, "Wrong vlan:" + out)=0A= >> + self.verify("vlan %d" % self.vlan in out, "Wrong vlan:" + out)= =0A= >>=0A= >> self.dut.send_expect("stop", "testpmd> ")=0A= >>=0A= >> @@ -140,13 +145,15 @@ class TestVlan(TestCase):=0A= >> """=0A= >>=0A= >>=0A= >> - self.dut.send_expect("rx_vlan rm 1 %s" % dutRxPortId, "testpmd>= ")=0A= >> + self.dut.send_expect("rx_vlan rm %d %s" % (self.vlan,=0A= >> dutRxPortId), "testpmd> ")=0A= >> self.dut.send_expect("start", "testpmd> ", 120)=0A= >> self.start_tcpdump()=0A= >> - self.vlan_send_packet(1)=0A= >> + self.vlan_send_packet(self.vlan)=0A= >>=0A= >> out =3D self.get_tcpdump_package()=0A= >> - self.verify("vlan 1" not in out, "Wrong vlan:" + out)=0A= >> + # fm10k switch will redirect package if not send to nic=0A= >> + if (not((self.nic =3D=3D "redrockcanyou") and ("%s > %s"%(self.= smac,=0A= >> self.dmac) in out))):=0A= >> + self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:"= +=0A= >> out)=0A= >>=0A= >> out =3D self.dut.send_expect("stop", "testpmd> ")=0A= >>=0A= >> @@ -154,45 +161,48 @@ class TestVlan(TestCase):=0A= >> def test_vlan_strip_config_on(self):=0A= >>=0A= >> self.dut.send_expect("vlan set strip on %s" % dutRxPortId,=0A= >> "testpmd> ", 20)=0A= >> - self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd= >=0A= >> ", 20)=0A= >> + self.dut.send_expect("rx_vlan add %d %s" % (self.vlan,=0A= >> dutRxPortId), "testpmd> ", 20)=0A= >> out =3D self.dut.send_expect("show port info %s" % dutRxPortId,= =0A= >> "testpmd> ", 20)=0A= >> self.verify("strip on" in out, "Wrong strip:" + out)=0A= >>=0A= >> self.dut.send_expect("start", "testpmd> ", 120)=0A= >> self.start_tcpdump()=0A= >> - self.vlan_send_packet(1)=0A= >> + self.vlan_send_packet(self.vlan)=0A= >> out =3D self.get_tcpdump_package()=0A= >> - self.verify("vlan 1" not in out, "Wrong vlan:" + out)=0A= >> + self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:" + o= ut)=0A= >> out =3D self.dut.send_expect("quit", "#", 120)=0A= >>=0A= >> def test_vlan_strip_config_off(self):=0A= >>=0A= >> + if self.nic =3D=3D "redrockcanyou" :=0A= >> + print "fm10k not support this case\n"=0A= >> + return=0A= > We should use "print dts.RED()" to emphasize this situation.=0A= >=0A= >> self.dut.send_expect("vlan set strip off %s" % dutRxPortId,=0A= >> "testpmd> ", 20)=0A= >> - self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd= >=0A= >> ", 20)=0A= >> + self.dut.send_expect("rx_vlan add %d %s" % (self.vlan,=0A= >> dutRxPortId), "testpmd> ", 20)=0A= >> out =3D self.dut.send_expect("show port info %s" % dutRxPortId,= =0A= >> "testpmd> ", 20)=0A= >> self.verify("strip off" in out, "Wrong strip:" + out)=0A= >> self.dut.send_expect("set nbport 2", "testpmd> ")=0A= >> self.dut.send_expect("start", "testpmd> ", 120)=0A= >> self.start_tcpdump()=0A= >> - self.vlan_send_packet(1)=0A= >> + self.vlan_send_packet(self.vlan)=0A= >> out =3D self.get_tcpdump_package()=0A= >> - self.verify("vlan 1" in out, "Wrong strip vlan:" + out)=0A= >> + self.verify("vlan %d" % self.vlan in out, "Wrong strip vlan:" += =0A= >> out)=0A= >> out =3D self.dut.send_expect("stop", "testpmd> ", 120)=0A= >>=0A= >> - def FAILING_test_vlan_enable_vlan_insertion(self):=0A= >> + def test_vlan_enable_vlan_insertion(self):=0A= >> """=0A= >> Enable VLAN header insertion in transmitted packets=0A= >> """=0A= >>=0A= >> - port =3D self.tester.get_local_port(valports[0])=0A= >> + port =3D self.tester.get_local_port(dutTxPortId,)=0A= >> intf =3D self.tester.get_interface(port)=0A= >>=0A= >> self.dut.send_expect("set nbport 2", "testpmd> ")=0A= >> - self.dut.send_expect("tx_vlan set 1 %s" % valports[0], "testpmd= >=0A= >> ")=0A= >> + self.dut.send_expect("tx_vlan set %d %s" % (self.vlan,=0A= >> dutTxPortId), "testpmd> ")=0A= >>=0A= >> - self.dut.send_expect("set promisc all on", "testpmd> ")=0A= >> + #self.dut.send_expect("set promisc all on", "testpmd> ")=0A= > Please remove this line.=0A= >=0A= >> if self.nic =3D=3D 'hartwell':=0A= >> - self.dut.send_expect("vlan set strip on %s" % valports[0],= =0A= >> "testpmd> ")=0A= > 'hartwell' not defined in settings.py, here is topy issue or there's new = NIC need support in DTS?=0A= >=0A= >> + self.dut.send_expect("vlan set strip on %s" % dutRxPortId,= =0A= >> "testpmd> ")=0A= >>=0A= >> self.tester.scapy_background()=0A= >> self.tester.scapy_append('p =3D sniff(iface=3D"%s", count=3D1,= =0A= >> timeout=3D5)' % intf)=0A= >> @@ -205,8 +215,9 @@ class TestVlan(TestCase):=0A= >> time.sleep(2)=0A= >>=0A= >> out =3D self.tester.scapy_get_result()=0A= >> - self.verify("vlan=3D1L" in out, "Wrong vlan: " + out)=0A= >> - if self.nic in ["fortville_eagle", "fortville_spirit",=0A= >> "fortville_spirit_single"]:=0A= >> + self.verify("vlan=3D%dL" % self.vlan in out, "Wrong vlan: " + o= ut)=0A= >> + if self.nic in ["fortville_eagle", "fortville_spirit",=0A= >> "fortville_spirit_single", "redrockcanyou"]:=0A= >> + self.dut.send_expect("tx_vlan reset %s" % dutTxPortId,=0A= >> "testpmd> ", 30)=0A= >> self.dut.send_expect("stop", "testpmd> ", 30)=0A= >> else:=0A= >> self.dut.send_expect("quit", "# ", 30)=0A= >> @@ -217,6 +228,7 @@ class TestVlan(TestCase):=0A= >> """=0A= >> pass=0A= >>=0A= >> +=0A= >> def tear_down_all(self):=0A= >> """=0A= >> Run after each test suite.=0A= >> --=0A= >> 1.9.3=0A= >=0A= =0A=