From: Weiyuan Li <weiyuanx.li@intel.com>
To: dts@dpdk.org
Cc: Weiyuan Li <weiyuanx.li@intel.com>, Yu Jiang <yux.jiang@intel.com>
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 [thread overview]
Message-ID: <20221213100001.2185-1-weiyuanx.li@intel.com> (raw)
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.
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()
--
2.27.0
next reply other threads:[~2022-12-13 9:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 10:00 Weiyuan Li [this message]
2022-12-13 10:00 ` [dts][PATCH V3 2/2] conf/meson_tests: " Weiyuan Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221213100001.2185-1-weiyuanx.li@intel.com \
--to=weiyuanx.li@intel.com \
--cc=dts@dpdk.org \
--cc=yux.jiang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).