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 84BD0A3168 for ; Thu, 17 Oct 2019 07:37:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B110C1E54B; Thu, 17 Oct 2019 07:37:16 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E9EA31E4EC for ; Thu, 17 Oct 2019 07:37:14 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 22:37:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,306,1566889200"; d="scan'208";a="208564834" Received: from unknown (HELO dpdk-wenjielx-KVM190.icx.intel.com) ([10.238.54.190]) by fmsmga001.fm.intel.com with ESMTP; 16 Oct 2019 22:37:12 -0700 From: Wenjie Li To: dts@dpdk.org Cc: Wenjie Li Date: Thu, 17 Oct 2019 14:29:00 +0000 Message-Id: <1571322540-68651-2-git-send-email-wenjiex.a.li@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1571322540-68651-1-git-send-email-wenjiex.a.li@intel.com> References: <1571322540-68651-1-git-send-email-wenjiex.a.li@intel.com> Subject: [dts] [PATCH V1] tests/enable_package_download_in_ice_driver: align change in dpdk 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" In dpdk 03a05924dad01d5, the pkg search path are /lib/firmware/updates/intel/ice/ddp/ and /lib/firmware/intel/ice/ddp/; and in dpdk 6f51deb903b2558483, the expetcted behavior of test_driver_enters_Safe_Mode_failed changed; align these changes. Signed-off-by: Wenjie Li --- ...e_enable_package_download_in_ice_driver.py | 61 +++++++++++-------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/tests/TestSuite_enable_package_download_in_ice_driver.py b/tests/TestSuite_enable_package_download_in_ice_driver.py index b225ef3..fd6a27e 100644 --- a/tests/TestSuite_enable_package_download_in_ice_driver.py +++ b/tests/TestSuite_enable_package_download_in_ice_driver.py @@ -54,9 +54,12 @@ class TestEnable_Package_Download_In_Ice_Driver(TestCase): self.tester_p0_mac = self.tester.get_mac(localPort0) self.dut_testpmd = PmdOutput(self.dut) - 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) + self.pkg_file1 = '/lib/firmware/intel/ice/ddp/ice.pkg' + self.pkg_file2 = '/lib/firmware/updates/intel/ice/ddp/ice.pkg' + out = self.dut.send_expect("ls %s" % self.pkg_file1, "#") + self.verify("No such file or directory" not in out, "Cannot find %s, please check you system/driver." % self.pkg_file1) + out = self.dut.send_expect("ls %s" % self.pkg_file2, "#") + self.verify("No such file or directory" not in out, "Cannot find %s, please check you system/driver." % self.pkg_file2) self.backup_recover_ice_pkg("backup") def set_up(self): @@ -64,25 +67,28 @@ class TestEnable_Package_Download_In_Ice_Driver(TestCase): def backup_recover_ice_pkg(self, flag="backup"): """ - if backup == true: backup /lib/firmware/intel/ice/ddp/ice.pkg to ~/ice.pkg_backup - else: recover ~/ice.pkg_backup to /lib/firmware/intel/ice/ddp/ice.pkg + if backup == true: backup /lib/firmware/intel/ice/ddp/ice.pkg and /lib/firmware/updates/intel/ice/ddp/ice.pkg to /opt/ice.pkg_backup + else: recover /opt/ice.pkg_backup to /lib/firmware/intel/ice/ddp/ice.pkg and /lib/firmware/updates/intel/ice/ddp/ice.pkg """ backup_file = '/opt/ice.pkg_backup' if flag == "backup": - self.dut.send_expect("\cp %s %s" % (self.pkg_file, backup_file), "#") + self.dut.send_expect("\cp %s %s" % (self.pkg_file1, backup_file), "#") else: - self.dut.send_expect("\cp %s %s" % (backup_file, self.pkg_file), "#") + self.dut.send_expect("\cp %s %s" % (backup_file, self.pkg_file1), "#") + self.dut.send_expect("\cp %s %s" % (backup_file, self.pkg_file2), "#") def use_correct_ice_pkg(self, flag="true"): """ - if flag == true: use /lib/firmware/intel/ice/ddp/ice.pkg - else: touch a wrong /lib/firmware/intel/ice/ddp/ice.pkg + if flag == true: use correct /lib/firmware/intel/ice/ddp/ice.pkg and /lib/firmware/updates/intel/ice/ddp/ice.pkg + else: touch a wrong /lib/firmware/intel/ice/ddp/ice.pkg and /lib/firmware/updates/intel/ice/ddp/ice.pkg """ if flag == "true": self.backup_recover_ice_pkg("recover") else: - self.dut.send_expect("rm -rf %s" % self.pkg_file, "#") - self.dut.send_expect("touch %s" % self.pkg_file, "#") + self.dut.send_expect("rm -rf %s" % self.pkg_file1, "#") + self.dut.send_expect("touch %s" % self.pkg_file1, "#") + self.dut.send_expect("rm -rf %s" % self.pkg_file2, "#") + self.dut.send_expect("touch %s" % self.pkg_file2, "#") def start_testpmd(self, ice_pkg="true", safe_mode_support="false"): self.eal_param = "" @@ -252,21 +258,18 @@ class TestEnable_Package_Download_In_Ice_Driver(TestCase): """ 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=ice_pkg) + 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=ice_pkg) def test_download_the_package_successfully(self): """ @@ -284,7 +287,13 @@ class TestEnable_Package_Download_In_Ice_Driver(TestCase): """ 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") + self.use_correct_ice_pkg(flag="false") + cmd = "./%s/app/testpmd -c 0x7 -n 4 -- -i --nb-cores=8 --rxq=%s --txq=%s --port-topology=chained" % (self.target, self.PF_QUEUE, self.PF_QUEUE) + out = self.dut.send_expect(cmd, "#", 60) + 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 '%s' in out: %s" % (error_message, out)) def tear_down(self): self.dut_testpmd.quit() -- 2.17.1