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 DE0CBA0096 for ; Wed, 5 Jun 2019 07:17:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A4A91B946; Wed, 5 Jun 2019 07:17:40 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6884B2C15 for ; Wed, 5 Jun 2019 07:17:38 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2019 22:17:36 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 04 Jun 2019 22:17:36 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 4 Jun 2019 22:17:35 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 4 Jun 2019 22:17:35 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.10]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.247]) with mapi id 14.03.0415.000; Wed, 5 Jun 2019 13:17:33 +0800 From: "Tu, Lijuan" To: "Zhang, YanX A" , "dts@dpdk.org" CC: "Zhang, YanX A" Thread-Topic: [dts] [PATCH V1] tests/TestSuite_vf_kernel:Optimize validation results and scripts Thread-Index: AQHVGpVFCmy3yelrYkqypenJ74B/E6aMhsFg Date: Wed, 5 Jun 2019 05:17:33 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAA08AC@SHSMSX101.ccr.corp.intel.com> References: <1559625890-133337-1-git-send-email-yanx.a.zhang@intel.com> In-Reply-To: <1559625890-133337-1-git-send-email-yanx.a.zhang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTI2YjA2OTEtNzkwNi00YjZjLTgyOTYtZjJjNDAxNjg1MGFhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMTNzVWEyeEpneUVrVmFDTkhHbkhmOXNLYkhXdzA0eFVYbHljaVRGNmdCRmVYcjVXSGFSS1ZXaUIwUGtaMndqSiJ9 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 V1] tests/TestSuite_vf_kernel:Optimize validation results and scripts 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhang,yan > Sent: Tuesday, June 4, 2019 1:25 PM > To: dts@dpdk.org > Cc: Zhang, YanX A > Subject: [dts] [PATCH V1] tests/TestSuite_vf_kernel:Optimize validation > results and scripts >=20 > 1.Modify the verification result of the case. > --Before each case runs, we need to check that the connection state o= f the > corresponding NIC is yes. If no, we need to call the restore_interfaces_l= inux() > method to restore the NIC state to yes, and there is no need to do any ot= her > operations. > 2.Add code to check NIC status. > --Sometimes, ifconfig %s up does not take effect due to the case runn= ing > too fast, and it needs to wait for a certain period of time. > 3.Add time.sleep() to enable tcpdump to start normally. > --Sometimes, the tcpdump command requires a certain open time, > otherwise the corresponding packet cannot be fetched. > 4.Replace the virtual NIC intf0 to intf1. > --When all cases run together, it will affect the intf0 NIC required = by > test_vlan, so replace intf0 to intf1. >=20 > Signed-off-by: zhang,yan > --- > tests/TestSuite_vf_kernel.py | 38 +++++++++++++++++++++--------------- > 1 file changed, 22 insertions(+), 16 deletions(-) >=20 > diff --git a/tests/TestSuite_vf_kernel.py b/tests/TestSuite_vf_kernel.py = index > f80c9e9..92b1202 100644 > --- a/tests/TestSuite_vf_kernel.py > +++ b/tests/TestSuite_vf_kernel.py > @@ -226,8 +226,16 @@ class TestVfKernel(TestCase): > """ > for i in range(5): > # pf up + vf up -> vf up > + start_time =3D time.time() > self.vm0_dut.send_expect("ifconfig %s up" % self.vm0_intf0, = "#") > out =3D self.vm0_dut.send_expect("ethtool %s" % self.vm0_int= f0, "#") > + while "Link detected: yes" not in out: > + end_time =3D time.time() > + if end_time - start_time >=3D 3: > + break > + else: > + out =3D self.vm0_dut.send_expect("ethtool %s" % self= .vm0_intf0, > "#") > + time.sleep(1) > self.verify("Link detected: yes" in out, "Wrong link status"= ) > time.sleep(3) >=20 > @@ -391,6 +399,7 @@ class TestVfKernel(TestCase): > def verify_vm_tcpdump(self, vm_dut, intf, mac, pkt_lens=3D64, num=3D= 1, > vlan_id=3D'', param=3D''): > vm_dut.send_expect("tcpdump -i %s %s -e ether src %s" % > (intf, param, self.tester_mac), "tcpdump", 10= ) > + time.sleep(2) > self.send_packet(mac, pkt_lens, num, vlan_id) > out =3D vm_dut.get_session_output(timeout=3D10) > vm_dut.send_expect("^C", "#", 10) @@ -417,8 +426,8 @@ class > TestVfKernel(TestCase): > vlan_ids =3D random.randint(1, 4095) > self.dut_testpmd.execute_cmd("vlan set filter on 0") > self.dut_testpmd.execute_cmd("vlan set strip on 0") > - self.vm0_dut.send_expect("ifconfig %s up" % self.vm0_intf0, "#") > - vm0_vf0_mac =3D self.vm0_dut.ports_info[0]['port'].get_mac_addr(= ) > + self.vm0_dut.send_expect("ifconfig %s up" % self.vm0_intf1, "#") > + vm0_vf1_mac =3D self.vm0_dut.ports_info[1]['port'].get_mac_addr(= ) >=20 > self.vm0_dut.send_expect("modprobe 8021q", "#") > out =3D self.vm0_dut.send_expect("lsmod |grep 8021q", "#") @@ -4= 26,33 > +435,33 @@ class TestVfKernel(TestCase): >=20 > # Add random vlan id(0~4095) on kernel VF0 > self.vm0_dut.send_expect("vconfig add %s %s" % > - (self.vm0_intf0, vlan_ids), "#") > + (self.vm0_intf1, vlan_ids), "#") > out =3D self.vm0_dut.send_expect("ls /proc/net/vlan/ ", "#") > - self.verify("%s.%s" % (self.vm0_intf0, vlan_ids) > + self.verify("%s.%s" % (self.vm0_intf1, vlan_ids) > in out, "take vlan id failure") >=20 > # Send packet from tester to VF MAC with not-matching vlan id, c= heck > # the packet can't be received at the vlan device > # fortville nic need add -p parameter to disable promisc mode > wrong_vlan =3D vlan_ids % 4095 + 1 > - self.verify(self.verify_vm_tcpdump(self.vm0_dut, self.vm0_intf0, > vm0_vf0_mac, > + self.verify(self.verify_vm_tcpdump(self.vm0_dut, > + self.vm0_intf1, vm0_vf1_mac, > vlan_id=3D'%d' % wrong_vlan, = param=3D'-p') =3D=3D False, > "received wrong vlan packet") > # Send packet from tester to VF MAC with matching vlan id, check= the > packet can be received at the vlan device. > # check_result =3D self.verify_vm_tcpdump(self.vm0_dut, self.vm0= _intf0, > self.vm0_vf0_mac, vlan_id=3D'%d' %vlan_ids) > check_result =3D self.verify_vm_tcpdump( > - self.vm0_dut, self.vm0_intf0, vm0_vf0_mac, vlan_id=3D'%d' % = vlan_ids, > param=3D'-p') > + self.vm0_dut, self.vm0_intf1, vm0_vf1_mac, vlan_id=3D'%d' % > + vlan_ids, param=3D'-p') > self.verify(check_result, "can't received vlan_id=3D%d packet" %= vlan_ids) >=20 > # Delete configured vlan device > self.vm0_dut.send_expect("vconfig rem %s.%s" % > - (self.vm0_intf0, vlan_ids), "#") > + (self.vm0_intf1, vlan_ids), "#") > out =3D self.vm0_dut.send_expect("ls /proc/net/vlan/ ", "#") > - self.verify("%s.%s" % (self.vm0_intf0, vlan_ids) > + self.verify("%s.%s" % (self.vm0_intf1, vlan_ids) > not in out, "vlan error") > # behavior is different between niantic and fortville ,because o= f kernel > # driver > - self.verify(self.verify_vm_tcpdump(self.vm0_dut, self.vm0_intf0, > - vm0_vf0_mac, vlan_id=3D'%d' %= vlan_ids, param=3D'-p') > =3D=3D False, "delete vlan error") > + self.verify(self.verify_vm_tcpdump(self.vm0_dut, self.vm0_intf1, > + vm0_vf1_mac, vlan_id=3D'%d' % > + vlan_ids, param=3D'-p') =3D=3D False, "delete vlan error") > self.dut_testpmd.execute_cmd("vlan set filter off 0") >=20 > def test_packet_statistic(self): > @@ -486,18 +495,15 @@ class TestVfKernel(TestCase): > for i in range(5): > # down-up get new mac form pf. > # because dpdk pf will give an random mac when dpdk pf rest= art. > - session.send_expect("ifconfig %s down" % intf, "#") > - out =3D session.send_expect("ifconfig %s up" % intf, "#") > + out =3D session.send_expect("ethtool %s" % intf, "#") > # SIOCSIFFLAGS: Network is down > # i think the pf link abnormal > - if "Network is down" in out: > + if "Link detected: no" in out: > print GREEN(out) > print GREEN("Try again") > session.restore_interfaces_linux() > else: > - out =3D session.send_expect("ethtool %s" % intf, "#") > - if "Link detected: yes" in out: > - return True > + return True > time.sleep(1) > return False >=20 > -- > 2.17.2