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 28ED9A046B for ; Fri, 26 Jul 2019 10:51:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BE6E1C3DE; Fri, 26 Jul 2019 10:51:10 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E18DC1C3C3 for ; Fri, 26 Jul 2019 10:51:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2019 01:51:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,310,1559545200"; d="scan'208";a="172117318" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga007.fm.intel.com with ESMTP; 26 Jul 2019 01:51:06 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 26 Jul 2019 01:51:06 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 26 Jul 2019 01:51:06 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.139]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.163]) with mapi id 14.03.0439.000; Fri, 26 Jul 2019 16:51:04 +0800 From: "Peng, Yuan" To: "Li, WenjieX A" , "dts@dpdk.org" Thread-Topic: [dts][PATCH V2 2/2] tests/enable_package_download_in_ice_driver:change cases Thread-Index: AQHVQ3+x4uaJbH23V0izM+kV9x498Kbcl34w Date: Fri, 26 Jul 2019 08:51:04 +0000 Message-ID: <67D543A150B29E4CAAE53918F64EDAEA3773B3AD@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> In-Reply-To: <1564156515-53055-2-git-send-email-wenjiex.a.li@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjI4YjAwOWYtOGZlOS00OWJkLThmNDItZDY3NmQyYjI0ZWEwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSDVTSXFQbW95V2JWOVZTS2FiNVFzckpKYUcxMEVUTG1Icmxka1NtbDZJSlpRV1BBNGRcL1FqWkttUVJRSTgyNXoifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 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 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" Acked-by: Peng, Yuan -----Original Message----- From: Li, WenjieX A=20 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:ch= ange cases change test cases based on dpdk 603beeb970b5d87fa7. Signed-off-by: Wenjie Li --- V2: fix "warning: 1 line adds whitespace errors." ...e_enable_package_download_in_ice_driver.py | 77 +++++++++++++------ 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/tests/TestSuite_enable_package_download_in_ice_driver.py b/tes= ts/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 @@ cl= ass 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 --rx= q=3D%s --txq=3D%s --port-topology=3Dchained" % (self.PF_QUEUE, self.PF_QUEU= E)) - 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 for = 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-mode-= 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 --rx= q=3D%s --txq=3D%s --port-topology=3Dchained" % (self.PF_QUEUE, self.PF_QUEU= E), 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=20 + buf of size 0 for package", \ "ice_dev_init(): Failed to load the DDP package,Enteri= ng 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 bu= f of size 0 for package", \ + "ice_dev_init(): Failed to load the DDP package,Use=20 + safe-mode-support=3D1 to enter Safe Mode"] for error_message in error_messages: self.verify(error_message in out, "There should be error m= essages in out: %s" % out) self.dut_testpmd.execute_cmd('set promisc all off') @@ -209,7 +219= ,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 of = 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(TestC= ase): self.verify(len(list(set(queue_list))) =3D=3D 1 and int(li= st(set(queue_list))[0]) =3D=3D 0, \ "All packets should enter queue 0, but entered= %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 mode,= 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 mo= de, 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-mod= e-suppor=3D1", all packets enter queue 0 of port 0 + else safe_mode_support =3D=3D false, start testpmd without=20 + "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 l= isted 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-tcp"= , "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", "ipv6-= 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 e= nter different queues of port 0 + """ + self.download_the_package(ice_pkg=3D"true",=20 + 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", a= ll packets enter queue 0 of port 0 + """ + self.download_the_package(ice_pkg=3D"false",=20 + 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",=20 + safe_mode_support=3D"false") =20 def tear_down(self): self.dut_testpmd.quit() -- 2.17.1