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 57B9CA0487 for ; Mon, 29 Jul 2019 10:00:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4035B1BF2C; Mon, 29 Jul 2019 10:00:42 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id AE1EF1BF1A for ; Mon, 29 Jul 2019 10:00:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2019 00:59:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,322,1559545200"; d="scan'208";a="165390761" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 29 Jul 2019 00:59:50 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 29 Jul 2019 00:59:50 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 29 Jul 2019 00:59:49 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 29 Jul 2019 00:59:49 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.139]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.250]) with mapi id 14.03.0439.000; Mon, 29 Jul 2019 15:59:48 +0800 From: "Li, WenjieX A" To: "dts@dpdk.org" CC: "Li, WenjieX A" Thread-Topic: [dts][PATCH V2 2/2] tests/enable_package_download_in_ice_driver:change cases Thread-Index: AQHVQ3+xQVXXZAxKikKAN3xcqVxvSabcEWcAgAUutGA= Date: Mon, 29 Jul 2019 07:59:47 +0000 Message-ID: <8688172CD5C0B74590FAE19D9579F94B53767F41@SHSMSX103.ccr.corp.intel.com> References: <1564156515-53055-1-git-send-email-wenjiex.a.li@intel.com> <1564156515-53055-2-git-send-email-wenjiex.a.li@intel.com> <67D543A150B29E4CAAE53918F64EDAEA3773B3AD@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <67D543A150B29E4CAAE53918F64EDAEA3773B3AD@SHSMSX103.ccr.corp.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 V2 2/2] tests/enable_package_download_in_ice_driver:change cases 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" Tested-by: Li, WenjieX A > -----Original Message----- > From: Peng, Yuan > Sent: Friday, July 26, 2019 4:51 PM > To: Li, WenjieX A ; dts@dpdk.org > Subject: RE: [dts][PATCH V2 2/2] > tests/enable_package_download_in_ice_driver:change cases >=20 > Acked-by: Peng, Yuan >=20 > -----Original Message----- > From: Li, WenjieX A > Sent: Friday, July 26, 2019 11:55 PM > To: dts@dpdk.org > Cc: Peng, Yuan ; Li, WenjieX A > Subject: [dts][PATCH V2 2/2] > tests/enable_package_download_in_ice_driver:change cases >=20 > change test cases based on dpdk 603beeb970b5d87fa7. >=20 > Signed-off-by: Wenjie Li > --- > V2: fix "warning: 1 line adds whitespace errors." >=20 > ...e_enable_package_download_in_ice_driver.py | 77 +++++++++++++------ > 1 file changed, 53 insertions(+), 24 deletions(-) >=20 > diff --git a/tests/TestSuite_enable_package_download_in_ice_driver.py > b/tests/TestSuite_enable_package_download_in_ice_driver.py > index b5e3e2f..9197198 100644 > --- a/tests/TestSuite_enable_package_download_in_ice_driver.py > +++ b/tests/TestSuite_enable_package_download_in_ice_driver.py > @@ -54,6 +54,9 @@ class > TestEnable_Package_Download_In_Ice_Driver(TestCase): > self.tester_p0_mac =3D self.tester.get_mac(localPort0) > self.dut_testpmd =3D PmdOutput(self.dut) >=20 > + self.dut_p0_pci =3D self.dut.get_port_pci(self.dut_ports[0]) > + self.dut_p1_pci =3D self.dut.get_port_pci(self.dut_ports[1]) > + > self.pkg_file =3D '/lib/firmware/intel/ice/ddp/ice.pkg' > out =3D self.dut.send_expect("ls %s" % self.pkg_file, "#") > self.verify("No such file or directory" not in out, "Cannot find= %s, please > check you system/driver." % self.pkg_file) @@ -84,13 +87,20 @@ class > TestEnable_Package_Download_In_Ice_Driver(TestCase): > self.dut.send_expect("rm -rf %s" % self.pkg_file, "#") > self.dut.send_expect("touch %s" % self.pkg_file, "#") >=20 > - def start_testpmd(self, flag=3D"true"): > - out =3D self.dut_testpmd.start_testpmd("all", "--nb-cores=3D8 --= rxq=3D%s -- > txq=3D%s --port-topology=3Dchained" % (self.PF_QUEUE, self.PF_QUEUE)) > - if flag !=3D "true": > - error_messages =3D ["ice_load_pkg(): failed to allocate buf = of size 0 for > package", \ > - "ice_load_pkg(): failed to allocate buf of size 0 fo= r package", \ > + def start_testpmd(self, ice_pkg=3D"true", safe_mode_support=3D"false= "): > + if safe_mode_support =3D=3D "true": > + self.eal_param=3D"-w %s,safe-mode-support=3D1 -w %s,safe-mod= e- > support=3D1" % (self.dut_p0_pci, self.dut_p1_pci) > + else: > + self.eal_param=3D"" > + out =3D self.dut_testpmd.start_testpmd("all", "--nb-cores=3D8 --= rxq=3D%s -- > txq=3D%s --port-topology=3Dchained" % (self.PF_QUEUE, self.PF_QUEUE), > eal_param=3Dself.eal_param) > + if ice_pkg =3D=3D "false": > + if safe_mode_support =3D=3D "true": > + error_messages =3D ["ice_load_pkg(): failed to allocate > + buf of size 0 for package", \ > "ice_dev_init(): Failed to load the DDP package,Ente= ring Safe Mode", > \ > "ice_init_rss(): RSS is not supported in safe mode"] > + if safe_mode_support =3D=3D "false": > + error_messages =3D ["ice_load_pkg(): failed to allocate = buf of size 0 for > package", \ > + "ice_dev_init(): Failed to load the DDP package,Use > + safe-mode-support=3D1 to enter Safe Mode"] > for error_message in error_messages: > self.verify(error_message in out, "There should be error= messages in > out: %s" % out) > self.dut_testpmd.execute_cmd('set promisc all off') @@ -209,7 +2= 19,8 > @@ class TestEnable_Package_Download_In_Ice_Driver(TestCase): >=20 > def verifyResult(self, tran_type, flag): > """ > - Verify whether or not the result passes. > + if flag =3D=3D true: all packets should enter different queues o= f port 0 > + else: all packets enter queue 0 of port 0 > """ > if tran_type =3D=3D "ipv4-other": > self.tcpdump_stop_sniff() > @@ -235,30 +246,48 @@ class > TestEnable_Package_Download_In_Ice_Driver(TestCase): > self.verify(len(list(set(queue_list))) =3D=3D 1 and int(= list(set(queue_list))[0]) > =3D=3D 0, \ > "All packets should enter queue 0, but enter= ed %s" % queue_list) >=20 > - def download_the_package(self, flag): > + def download_the_package(self, ice_pkg=3D"true", > safe_mode_support=3D"false"): > """ > - if flag =3D=3D true: use the correct ice.pkg file; in rxonly mod= e, all packets > should enter different queues of port 0 > - else: use wrong ice.pkg, all packets enter queue 0 of port 0 > + if ice_pkg =3D=3D true: use the correct ice.pkg file; in rxonly = mode, all packets > should enter different queues of port 0 > + else: use wrong ice.pkg > + if safe_mode_support =3D=3D true, start testpmd with "safe-m= ode-suppor=3D1", > all packets enter queue 0 of port 0 > + else safe_mode_support =3D=3D false, start testpmd without > + "safe-mode-suppor", no port is loaded in testpmd > """ > - self.use_correct_ice_pkg(flag=3Dflag) > - self.start_testpmd(flag=3Dflag) > - self.dut_testpmd.execute_cmd('set fwd mac') > - self.dut_testpmd.execute_cmd('start') > - self.tcpdump_start_sniffing([self.tester_p0, self.tester_p1]) > - self.send_packet(tran_type=3D"ipv4-other", flag=3Dflag) > + self.use_correct_ice_pkg(ice_pkg) > + self.start_testpmd(ice_pkg, safe_mode_support) > + if ice_pkg =3D=3D "false" and safe_mode_support =3D=3D "false": > + out =3D self.dut_testpmd.execute_cmd('show port info all') > + self.verify("Infos for port" not in out, "There should be no= listed port > info.") > + else: > + self.dut_testpmd.execute_cmd('set fwd mac') > + self.dut_testpmd.execute_cmd('start') > + self.tcpdump_start_sniffing([self.tester_p0, self.tester_p1]= ) > + self.send_packet(tran_type=3D"ipv4-other", flag=3Dice_pkg) >=20 > - self.dut_testpmd.execute_cmd('stop') > - self.dut_testpmd.execute_cmd('set fwd rxonly') > - self.dut_testpmd.execute_cmd('start') > - for tran_types in ["ipv4-tcp", "ipv4-udp", "ipv4-sctp", "ipv6-tc= p", "ipv6-udp", > "ipv6-sctp"]: > - print tran_types > - self.send_packet(tran_type=3Dtran_types, flag=3Dflag) > + self.dut_testpmd.execute_cmd('stop') > + self.dut_testpmd.execute_cmd('set fwd rxonly') > + self.dut_testpmd.execute_cmd('start') > + for tran_types in ["ipv4-tcp", "ipv4-udp", "ipv4-sctp", "ipv= 6-tcp", "ipv6- > udp", "ipv6-sctp"]: > + print tran_types > + self.send_packet(tran_type=3Dtran_types, flag=3Dice_pkg) >=20 > def test_download_the_package_successfully(self): > - self.download_the_package(flag=3D"true") > + """ > + use the correct ice.pkg file; in rxonly mode, all packets should= enter > different queues of port 0 > + """ > + self.download_the_package(ice_pkg=3D"true", > + safe_mode_support=3D"false") >=20 > - def test_download_the_package_failed(self): > - self.download_the_package(flag=3D"false") > + def test_driver_enters_Safe_Mode_successfully(self): > + """ > + use wrong ice.pkg and start testpmd with "safe-mode-suppor=3D1",= all > packets enter queue 0 of port 0 > + """ > + self.download_the_package(ice_pkg=3D"false", > + safe_mode_support=3D"true") > + > + def test_driver_enters_Safe_Mode_failed(self): > + """ > + use wrong ice.pkg and start testpmd without "safe-mode-suppor", = no port > is loaded in testpmd > + """ > + self.download_the_package(ice_pkg=3D"false", > + safe_mode_support=3D"false") >=20 > def tear_down(self): > self.dut_testpmd.quit() > -- > 2.17.1