test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V5 1/2] tests/meson_tests: modify meson_tests suite to support test config parameter
@ 2022-12-22  9:46 Weiyuan Li
  2022-12-22  9:46 ` [dts][PATCH V5 2/2] conf/meson_tests: " Weiyuan Li
  0 siblings, 1 reply; 3+ messages in thread
From: Weiyuan Li @ 2022-12-22  9:46 UTC (permalink / raw)
  To: dts; +Cc: Weiyuan Li, Yu Jiang

Modify meson_tests suite to support test config (TIMEOUT_MULTIPLIER, TEST_ARGS etc.) in conf/meson_tests.cfg.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
Tested-by: Yu Jiang <yux.jiang@intel.com>

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.
v5:
-Optimize the copy method and use the framework API.

 tests/TestSuite_meson_tests.py | 62 ++++++++++++++--------------------
 1 file changed, 26 insertions(+), 36 deletions(-)

diff --git a/tests/TestSuite_meson_tests.py b/tests/TestSuite_meson_tests.py
index ee95fffa..42fd37af 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,24 +98,19 @@ class TestMesonTests(TestCase):
                 sub_timeout = "[" + ",".join(timeout) + "] sub case time out. "
             self.verify(False, f"Test failed. {sub_fail}{sub_timeout}")
 
-    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}",
-            timeout=15,
+    def meson_param(self, case_name):
+        return (
+            self.get_suite_cfg().get(case_name, "")
+            + " "
+            + self.get_suite_cfg().get("param", "")
         )
-        if "Are you sure you want to continue connecting" in out:
-            out = self.tester.send_command("yes", timeout=20)
-        for item in range(30):
-            if "password" in out:
-                self.tester.send_command(self.dut.get_password(), timeout=20)
-                break
 
-        out = self.tester.send_command(
-            f"ls -l {self.base_output}/{self.dut_pathlog}", "# "
-        )
-        self.verify(
-            "No such file or directory" not in out, "No test result log was obtained!"
-        )
+    def copy_file_from_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))
+
+        src_pathlog = f"~/tmp/{self.dut_pathlog}"
+        self.dut.session.copy_file_from(src_pathlog, self.base_output)
 
     def insmod_kni(self):
         out = self.dut.send_expect("lsmod | grep rte_kni", "# ")
@@ -141,68 +135,64 @@ 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.copy_file_from_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.copy_file_from_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.copy_file_from_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()
+        self.copy_file_from_dut()
         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)"
         )
 
     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()
+        self.copy_file_from_dut()
         self.check_meson_test_result()
 
     def tear_down(self):
-- 
2.27.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dts][PATCH V5 2/2] conf/meson_tests: modify meson_tests suite to support test config parameter
  2022-12-22  9:46 [dts][PATCH V5 1/2] tests/meson_tests: modify meson_tests suite to support test config parameter Weiyuan Li
@ 2022-12-22  9:46 ` Weiyuan Li
  2022-12-26  5:18   ` lijuan.tu
  0 siblings, 1 reply; 3+ messages in thread
From: Weiyuan Li @ 2022-12-22  9:46 UTC (permalink / raw)
  To: dts; +Cc: Weiyuan Li, Yu Jiang

Modify meson_tests suite to support test config (TIMEOUT_MULTIPLIER, TEST_ARGS etc.) in conf/meson_tests.cfg.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
Tested-by: Yu Jiang <yux.jiang@intel.com>

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.
v5:
-Optimize the copy method and use the framework API.

 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..5fefed5a 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 24 --test-args '-c 0xff' --num-processes 20 "
-- 
2.27.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dts][PATCH V5 2/2] conf/meson_tests: modify meson_tests suite to support test config parameter
  2022-12-22  9:46 ` [dts][PATCH V5 2/2] conf/meson_tests: " Weiyuan Li
@ 2022-12-26  5:18   ` lijuan.tu
  0 siblings, 0 replies; 3+ messages in thread
From: lijuan.tu @ 2022-12-26  5:18 UTC (permalink / raw)
  To: dts, Weiyuan Li; +Cc: Weiyuan Li, Yu Jiang

On Thu, 22 Dec 2022 17:46:37 +0800, Weiyuan Li <weiyuanx.li@intel.com> wrote:
> Modify meson_tests suite to support test config (TIMEOUT_MULTIPLIER, TEST_ARGS etc.) in conf/meson_tests.cfg.
> 
> Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Series applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-26  5:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22  9:46 [dts][PATCH V5 1/2] tests/meson_tests: modify meson_tests suite to support test config parameter Weiyuan Li
2022-12-22  9:46 ` [dts][PATCH V5 2/2] conf/meson_tests: " Weiyuan Li
2022-12-26  5:18   ` lijuan.tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).