Previously, all performance test suites in DTS shared the same test parameters but created their own configuration. This patch creates a centralized configuration that can be shared by all performance testsuites and provides default test parameters.
Signed-off-by: Koushik Bhargav Nimoji <[email protected]> --- dts/api/test_suite.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/dts/api/test_suite.py b/dts/api/test_suite.py index 8a96a5cbad..1be9efd95e 100644 --- a/dts/api/test_suite.py +++ b/dts/api/test_suite.py @@ -107,10 +107,10 @@ def make_decorator( determine the type of test suite. Args: - test_suite_type: A functional, performance, or cryptodev test suite. + test_suite_type: A functional or performance test suite. Returns: - The decorator of a functional, performance, or cryptodev test suite. + The decorator of a functional or performance test suite. """ def _decorator(test_suite_cls: TestSuiteClassType) -> TestSuiteClassType: @@ -499,6 +499,39 @@ def discover_all( return test_suites +class PerfTestParameters(FrozenModel): + """Generic performance test suite parameters. + + Attributes: + frame_size: Ethernet frame size in bytes + num_descriptors: RX/TX ring descriptor count + expected_mpps: Baseline throughput target + """ + + frame_size: int + num_descriptors: int + expected_mpps: float + + +class PerfSuiteConfig(BaseConfig): + """Default test configuration for performance test suites. + + Attributes: + test_parameters: Default performance test parameters + delta_tolerance: Default allowed performance delta variance + """ + + test_parameters: list[PerfTestParameters] = [ + PerfTestParameters(frame_size=64, num_descriptors=1024, expected_mpps=1.00), + PerfTestParameters(frame_size=128, num_descriptors=1024, expected_mpps=1.00), + PerfTestParameters(frame_size=256, num_descriptors=1024, expected_mpps=1.00), + PerfTestParameters(frame_size=512, num_descriptors=1024, expected_mpps=1.00), + PerfTestParameters(frame_size=1024, num_descriptors=1024, expected_mpps=1.00), + PerfTestParameters(frame_size=1518, num_descriptors=1024, expected_mpps=1.00), + ] + delta_tolerance: float = 0.05 + + AVAILABLE_TEST_SUITES: list[TestSuiteSpec] = TestSuiteSpec.discover_all() """Constant to store all the available, discovered and imported test suites. -- 2.56.0

