From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1301C5A58 for ; Wed, 8 Jul 2015 03:43:58 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 07 Jul 2015 18:43:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,428,1432623600"; d="scan'208";a="520486536" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jul 2015 18:43:56 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 8 Jul 2015 09:43:10 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.46]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.146]) with mapi id 14.03.0224.002; Wed, 8 Jul 2015 09:43:09 +0800 From: "Liu, Yong" To: "Qiu, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 3/3] tests: Add RRC support with vlan suite Thread-Index: AQHQuJi3Kll4RyaKekmG4P2IX727jZ3QzFIA Date: Wed, 8 Jul 2015 01:43:09 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10E5AE52@SHSMSX103.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> In-Reply-To: <1436261880-22395-4-git-send-email-michael.qiu@intel.com> Accept-Language: zh-CN, 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:43:59 -0000 Hi Michael, Some comments below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Michael Qiu > Sent: Tuesday, July 07, 2015 5:38 PM > To: dts@dpdk.org > Subject: [dts] [PATCH 3/3] tests: Add RRC support with vlan suite >=20 > Add RRC support with vlan suite >=20 > Signed-off-by: Michael Qiu > --- > tests/TestSuite_vlan.py | 56 ++++++++++++++++++++++++++++++-------------= - > ----- > 1 file changed, 34 insertions(+), 22 deletions(-) >=20 > diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py > index fba68e3..6f443de 100644 > --- a/tests/TestSuite_vlan.py > +++ b/tests/TestSuite_vlan.py > @@ -74,12 +74,13 @@ class TestVlan(TestCase): > 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"]: > + 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 Is there any specified reason to set vlan to 51? We used to use value 1 to = check vlan feature. > def start_tcpdump(self): > port =3D self.tester.get_local_port(dutTxPortId) > @@ -98,16 +99,17 @@ 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.smac =3D self.tester.get_mac(port) >=20 > port =3D self.tester.get_local_port(dutTxPortId) > rxItf =3D self.tester.get_interface(port) >=20 > # the package dect mac must is dut tx port id when the port > promisc is off > - mac =3D self.dut.get_mac_address(dutRxPortId) > + self.dmac =3D self.dut.get_mac_address(dutRxPortId) >=20 > # FIXME send a burst with only num packet >=20 > - > self.tester.scapy_append('sendp([Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(le= n=3D46) > ], iface=3D"%s")' % (mac, vid, txItf)) > + > 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)) >=20 > self.tester.scapy_execute() > def set_up(self): > @@ -120,16 +122,19 @@ class TestVlan(TestCase): > Enable receipt of VLAN packets > """ >=20 > - self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd> > ") > + if self.nic =3D=3D "redrockcanyou" : > + print "fm10k not support this case\n" > + return > + self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, > dutRxPortId), "testpmd> ") > self.dut.send_expect("vlan set strip off %s" % dutRxPortId, > "testpmd> ") > 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(1) > + self.vlan_send_packet(self.vlan) > #out =3D self.tester.scapy_get_result() > out =3D self.get_tcpdump_package() > - self.verify("vlan 1" in out, "Wrong vlan:" + out) > + self.verify("vlan %d" % self.vlan in out, "Wrong vlan:" + out) >=20 > self.dut.send_expect("stop", "testpmd> ") >=20 > @@ -140,13 +145,15 @@ class TestVlan(TestCase): > """ >=20 >=20 > - self.dut.send_expect("rx_vlan rm 1 %s" % dutRxPortId, "testpmd> = ") > + 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(1) > + self.vlan_send_packet(self.vlan) >=20 > out =3D self.get_tcpdump_package() > - self.verify("vlan 1" not in out, "Wrong vlan:" + out) > + # fm10k switch will redirect package if not send to nic > + if (not((self.nic =3D=3D "redrockcanyou") and ("%s > %s"%(self.s= mac, > self.dmac) in out))): > + self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:" = + > out) >=20 > out =3D self.dut.send_expect("stop", "testpmd> ") >=20 > @@ -154,45 +161,48 @@ class TestVlan(TestCase): > def test_vlan_strip_config_on(self): >=20 > self.dut.send_expect("vlan set strip on %s" % dutRxPortId, > "testpmd> ", 20) > - self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd> > ", 20) > + self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, > dutRxPortId), "testpmd> ", 20) > out =3D self.dut.send_expect("show port info %s" % dutRxPortId, > "testpmd> ", 20) > self.verify("strip on" in out, "Wrong strip:" + out) >=20 > self.dut.send_expect("start", "testpmd> ", 120) > self.start_tcpdump() > - self.vlan_send_packet(1) > + self.vlan_send_packet(self.vlan) > out =3D self.get_tcpdump_package() > - self.verify("vlan 1" not in out, "Wrong vlan:" + out) > + self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:" + ou= t) > out =3D self.dut.send_expect("quit", "#", 120) >=20 > def test_vlan_strip_config_off(self): >=20 > + if self.nic =3D=3D "redrockcanyou" : > + print "fm10k not support this case\n" > + return We should use "print dts.RED()" to emphasize this situation. > self.dut.send_expect("vlan set strip off %s" % dutRxPortId, > "testpmd> ", 20) > - self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd> > ", 20) > + self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, > dutRxPortId), "testpmd> ", 20) > out =3D self.dut.send_expect("show port info %s" % dutRxPortId, > "testpmd> ", 20) > 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(1) > + self.vlan_send_packet(self.vlan) > out =3D self.get_tcpdump_package() > - self.verify("vlan 1" in out, "Wrong strip vlan:" + out) > + self.verify("vlan %d" % self.vlan in out, "Wrong strip vlan:" + > out) > out =3D self.dut.send_expect("stop", "testpmd> ", 120) >=20 > - def FAILING_test_vlan_enable_vlan_insertion(self): > + def test_vlan_enable_vlan_insertion(self): > """ > Enable VLAN header insertion in transmitted packets > """ >=20 > - port =3D self.tester.get_local_port(valports[0]) > + 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 1 %s" % valports[0], "testpmd> > ") > + self.dut.send_expect("tx_vlan set %d %s" % (self.vlan, > dutTxPortId), "testpmd> ") >=20 > - self.dut.send_expect("set promisc all on", "testpmd> ") > + #self.dut.send_expect("set promisc all on", "testpmd> ") Please remove this line. > if self.nic =3D=3D 'hartwell': > - self.dut.send_expect("vlan set strip on %s" % valports[0], > "testpmd> ") 'hartwell' not defined in settings.py, here is topy issue or there's new NI= C need support in DTS? > + self.dut.send_expect("vlan set strip on %s" % dutRxPortId, > "testpmd> ") >=20 > self.tester.scapy_background() > self.tester.scapy_append('p =3D sniff(iface=3D"%s", count=3D1, > timeout=3D5)' % intf) > @@ -205,8 +215,9 @@ class TestVlan(TestCase): > time.sleep(2) >=20 > out =3D self.tester.scapy_get_result() > - self.verify("vlan=3D1L" in out, "Wrong vlan: " + out) > - if self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single"]: > + self.verify("vlan=3D%dL" % self.vlan in out, "Wrong vlan: " + ou= t) > + if self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single", "redrockcanyou"]: > + self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, > "testpmd> ", 30) > self.dut.send_expect("stop", "testpmd> ", 30) > else: > self.dut.send_expect("quit", "# ", 30) > @@ -217,6 +228,7 @@ class TestVlan(TestCase): > """ > pass >=20 > + > def tear_down_all(self): > """ > Run after each test suite. > -- > 1.9.3