From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D774A0588; Mon, 20 Apr 2020 04:18:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1325E1D14D; Mon, 20 Apr 2020 04:18:17 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 7721F1C2F5 for ; Mon, 20 Apr 2020 04:18:15 +0200 (CEST) IronPort-SDR: yP4ScQ0Oni3iSF2H/WRmML/huGhIyTICMjGQrl6n8spRSVe5/Lo0nK9xYnGjEw/vZAP8ncc6PU uG4kWtgRlyXw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2020 19:18:14 -0700 IronPort-SDR: ryXE1YFUdMmb8KJ43UErrwUa8k5+rSSoSCv6b4iytl2nTuq1l5um1azi9A31edgg0Wsw9LqExM qzeEOikLbjVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,405,1580803200"; d="scan'208";a="245226018" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 19 Apr 2020 19:18:14 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Apr 2020 19:18:14 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Apr 2020 19:18:13 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.191]) with mapi id 14.03.0439.000; Mon, 20 Apr 2020 10:18:04 +0800 From: "Tu, Lijuan" To: "Zhao, HaiyangX" , "dts@dpdk.org" CC: "Zhao, HaiyangX" Thread-Topic: [dts] [PATCH V1] tests/port_control: optimize code Thread-Index: AQHWDvfMgI+bZUG3lk2A6SRnGz7hAKiBVeUA Date: Mon, 20 Apr 2020 02:18:03 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC0CD4C@SHSMSX101.ccr.corp.intel.com> References: <1586495619-37997-1-git-send-email-haiyangx.zhao@intel.com> In-Reply-To: <1586495619-37997-1-git-send-email-haiyangx.zhao@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.2.0.6 dlp-reaction: no-action 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/port_control: optimize code 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 Haiyang Zhao > Sent: Friday, April 10, 2020 1:14 PM > To: dts@dpdk.org > Cc: Zhao, HaiyangX > Subject: [dts] [PATCH V1] tests/port_control: optimize code >=20 > *.when interface is active, bind to igb_uio will be failed, > flush ip and bind by force. > *.vm_testpmd is generated in the first case, if it failed will impact th= e > second case, add judgement for it. >=20 > Signed-off-by: Haiyang Zhao > --- > tests/TestSuite_port_control.py | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/tests/TestSuite_port_control.py b/tests/TestSuite_port_contr= ol.py > index 385eff6..1a588d3 100644 > --- a/tests/TestSuite_port_control.py > +++ b/tests/TestSuite_port_control.py > @@ -156,7 +156,8 @@ class TestPortControl(TestCase): > vf_pci =3D re.findall(r"(\d+.\d+.\d+.\d+)", drive_info.split("ke= rnel")[1]) > terminal.send_expect("ifconfig %s hw ether %s" % (vf_if[1], self= .vf_mac), > "#") > terminal.send_expect("ifconfig %s up" % vf_if[1], "#") > - terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio %s"= % > vf_pci[1], "#") > + terminal.send_expect("ip addr flush %s " % vf_if[1], "#") > + terminal.send_expect("./usertools/dpdk-devbind.py -b igb_uio > + --force %s" % vf_pci[1], "#") > cmd =3D "./%s/app/testpmd -n 1 -w %s -- -i" % (self.target, vf_p= ci[1]) > terminal.send_expect(cmd, "testpmd>", 10) >=20 > @@ -178,7 +179,7 @@ class TestPortControl(TestCase): > terminal.execute_cmd("stop") > terminal.execute_cmd("port stop all") > ret =3D terminal.get_port_link_status(self.port_id_0) > - if self.nic.startswith('columbiaville') or terminal is self.vm_t= estpmd: > + if self.nic.startswith('columbiaville') or (getattr(self, 'vm_te= stpmd', > None) and terminal is self.vm_testpmd): > self.verify(ret !=3D "", "port status error!") > else: > self.verify(ret =3D=3D "down", "port not down!") @@ -187,7 += 188,7 @@ > class TestPortControl(TestCase): > def reset_pmd_port(self, terminal): > terminal.execute_cmd("port reset all") > ret =3D terminal.get_port_link_status(self.port_id_0) > - if self.nic.startswith('columbiaville') or terminal is self.vm_t= estpmd: > + if self.nic.startswith('columbiaville') or (getattr(self, 'vm_te= stpmd', > None) and terminal is self.vm_testpmd): > self.verify(ret !=3D "", "port status error!") > else: > self.verify(ret =3D=3D "down", "port not down!") > -- > 2.20.1