From patchwork Wed May 17 09:08:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 126911 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6FF842B2A; Wed, 17 May 2023 11:09:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C466542D3D; Wed, 17 May 2023 11:09:04 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 0A44F42D3D for ; Wed, 17 May 2023 11:09:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684314544; x=1715850544; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TNS0ggdcouZGEqxHbigACBtAViJb/NcmwKgME7JJXSU=; b=PxqbltzdS66D9yjhpLx9pT9o5n2GN2J2WMpFBqPhYwpqrGsmRkx4292y EGI0nf9PhsahV5coMRt0+mvssjtkffJLsj+z0zPc7pB0wTlsBUdu22WFl Cvzb9b5mv082Qcmkr8J+1b6CAu8kxlyS05x2wEbRDyPMvFoKnlIl8RVP+ hCXsofB0B3YUrv6oJUowFk6qZXGoz+CkUytx4LmlgtjblFYgzKlB1b1P+ eeztYt4NYTjmatiaRmF+YAq4fzA9KM2X+9BUXSa70XztjOmzE9PGrQtbB WVss/vlfREWmBFNbl8r+0OnaNZB2ItvSo/B6vKSFFTDKnmCTOMNc7ocTW w==; X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="415119099" X-IronPort-AV: E=Sophos;i="5.99,281,1677571200"; d="scan'208";a="415119099" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 02:09:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="732328184" X-IronPort-AV: E=Sophos;i="5.99,281,1677571200"; d="scan'208";a="732328184" Received: from unknown (HELO localhost.localdomain) ([10.239.252.196]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 02:09:01 -0700 From: Yu Jiang To: lijuan.tu@intel.com, dts@dpdk.org Cc: Yu Jiang Subject: [dts][PATCH V1] tests/meson_tests: split test_args in conf/meson_tests.cfg, add -a param and save meson test log Date: Wed, 17 May 2023 17:08:56 +0800 Message-Id: <20230517090856.1959145-1-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 1, add "-a" param to avoid conflict when running in container 2, save detailed /root/dpdk/<>/meson-logs/testlog.txt to dts/output Signed-off-by: Yu Jiang --- conf/meson_tests.cfg | 3 ++- tests/TestSuite_meson_tests.py | 48 +++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/conf/meson_tests.cfg b/conf/meson_tests.cfg index 5fefed5a..d6cb8359 100644 --- a/conf/meson_tests.cfg +++ b/conf/meson_tests.cfg @@ -38,4 +38,5 @@ driver-tests = "" debug-tests = "" extra-tests = "" perf-tests = "" -param = "-t 24 --test-args '-c 0xff' --num-processes 20 " +test_args = "-c 0xff" +other_param = "-t 24 --num-processes 20 " diff --git a/tests/TestSuite_meson_tests.py b/tests/TestSuite_meson_tests.py index a0bba9b0..d176392a 100644 --- a/tests/TestSuite_meson_tests.py +++ b/tests/TestSuite_meson_tests.py @@ -28,6 +28,7 @@ class TestMesonTests(TestCase): # -t 2 self.ratio = 6 self.dut_pathlog = "fast-test.log" + self.testlog = "" self.execute_wait_time = self.ratio * self.timeout * 10 # skip scope self.SKIP_SCOPE = "" @@ -35,6 +36,10 @@ class TestMesonTests(TestCase): self.base_output = os.path.join( os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "output" ) + self.dutPorts = self.dut.get_ports() + self.dutPorts_PCI = [] + for port in self.dutPorts: + self.dutPorts_PCI.append(self.dut.get_port_pci(self.dutPorts[port])) def set_up(self): """ @@ -99,17 +104,26 @@ class TestMesonTests(TestCase): self.verify(False, f"Test failed. {sub_fail}{sub_timeout}") def meson_param(self, case_name): + # add -a param when running in container + test_args = self.get_suite_cfg().get("test_args", "") + if self.dutPorts_PCI: + for pci in self.dutPorts_PCI: + test_args += " -a " + pci return ( self.get_suite_cfg().get(case_name, "") + " " - + self.get_suite_cfg().get("param", "") + + self.get_suite_cfg().get("other_param", "") + + " --test-args \'{}\'".format(test_args) ) - def copy_file_from_dut(self): + def copy_file_from_dut(self, case_name): if os.path.exists(os.path.join(self.base_output, self.dut_pathlog)): os.remove(os.path.join(self.base_output, self.dut_pathlog)) src_pathlog = f"/tmp/{self.dut_pathlog}" self.dut.session.copy_file_from(src_pathlog, self.base_output) + if self.testlog: + tester_pathlog = self.base_output + "/" + "{}_mesontest.log".format(case_name) + self.dut.session.copy_file_from(self.testlog, tester_pathlog) def insmod_kni(self): out = self.dut.send_expect("lsmod | grep rte_kni", "# ") @@ -142,8 +156,10 @@ class TestMesonTests(TestCase): # config test case list in conf/meson_tests.cfg cmds = f"meson test -C {self.target} --suite DPDK:fast-tests {param} |tee /tmp/{self.dut_pathlog}" out = self.dut.send_expect(cmds, "# ", self.execute_wait_time) - self.logger.info(out) - self.copy_file_from_dut() + # Full log written to /root/dpdk/<>/meson-logs/testlog.txt + self.testlog = re.search(r"Full log written to (\S+)", out).groups()[0] + self.logger.info(self.testlog) + self.copy_file_from_dut("fast-tests") self.check_meson_test_result() def test_driver(self): @@ -153,8 +169,10 @@ class TestMesonTests(TestCase): self.delete_exists_files() cmds = f"meson test -C {self.target} --suite DPDK:driver-tests {param} |tee /tmp/{self.dut_pathlog}" out = self.dut.send_expect(cmds, "# ", self.execute_wait_time) - self.logger.info(out) - self.copy_file_from_dut() + # Full log written to /root/dpdk/<>/meson-logs/testlog.txt + self.testlog = re.search(r"Full log written to (\S+)", out).groups()[0] + self.logger.info(self.testlog) + self.copy_file_from_dut("driver-tests") self.check_meson_test_result() def test_debug(self): @@ -164,8 +182,10 @@ class TestMesonTests(TestCase): self.delete_exists_files() cmds = f"meson test -C {self.target} --suite DPDK:debug-tests {param} |tee /tmp/{self.dut_pathlog}" out = self.dut.send_expect(cmds, "# ", self.execute_wait_time) - self.logger.info(out) - self.copy_file_from_dut() + # Full log written to /root/dpdk/<>/meson-logs/testlog.txt + self.testlog = re.search(r"Full log written to (\S+)", out).groups()[0] + self.logger.info(self.testlog) + self.copy_file_from_dut("debug-tests") self.check_meson_test_result() def test_extra(self): @@ -175,8 +195,10 @@ class TestMesonTests(TestCase): self.delete_exists_files() cmds = f"meson test -C {self.target} --suite DPDK:extra-tests {param} |tee /tmp/{self.dut_pathlog}" out = self.dut.send_expect(cmds, "# ", self.execute_wait_time) - self.logger.info(out) - self.copy_file_from_dut() + # Full log written to /root/dpdk/<>/meson-logs/testlog.txt + self.testlog = re.search(r"Full log written to (\S+)", out).groups()[0] + self.logger.info(self.testlog) + self.copy_file_from_dut("extra-tests") self.check_meson_test_result() self.logger.warning( "Extra-tests are know issues which are recorded in DPDK commit and meson.build (detail see test plan)" @@ -190,8 +212,10 @@ class TestMesonTests(TestCase): self.delete_exists_files() cmds = f"meson test -C {self.target} --suite DPDK:perf-tests {param} |tee /tmp/{self.dut_pathlog}" out = self.dut.send_expect(cmds, "# ", self.execute_wait_time) - self.logger.info(out) - self.copy_file_from_dut() + # Full log written to /root/dpdk/<>/meson-logs/testlog.txt + self.testlog = re.search(r"Full log written to (\S+)", out).groups()[0] + self.logger.info(self.testlog) + self.copy_file_from_dut("perf-tests") self.check_meson_test_result() def tear_down(self):