From patchwork Mon Nov 21 06:38:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 119977 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 55687A0559; Mon, 21 Nov 2022 07:38:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AAAF40150; Mon, 21 Nov 2022 07:38:56 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id A5C654014F for ; Mon, 21 Nov 2022 07:38:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669012733; x=1700548733; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cZWU8XrUTT5O2Z1BQhHAeaBYcS5Ax1UMNlwWVmaM5gQ=; b=XaznIw0GlAxpexQP6H7D7xVtgOu90XRZ+Wsde/wsIn8JdzT/lSMGvRx1 j3VzEY6PKDjpz2FBw7dz9syxTfh+gienspafSIo9gfayYw2HkrJSTZ9At SMySZSFpX+/eyPVvmr6SgZ1SRQCxLyNDTSKqFKGTD6MqUxBvCIxo1/X7e ZrdN0RR4MVk1X9UCgoQJYsIqSUhOpRVdf7wvkqbKgwvHlSYXUg1dfPfSV oZkV8bJc9o/vhHovQ3PPoYZhP8yzVseegWTGLE1nAm2tLVC9q7jP6OmXY KcMKLia7xJuhhMSRRu8PT8DMMDBfMGJqiFmxBKpKGwvppmYAd4/ida4wH Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="312186418" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="312186418" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2022 22:38:52 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="671985981" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="671985981" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2022 22:38:50 -0800 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Yu Jiang Subject: [dts][PATCH V2 1/2] tests/meson_tests: modify meson_tests suite to support test config parameter Date: Mon, 21 Nov 2022 14:38:40 +0800 Message-Id: <20221121063841.5067-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. tests/TestSuite_meson_tests.py | 39 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/tests/TestSuite_meson_tests.py b/tests/TestSuite_meson_tests.py index ee95fffa..5600ea87 100644 --- a/tests/TestSuite_meson_tests.py +++ b/tests/TestSuite_meson_tests.py @@ -13,6 +13,8 @@ from mimetypes import init from sre_constants import SUCCESS import framework.utils as utils +from framework.config import UserConf +from framework.settings import CONFIG_ROOT_PATH from framework.test_case import TestCase @@ -36,6 +38,9 @@ class TestMesonTests(TestCase): os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "output" ) + config_file = os.path.join(CONFIG_ROOT_PATH, "meson_tests.cfg") + self.config_peer = UserConf(config_file) + def set_up(self): """ Run before each test case. @@ -99,6 +104,16 @@ 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 = "" + conf_session = self.config_peer.conf._sections + suite = conf_session["suite"][caselist] + params_list = conf_session["options"]["param"] + if suite != "-1": + param += suite + param += " " + params_list + return param + def check_scp_file_valid_between_dut(self): out = self.tester.send_command( f"scp root@{self.dut_ip}:/root/{self.dut_pathlog} {self.base_output}", @@ -141,49 +156,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 /root/{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 /root/{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 /root/{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 /root/{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 +205,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 /root/{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 Mon Nov 21 06:38:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 119978 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 AB770A055A; Mon, 21 Nov 2022 07:38:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48C8141144; Mon, 21 Nov 2022 07:38:56 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 6A86B4014F for ; Mon, 21 Nov 2022 07:38:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669012734; x=1700548734; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v6enFs93Q+HOjCfwaNuIcP/uWTmD/EKVjo1mIYDNlFg=; b=dczioyMPFOWP8AIzs5aVhfCvCxa+wwcLcZfVpH29oyA84XrfyVuRTU1H zdH0De0u6YADgPBuSqgigr6YAD2A77ndTmhoj02TrcAnvo+S3CkVJWB9C 0HriIvZTN2EF9372j8I+w8plMGeMLnZhCHqW+fCO8le0hawPkiTvwgw78 /52gpuLja9uu3UDb6bT3K4I3W0+30me5l3kkUX1xS+IByySVyKDR1Le6B oPwzDzB6zcZIbEZ9O+r5yZV+UZ9klF9tY8D0AnX5XWDo9JS0Q724WjDhL akGIcbf+CvKKdHzUS4bHc7ZB9c+rNp4DRK0dKsGtIA/79zKc1syCzS72c Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="312186422" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="312186422" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2022 22:38:54 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="671985985" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="671985985" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2022 22:38:52 -0800 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Yu Jiang Subject: [dts][PATCH V2 2/2] conf/meson_tests: modify meson_tests suite to support test config parameter Date: Mon, 21 Nov 2022 14:38:41 +0800 Message-Id: <20221121063841.5067-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221121063841.5067-1-weiyuanx.li@intel.com> References: <20221121063841.5067-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 conf/meson_tests.cfg | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/conf/meson_tests.cfg b/conf/meson_tests.cfg index 8dcb3d2e..250597fd 100644 --- a/conf/meson_tests.cfg +++ b/conf/meson_tests.cfg @@ -1,8 +1,37 @@ # config unit test case for meson test # caselist = thash_autotest trace_autotest +# not enabled if option value is set to - 1 +# 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 = -1 +driver-tests = -1 +debug-tests = -1 +extra-tests = -1 +perf-tests = -1 +[options] +param = -t 14 --test-args '-c 0xff' --num-processes 20