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 D64D3A046B for ; Fri, 26 Jul 2019 08:45:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C79891C3CE; Fri, 26 Jul 2019 08:45:18 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id BBB7F1C3C3 for ; Fri, 26 Jul 2019 08:45:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 23:45:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,309,1559545200"; d="scan'208";a="189547615" Received: from unknown (HELO debug193.icx.intel.com) ([10.240.176.193]) by fmsmga001.fm.intel.com with ESMTP; 25 Jul 2019 23:45:15 -0700 From: Wenjie Li To: dts@dpdk.org Cc: Wenjie Li Date: Fri, 26 Jul 2019 15:41:00 +0000 Message-Id: <1564155660-52549-2-git-send-email-wenjiex.a.li@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1564155660-52549-1-git-send-email-wenjiex.a.li@intel.com> References: <1564155660-52549-1-git-send-email-wenjiex.a.li@intel.com> Subject: [dts] [PATCH V1 2/2] tests/enable_package_download_in_ice: 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" change cases based on dpdk 603beeb970b5d87fa7 Signed-off-by: Wenjie Li --- ...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/tests/TestSuite_enable_package_download_in_ice_driver.py index b5e3e2f..0fcc548 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 = self.tester.get_mac(localPort0) self.dut_testpmd = PmdOutput(self.dut) + self.dut_p0_pci = self.dut.get_port_pci(self.dut_ports[0]) + self.dut_p1_pci = self.dut.get_port_pci(self.dut_ports[1]) + self.pkg_file = '/lib/firmware/intel/ice/ddp/ice.pkg' out = 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, "#") - def start_testpmd(self, flag="true"): - out = self.dut_testpmd.start_testpmd("all", "--nb-cores=8 --rxq=%s --txq=%s --port-topology=chained" % (self.PF_QUEUE, self.PF_QUEUE)) - if flag != "true": - error_messages = ["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="true", safe_mode_support="false"): + if safe_mode_support == "true": + self.eal_param="-w %s,safe-mode-support=1 -w %s,safe-mode-support=1" % (self.dut_p0_pci, self.dut_p1_pci) + else: + self.eal_param="" + out = self.dut_testpmd.start_testpmd("all", "--nb-cores=8 --rxq=%s --txq=%s --port-topology=chained" % (self.PF_QUEUE, self.PF_QUEUE), eal_param=self.eal_param) + if ice_pkg == "false": + if safe_mode_support == "true": + error_messages = ["ice_load_pkg(): failed to allocate buf of size 0 for package", \ "ice_dev_init(): Failed to load the DDP package,Entering Safe Mode", \ "ice_init_rss(): RSS is not supported in safe mode"] + if safe_mode_support == "false": + error_messages = ["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=1 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 +219,8 @@ class TestEnable_Package_Download_In_Ice_Driver(TestCase): def verifyResult(self, tran_type, flag): """ - Verify whether or not the result passes. + if flag == true: all packets should enter different queues of port 0 + else: all packets enter queue 0 of port 0 """ if tran_type == "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))) == 1 and int(list(set(queue_list))[0]) == 0, \ "All packets should enter queue 0, but entered %s" % queue_list) - def download_the_package(self, flag): + def download_the_package(self, ice_pkg="true", safe_mode_support="false"): """ - if flag == 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 == 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 == true, start testpmd with "safe-mode-suppor=1", all packets enter queue 0 of port 0 + else safe_mode_support == false, start testpmd without "safe-mode-suppor", no port is loaded in testpmd """ - self.use_correct_ice_pkg(flag=flag) - self.start_testpmd(flag=flag) - 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="ipv4-other", flag=flag) + self.use_correct_ice_pkg(ice_pkg) + self.start_testpmd(ice_pkg, safe_mode_support) + if ice_pkg == "false" and safe_mode_support == "false": + out = 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="ipv4-other", flag=ice_pkg) - 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=tran_types, flag=flag) + 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=tran_types, flag=ice_pkg) def test_download_the_package_successfully(self): - self.download_the_package(flag="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="true", safe_mode_support="false") - def test_download_the_package_failed(self): - self.download_the_package(flag="false") + def test_driver_enters_Safe_Mode_successfully(self): + """ + use wrong ice.pkg and start testpmd with "safe-mode-suppor=1", all packets enter queue 0 of port 0 + """ + self.download_the_package(ice_pkg="false", safe_mode_support="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="false", safe_mode_support="false") def tear_down(self): self.dut_testpmd.quit() -- 2.17.1