From patchwork Tue Dec 13 10:00:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 120818 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 DC0F1A0540; Tue, 13 Dec 2022 10:55:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D471D40395; Tue, 13 Dec 2022 10:55:22 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 86B6140146 for ; Tue, 13 Dec 2022 10:55:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670925321; x=1702461321; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lA/p/AUNkSdwALLNT1bry8KOacaw6oEcwIDd5uRDBPM=; b=aU5YFKXew1dgDTCnxRf5vWj3EvQ9Rfj6DoHlJK+Wdp/Q+NVEF+IJO8Z5 AhN4HC1CKlwAyKStp8QKzwtahFAQylL9S1x5midHkBcP7hp9wYTFctXtm ZnyQDOGWkSc9sSFe66Mo3HDZ4T1OquGkNucvAcsY3lX7FouYV0DPd2wh+ bpnSa9KDjEv21UqWwXKT6NcIM/P+pUMskvLrF5auZaUOVJHHWevC9eQYX 0kMffl4dQ60Uf/rnnJ473OHakokjVKsnfjQMbZWbT8bMgxuatxsWd1/T6 0lw7MEcB3bFBPaAseMl7uSCKlcB4kWvF792h2rwIv307roXFMCwyfosQQ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="404348688" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="404348688" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 01:55:20 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="650679843" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="650679843" Received: from unknown (HELO dpdk-VF-dut247..) ([10.239.252.247]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 01:55:19 -0800 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Yu Jiang Subject: [dts][PATCH V3 1/2] tests/meson_tests: modify meson_tests suite to support test config parameter Date: Tue, 13 Dec 2022 18:00:00 +0800 Message-Id: <20221213100001.2185-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.34.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 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. tests/TestSuite_meson_tests.py | 38 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tests/TestSuite_meson_tests.py b/tests/TestSuite_meson_tests.py index ee95fffa..368eeb8d 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,20 @@ 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, caselist): + param = "" + suite = self.get_suite_cfg().get(caselist, "") + params = self.get_suite_cfg().get("param", "") + if suite is not None: + param += suite + param += " " + params + return 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 +151,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 +200,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() From patchwork Tue Dec 13 10:00:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 120819 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 78220A0542; Tue, 13 Dec 2022 10:55:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F39844021D; Tue, 13 Dec 2022 10:55:23 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 8E4C740146 for ; Tue, 13 Dec 2022 10:55:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670925322; x=1702461322; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p9TepAoj4vSMxh/Xprn0IKVdKSl3Arj1o6Z0sLBo9tk=; b=JhH0LYk8HCLVFY5sF+gKbbFpvOkg+ZJg+5CymLHyb1cqPGkoBOl4z+b1 mVeKXOHP5Iti/jE6i4uWM/wPyoufZNgHoPJZsONmlxrj2xXS8OmZtPt5D HDzBbIcBLHAep+7Yqzom8gPJ7/FJEuTvpHBP6u9hwrXBRyDNKubHYfOt4 tEnTNm5KcgQMvgzESHnEOTA1G6DVp9OoZZEXrszrKsAeBgBn/X6rwWV/t vOXvsnxGb6zP0KbnMpnQ7yb/03dNJTwDChE6z532Rc8Oes3Nzf/JLeg+c 55551t7eKVztNOoOf1xmYlGP5QoBzMc4cqroOAPxyECJRSPFRWviizxKY w==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="404348690" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="404348690" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 01:55:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="650679848" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="650679848" Received: from unknown (HELO dpdk-VF-dut247..) ([10.239.252.247]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 01:55:20 -0800 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Yu Jiang Subject: [dts][PATCH V3 2/2] conf/meson_tests: modify meson_tests suite to support test config parameter Date: Tue, 13 Dec 2022 18:00:01 +0800 Message-Id: <20221213100001.2185-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221213100001.2185-1-weiyuanx.li@intel.com> References: <20221213100001.2185-1-weiyuanx.li@intel.com> 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. conf/meson_tests.cfg | 45 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/conf/meson_tests.cfg b/conf/meson_tests.cfg index 8dcb3d2e..7c759512 100644 --- a/conf/meson_tests.cfg +++ b/conf/meson_tests.cfg @@ -1,8 +1,41 @@ # config unit test case for meson test -# caselist = thash_autotest trace_autotest +# +# Specify the sub cases of the meson test suite, such as: +# fast-tests = "acl_autotest" +# driver-tests = "dmadev_autotest" +# ... +# +# Option param defines the meson parameter usage: +# meson test [-h] [--repeat REPEAT] [--no-rebuild] [--gdb] [--gdb-path GDB_PATH] [--list] [--wrapper WRAPPER] [-C WD] [--suite SUITE] [--no-suite SUITE] [--no-stdsplit] +# [--print-errorlogs] [--benchmark] [--logbase LOGBASE] [--num-processes NUM_PROCESSES] [-v] [-q] [-t TIMEOUT_MULTIPLIER] [--setup SETUP] [--test-args TEST_ARGS] +# [args ...] +# options: +# -h, --help show this help message and exit +# --repeat REPEAT Number of times to run the tests. +# --no-rebuild Do not rebuild before running tests. +# --gdb Run test under gdb. +# --gdb-path GDB_PATH Path to the gdb binary (default: gdb). +# --list List available tests. +# --wrapper WRAPPER wrapper to run tests with (e.g. Valgrind) +# -C WD directory to cd into before running +# --suite SUITE Only run tests belonging to the given suite. +# --no-suite SUITE Do not run tests belonging to the given suite. +# --no-stdsplit Do not split stderr and stdout in test logs. +# --print-errorlogs Whether to print failing tests' logs. +# --benchmark Run benchmarks instead of tests. +# --logbase LOGBASE Base name for log file. +# --num-processes NUM_PROCESSES How many parallel processes to use. +# -v, --verbose Do not redirect stdout and stderr +# -q, --quiet Produce less output to the terminal. +# -t TIMEOUT_MULTIPLIER, --timeout-multiplier TIMEOUT_MULTIPLIER Define a multiplier for test timeout, for example when running tests in particular conditions they might take more +# time to execute. (<= 0 to disable timeout) +# --setup SETUP Which test setup to use. +# --test-args TEST_ARGS Arguments to pass to the specified test(s) or all tests + [suite] -fast-tests = " " -driver-tests = " " -debug-tests = " " -extra-tests = " " -perf-tests = " " +fast-tests = "" +driver-tests = "" +debug-tests = "" +extra-tests = "" +perf-tests = "" +param = "-t 14 --test-args '-c 0xff' --num-processes 20 "