From cc38d9c2ffa58bf507ff765e09a7382ed6bef8b5 Mon Sep 17 00:00:00 2001 From: Jian Zhao Date: Tue, 8 Jul 2025 17:39:36 +0800 Subject: [PATCH] testcase: Add sysbench thread performance test Signed-off-by: Jian Zhao --- ...ysbench-threads-16-locks-24-yields-1000.py | 53 +++++++++++++++++++ ...sbench-threads-16-locks-24-yields-10000.py | 53 +++++++++++++++++++ ...ysbench-threads-16-locks-48-yields-1000.py | 53 +++++++++++++++++++ ...sbench-threads-16-locks-48-yields-10000.py | 53 +++++++++++++++++++ ...ysbench-threads-16-locks-96-yields-1000.py | 53 +++++++++++++++++++ ...sbench-threads-16-locks-96-yields-10000.py | 53 +++++++++++++++++++ ...ysbench-threads-32-locks-24-yields-1000.py | 53 +++++++++++++++++++ ...sbench-threads-32-locks-24-yields-10000.py | 53 +++++++++++++++++++ ...ysbench-threads-32-locks-48-yields-1000.py | 53 +++++++++++++++++++ ...sbench-threads-32-locks-48-yields-10000.py | 53 +++++++++++++++++++ ...ysbench-threads-32-locks-96-yields-1000.py | 53 +++++++++++++++++++ ...sbench-threads-32-locks-96-yields-10000.py | 53 +++++++++++++++++++ ...sysbench-threads-8-locks-16-yields-1000.py | 53 +++++++++++++++++++ ...ysbench-threads-8-locks-16-yields-10000.py | 53 +++++++++++++++++++ ...sysbench-threads-8-locks-32-yields-1000.py | 53 +++++++++++++++++++ ...ysbench-threads-8-locks-32-yields-10000.py | 53 +++++++++++++++++++ ...-sysbench-threads-8-locks-8-yields-1000.py | 53 +++++++++++++++++++ ...sysbench-threads-8-locks-8-yields-10000.py | 53 +++++++++++++++++++ 18 files changed, 954 insertions(+) create mode 100755 testcase/tperf-sysbench-threads-16-locks-24-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-16-locks-24-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-16-locks-48-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-16-locks-48-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-16-locks-96-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-16-locks-96-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-32-locks-24-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-32-locks-24-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-32-locks-48-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-32-locks-48-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-32-locks-96-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-32-locks-96-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-8-locks-16-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-8-locks-16-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-8-locks-32-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-8-locks-32-yields-10000.py create mode 100755 testcase/tperf-sysbench-threads-8-locks-8-yields-1000.py create mode 100755 testcase/tperf-sysbench-threads-8-locks-8-yields-10000.py diff --git a/testcase/tperf-sysbench-threads-16-locks-24-yields-1000.py b/testcase/tperf-sysbench-threads-16-locks-24-yields-1000.py new file mode 100755 index 0000000..ea48711 --- /dev/null +++ b/testcase/tperf-sysbench-threads-16-locks-24-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000001 + @用例名称: tperf-sysbench-threads-16-locks-24-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-16-locks-24-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=16 --thread-locks=24 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-16-locks-24-yields-10000.py b/testcase/tperf-sysbench-threads-16-locks-24-yields-10000.py new file mode 100755 index 0000000..5f978a6 --- /dev/null +++ b/testcase/tperf-sysbench-threads-16-locks-24-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000002 + @用例名称: tperf-sysbench-threads-16-locks-24-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-16-locks-24-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=16 --thread-locks=24 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-16-locks-48-yields-1000.py b/testcase/tperf-sysbench-threads-16-locks-48-yields-1000.py new file mode 100755 index 0000000..5c20a2f --- /dev/null +++ b/testcase/tperf-sysbench-threads-16-locks-48-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000003 + @用例名称: tperf-sysbench-threads-16-locks-48-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-16-locks-48-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=16 --thread-locks=48 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-16-locks-48-yields-10000.py b/testcase/tperf-sysbench-threads-16-locks-48-yields-10000.py new file mode 100755 index 0000000..c725540 --- /dev/null +++ b/testcase/tperf-sysbench-threads-16-locks-48-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000004 + @用例名称: tperf-sysbench-threads-16-locks-48-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-16-locks-48-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=16 --thread-locks=48 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-16-locks-96-yields-1000.py b/testcase/tperf-sysbench-threads-16-locks-96-yields-1000.py new file mode 100755 index 0000000..7b6908b --- /dev/null +++ b/testcase/tperf-sysbench-threads-16-locks-96-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000005 + @用例名称: tperf-sysbench-threads-16-locks-96-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-16-locks-96-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=16 --thread-locks=96 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-16-locks-96-yields-10000.py b/testcase/tperf-sysbench-threads-16-locks-96-yields-10000.py new file mode 100755 index 0000000..1426ddf --- /dev/null +++ b/testcase/tperf-sysbench-threads-16-locks-96-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000006 + @用例名称: tperf-sysbench-threads-16-locks-96-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-16-locks-96-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=16 --thread-locks=96 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-32-locks-24-yields-1000.py b/testcase/tperf-sysbench-threads-32-locks-24-yields-1000.py new file mode 100755 index 0000000..9e92eed --- /dev/null +++ b/testcase/tperf-sysbench-threads-32-locks-24-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000007 + @用例名称: tperf-sysbench-threads-32-locks-24-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-32-locks-24-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=32 --thread-locks=24 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-32-locks-24-yields-10000.py b/testcase/tperf-sysbench-threads-32-locks-24-yields-10000.py new file mode 100755 index 0000000..8f94549 --- /dev/null +++ b/testcase/tperf-sysbench-threads-32-locks-24-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000008 + @用例名称: tperf-sysbench-threads-32-locks-24-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-32-locks-24-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=32 --thread-locks=24 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-32-locks-48-yields-1000.py b/testcase/tperf-sysbench-threads-32-locks-48-yields-1000.py new file mode 100755 index 0000000..d1e12a0 --- /dev/null +++ b/testcase/tperf-sysbench-threads-32-locks-48-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000009 + @用例名称: tperf-sysbench-threads-32-locks-48-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-32-locks-48-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=32 --thread-locks=48 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-32-locks-48-yields-10000.py b/testcase/tperf-sysbench-threads-32-locks-48-yields-10000.py new file mode 100755 index 0000000..010444c --- /dev/null +++ b/testcase/tperf-sysbench-threads-32-locks-48-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000010 + @用例名称: tperf-sysbench-threads-32-locks-48-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-32-locks-48-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=32 --thread-locks=48 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-32-locks-96-yields-1000.py b/testcase/tperf-sysbench-threads-32-locks-96-yields-1000.py new file mode 100755 index 0000000..0facb72 --- /dev/null +++ b/testcase/tperf-sysbench-threads-32-locks-96-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000011 + @用例名称: tperf-sysbench-threads-32-locks-96-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-32-locks-96-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=32 --thread-locks=96 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-32-locks-96-yields-10000.py b/testcase/tperf-sysbench-threads-32-locks-96-yields-10000.py new file mode 100755 index 0000000..c8e7f1e --- /dev/null +++ b/testcase/tperf-sysbench-threads-32-locks-96-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000012 + @用例名称: tperf-sysbench-threads-32-locks-96-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-32-locks-96-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=32 --thread-locks=96 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-8-locks-16-yields-1000.py b/testcase/tperf-sysbench-threads-8-locks-16-yields-1000.py new file mode 100755 index 0000000..17f7470 --- /dev/null +++ b/testcase/tperf-sysbench-threads-8-locks-16-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000013 + @用例名称: tperf-sysbench-threads-8-locks-16-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-8-locks-16-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=8 --thread-locks=16 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-8-locks-16-yields-10000.py b/testcase/tperf-sysbench-threads-8-locks-16-yields-10000.py new file mode 100755 index 0000000..3f1c51a --- /dev/null +++ b/testcase/tperf-sysbench-threads-8-locks-16-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000014 + @用例名称: tperf-sysbench-threads-8-locks-16-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-8-locks-16-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=8 --thread-locks=16 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-8-locks-32-yields-1000.py b/testcase/tperf-sysbench-threads-8-locks-32-yields-1000.py new file mode 100755 index 0000000..dd53257 --- /dev/null +++ b/testcase/tperf-sysbench-threads-8-locks-32-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000015 + @用例名称: tperf-sysbench-threads-8-locks-32-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-8-locks-32-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=8 --thread-locks=32 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-8-locks-32-yields-10000.py b/testcase/tperf-sysbench-threads-8-locks-32-yields-10000.py new file mode 100755 index 0000000..61190d6 --- /dev/null +++ b/testcase/tperf-sysbench-threads-8-locks-32-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000016 + @用例名称: tperf-sysbench-threads-8-locks-32-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-8-locks-32-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=8 --thread-locks=32 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-8-locks-8-yields-1000.py b/testcase/tperf-sysbench-threads-8-locks-8-yields-1000.py new file mode 100755 index 0000000..0d60712 --- /dev/null +++ b/testcase/tperf-sysbench-threads-8-locks-8-yields-1000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000017 + @用例名称: tperf-sysbench-threads-8-locks-8-yields-1000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-8-locks-8-yields-1000", + testname="threads", + label="L0:调度", + general_opt="--threads=8 --thread-locks=8 --thread-yields=1000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-8-locks-8-yields-10000.py b/testcase/tperf-sysbench-threads-8-locks-8-yields-10000.py new file mode 100755 index 0000000..ceda57e --- /dev/null +++ b/testcase/tperf-sysbench-threads-8-locks-8-yields-10000.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20250708-170001-000000018 + @用例名称: tperf-sysbench-threads-8-locks-8-yields-10000 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试thread项目性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行cpu性能测试 + # @预期结果: 性能测试正常并且可以获取到性能数据 + perf = PerfSysBench( + name="tperf-sysbench-threads-8-locks-8-yields-10000", + testname="threads", + label="L0:调度", + general_opt="--threads=8 --thread-locks=8 --thread-yields=10000", + ) + perf.run(warmup=1,run_loop=2,result_select_percent=90) + perf.report() + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) -- Gitee