From patchwork Wed Dec 14 08:42:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 120878 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 7CE3AA0543; Wed, 14 Dec 2022 09:42:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B4614021D; Wed, 14 Dec 2022 09:42:14 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 110494003F for ; Wed, 14 Dec 2022 09:42:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671007333; x=1702543333; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MXVkvG1ScpzK2e1XTY3hLxYPcCHZJs3mmf4pwAoFwJQ=; b=RBY2nQChErjeFB4PfK/5XX887/PVb5F1fdsmu6MfRVZXlZrbb0KgjQY1 116CdZA7tiV2wuT6Mrrcsko48X7gul+9fVmaJ4lpYzKySSjFXN523zGqf BBIdhcNZbUtEXyRU2mFxqwzWa3HvsrUr7Yl6+CrN71NgwIpvXvoSDvcxz EC28UymvRB5jw2SPOfk2spM+NJ37EI2S8JpPrNpRXSKgq73hg+ED4yuHt oS1PuRzQPfYZL9Qv/cks4O5YgAfnRoJdxW9jyv6pi8MXDY2K4c+Pw9yoR G4SBXZdhMpVJhBUhjgD8hS76MVYNfj3mixDEKaHEHN8AwQAY56C+U5bSO w==; X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="315983089" X-IronPort-AV: E=Sophos;i="5.96,243,1665471600"; d="scan'208";a="315983089" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 00:42:12 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="737659522" X-IronPort-AV: E=Sophos;i="5.96,243,1665471600"; d="scan'208";a="737659522" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 00:42:10 -0800 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Yu Jiang Subject: [dts][PATCH V4 1/2] tests/meson_tests: modify meson_tests suite to support test config parameter Date: Wed, 14 Dec 2022 16:42:04 +0800 Message-Id: <20221214084205.10915-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 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 Modify meson_tests suite to support test config (TIMEOUT_MULTIPLIER, TEST_ARGS etc.) in conf/meson_tests.cfg. Signed-off-by: Weiyuan Li --- Tested-by: Yu Jiang v2: -modify profile parameter descriptions and configuration items. v3: -modify configuration file comments. -the modification script uses the framework API to read the configuration file. -modify the log to the temporary directory. v4: -test script meson_param method optimization. tests/TestSuite_meson_tests.py | 36 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/TestSuite_meson_tests.py b/tests/TestSuite_meson_tests.py index ee95fffa..8dde51f6 100644 --- a/tests/TestSuite_meson_tests.py +++ b/tests/TestSuite_meson_tests.py @@ -66,7 +66,6 @@ class TestMesonTests(TestCase): skip = [] timeout = [] failed = [] - self.verify( bool(self.meson_auto_test), f"Test failed the meson no test results were obtained.", @@ -99,9 +98,18 @@ class TestMesonTests(TestCase): sub_timeout = "[" + ",".join(timeout) + "] sub case time out. " self.verify(False, f"Test failed. {sub_fail}{sub_timeout}") + def meson_param(self, case_name): + return ( + self.get_suite_cfg().get(case_name, "") + + " " + + self.get_suite_cfg().get("param", "") + ) + def check_scp_file_valid_between_dut(self): + if os.path.exists(os.path.join(self.base_output, self.dut_pathlog)): + os.remove(os.path.join(self.base_output, self.dut_pathlog)) out = self.tester.send_command( - f"scp root@{self.dut_ip}:/root/{self.dut_pathlog} {self.base_output}", + f"scp root@{self.dut_ip}:~/tmp/{self.dut_pathlog} {self.base_output}", timeout=15, ) if "Are you sure you want to continue connecting" in out: @@ -141,49 +149,46 @@ class TestMesonTests(TestCase): self.check_sub_case() def test_fasts(self): + param = self.meson_param("fast-tests") # init file name self.dut_pathlog = "fast-test.log" self.delete_exists_files() self.insmod_kni() # config test case list in conf/meson_tests.cfg - caselist = self.get_suite_cfg()["fast-tests"] - cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:fast-tests {caselist} -t {self.ratio} --test-args="-c 0xff" |tee /root/{self.dut_pathlog}' + cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --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.check_scp_file_valid_between_dut() self.check_meson_test_result() def test_driver(self): + param = self.meson_param("driver-tests") # init file name self.dut_pathlog = "driver-test.log" self.delete_exists_files() - # config test case list in conf/meson_tests.cfg - caselist = self.get_suite_cfg()["driver-tests"] - cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:driver-tests {caselist} -t {self.ratio} --test-args="-c 0xff" |tee /root/{self.dut_pathlog}' + cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --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.check_scp_file_valid_between_dut() self.check_meson_test_result() def test_debug(self): + param = self.meson_param("debug-tests") self.dut_pathlog = "test-debug.log" # delete exists files self.delete_exists_files() - # config test case list in conf/meson_tests.cfg - caselist = self.get_suite_cfg()["debug-tests"] - cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:debug-tests {caselist} -t {self.ratio} --test-args="-c 0xff" |tee /root/{self.dut_pathlog}' + cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --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.check_scp_file_valid_between_dut() self.check_meson_test_result() def test_extra(self): + param = self.meson_param("extra-tests") self.dut_pathlog = "extra-test.log" # delete exists files self.delete_exists_files() - # config test case list in conf/meson_tests.cfg - caselist = self.get_suite_cfg()["extra-tests"] - cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:extra-tests {caselist} -t {self.ratio} --test-args="-c 0xff" |tee /root/{self.dut_pathlog}' + cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --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.check_scp_file_valid_between_dut() @@ -193,13 +198,12 @@ class TestMesonTests(TestCase): ) def test_perf(self): + param = self.meson_param("perf-tests") # init file name self.dut_pathlog = "perf-test.log" # delete exists files self.delete_exists_files() - # config test case list in conf/meson_tests.cfg - caselist = self.get_suite_cfg()["perf-tests"] - cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:perf-tests {caselist} -t {self.ratio} --test-args="-c 0xff" |tee /root/{self.dut_pathlog}' + cmds = f"meson test -C x86_64-native-linuxapp-gcc/ --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.check_scp_file_valid_between_dut()