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 3E254A04DD; Thu, 2 Jan 2020 08:13:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E94711BFD9; Thu, 2 Jan 2020 08:13:33 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 3A0591BFD8 for ; Thu, 2 Jan 2020 08:13:32 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jan 2020 23:13:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,385,1571727600"; d="scan'208";a="421060342" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 01 Jan 2020 23:13:30 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Jan 2020 23:13:30 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Jan 2020 23:13:29 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.197]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.132]) with mapi id 14.03.0439.000; Thu, 2 Jan 2020 15:13:28 +0800 From: "Chen, Zhaoyan" To: "Li, WenjieX A" , "dts@dpdk.org" CC: "Li, WenjieX A" , "Chen, Zhaoyan" Thread-Topic: [dts] [PATCH V1] tests/package_download:add new case Thread-Index: AQHVvGUOf5q8h9QK602brMkjqov4e6fMyzkAgAoz0yA= Date: Thu, 2 Jan 2020 07:13:28 +0000 Message-ID: <9DEEADBC57E43F4DA73B571777FECECA41E77299@SHSMSX104.ccr.corp.intel.com> References: <1577448269-49807-1-git-send-email-wenjiex.a.li@intel.com> <8688172CD5C0B74590FAE19D9579F94B5381EF61@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <8688172CD5C0B74590FAE19D9579F94B5381EF61@SHSMSX103.ccr.corp.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/package_download:add new case 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" Acked-by: Zhaoyan Chen Regards, Zhaoyan Chen > -----Original Message----- > From: dts On Behalf Of Li, WenjieX A > Sent: Friday, December 27, 2019 11:24 AM > To: dts@dpdk.org > Cc: Li, WenjieX A > Subject: Re: [dts] [PATCH V1] tests/package_download:add new case >=20 > Tested-by: Li, WenjieX A >=20 > > -----Original Message----- > > From: Li, WenjieX A > > Sent: Friday, December 27, 2019 8:04 PM > > To: dts@dpdk.org > > Cc: Li, WenjieX A > > Subject: [dts][PATCH V1] tests/package_download:add new case > > > > add new case check_specific_package_loading > > > > Signed-off-by: Wenjie Li > > --- > > ...e_enable_package_download_in_ice_driver.py | 57 > > +++++++++++++++++++ > > 1 file changed, 57 insertions(+) > > > > diff --git a/tests/TestSuite_enable_package_download_in_ice_driver.py > > b/tests/TestSuite_enable_package_download_in_ice_driver.py > > index fd6a27e..f28f0e6 100644 > > --- a/tests/TestSuite_enable_package_download_in_ice_driver.py > > +++ b/tests/TestSuite_enable_package_download_in_ice_driver.py > > @@ -295,6 +295,63 @@ class > > TestEnable_Package_Download_In_Ice_Driver(TestCase): > > for error_message in error_messages: > > self.verify(error_message in out, "There should be '%s' > > in out: %s" % (error_message, out)) > > > > + def get_sn(self, nic_pci): > > + cmd =3D "lspci -vs %s | grep 'Device Serial Number'" % nic_pci > > + out =3D self.dut.send_expect(cmd, "#") > > + sn_temp =3D re.findall(r'Device Serial Number (.*)', out) > > + sn =3D re.sub("-", "", sn_temp[0]) > > + return sn > > + > > + def check_env(self): > > + """ > > + Check the DUT has two or more CVL NICs. If not, return "the > > + ENV needs at > > least two CVL NICs" > > + """ > > + self.nic_pci =3D [self.dut.ports_info[0]['pci'], self.dut.port= s_info[-1]['pci']] > > + self.nic_sn =3D [self.get_sn(self.nic_pci[0]), self.get_sn(sel= f.nic_pci[1])] > > + self.verify(self.nic_sn[0] !=3D self.nic_sn[1], "the case need= s > > + >=3D2 CVL NICs > > with different Serial Numbers") > > + > > + def copy_specify_ice_pkg(self, pkg_ver): > > + """ > > + Copy 2 different ``ice-xxx.pkg`` from dts/dep to dut /tmp/ > > + pkg_files =3D ['ice-1.3.4.0.pkg', 'ice-1.3.10.0.pkg'] > > + """ > > + dst =3D "/tmp" > > + pkg_file =3D "ice-%s.pkg" % pkg_ver > > + src_file =3D r'./dep/%s' % pkg_file > > + self.dut.session.copy_file_to(src_file, dst) > > + > > + def generate_delete_specify_pkg(self, pkg_ver, sn, key=3D"true"): > > + self.dut.send_expect("rm -rf > > + /lib/firmware/intel/ice/ddp/ice-%s.pkg" % sn, > > "#") > > + if key =3D=3D "true": > > + self.dut.send_expect("\cp /tmp/ice-%s.pkg > > /lib/firmware/intel/ice/ddp/ice-%s.pkg" % (pkg_ver, sn), "#") > > + > > + def test_check_specific_package_loading(self): > > + """ > > + Copy 2 different ``ice.pkg`` into ``/lib/firmware/intel/ice/dd= p/``, > > + and rename 1 ice.pkg to ice-.pkg, > > + e.g. ice- > > 8ce1abfffffefd3c.pkg > > + Launch testpmd with 1 default interface and 1 specific interfa= ce, > > + check the ice-.pkg is loadded by the > > + specific > > interface. > > + """ > > + self.check_env() > > + self.use_correct_ice_pkg(flag=3D"true") > > + self.new_pkgs =3D ["1.3.10.0", "1.3.4.0"] > > + for i in range(len(self.new_pkgs)): > > + self.copy_specify_ice_pkg(self.new_pkgs[i]) > > + > > + self.generate_delete_specify_pkg(pkg_ver=3Dself.new_pkgs[i], > > sn=3Dself.nic_sn[i], key=3D"true") > > + > > + eal_param =3D "-w %s " % self.nic_pci[0] + "-w %s " % > > + self.nic_pci[1] + "--log- > > level=3D8" > > + out =3D self.dut_testpmd.execute_cmd("./%s/app/testpmd %s -- -= i > > + " % > > (self.target, eal_param)) > > + self.dut_testpmd.quit() > > + > > + # Delete ice-.pkg to recover the ENV > > + for i in range(len(self.new_pkgs)): > > + > > + self.generate_delete_specify_pkg(pkg_ver=3Dself.new_pkgs[i], > > sn=3Dself.nic_sn[i], key=3D"false") > > + > > + self.actual_pcis =3D re.findall(r"device (.*) on", out) > > + self.pkgs =3D re.findall(r"is: (.*),", out) > > + self.verify(self.actual_pcis =3D=3D self.nic_pci and self.pkgs= =3D=3D self.new_pkgs, > > + "The nics pci info/pkg are not matched") > > + > > def tear_down(self): > > self.dut_testpmd.quit() > > > > -- > > 2.17.1