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 CDA36A04F3; Fri, 3 Jan 2020 03:56:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 70B7A1C1FC; Fri, 3 Jan 2020 03:56:17 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 321231C1F7 for ; Fri, 3 Jan 2020 03:56:14 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 18:56:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,389,1571727600"; d="scan'208";a="252453006" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 02 Jan 2020 18:56:13 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 18:56:13 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.203]) with mapi id 14.03.0439.000; Fri, 3 Jan 2020 10:56:11 +0800 From: "Tu, Lijuan" To: "Li, WenjieX A" , "dts@dpdk.org" CC: "Li, WenjieX A" Thread-Topic: [dts] [PATCH V1] tests/package_download:add new case Thread-Index: AQHVvGUOukURxZsKBE+tGDnst6U3EqfYSeaA Date: Fri, 3 Jan 2020 02:56:11 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBA15FD@SHSMSX101.ccr.corp.intel.com> References: <1577448269-49807-1-git-send-email-wenjiex.a.li@intel.com> In-Reply-To: <1577448269-49807-1-git-send-email-wenjiex.a.li@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" applied > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Wenjie Li > 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 >=20 > add new case check_specific_package_loading >=20 > Signed-off-by: Wenjie Li > --- > ...e_enable_package_download_in_ice_driver.py | 57 > +++++++++++++++++++ > 1 file changed, 57 insertions(+) >=20 > 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 o= ut: %s" % > (error_message, out)) >=20 > + 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.ports_= info[-1]['pci']] > + self.nic_sn =3D [self.get_sn(self.nic_pci[0]), self.get_sn(self.= nic_pci[1])] > + self.verify(self.nic_sn[0] !=3D self.nic_sn[1], "the case needs = >=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/ddp/= ``, > + and rename 1 ice.pkg to ice-.pkg, e.g. = ice- > 8ce1abfffffefd3c.pkg > + Launch testpmd with 1 default interface and 1 specific interface= , > + check the ice-.pkg is loadded by the sp= ecific > 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_p= ci[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() >=20 > -- > 2.17.1