When crypto tests were brought over to new DTS. The test type crypto was added in order to run without the overhead of a TG. In the last release, the support for no link topology was added to new DTS. When DTS is ran in this mode, no TG is made so there is no longer a need for the crypto test type. Crypto tests have been relabeled as performance tests and can be run in any topology. Running crypto tests in no link mode revealed some issues with writing NIC info when there no ports present, in this case an empty json file is written as a placeholder.
Signed-off-by: Andrew Bailey <[email protected]> --- dts/framework/config/test_run.py | 3 -- dts/framework/test_run.py | 10 +++--- dts/framework/test_suite.py | 6 ---- dts/framework/testbed_model/topology.py | 7 ++++- dts/tests/TestSuite_cryptodev_latency.py | 32 +++++++++---------- dts/tests/TestSuite_cryptodev_throughput.py | 34 ++++++++++----------- 6 files changed, 44 insertions(+), 48 deletions(-) diff --git a/dts/framework/config/test_run.py b/dts/framework/config/test_run.py index 81630df77d..dede681464 100644 --- a/dts/framework/config/test_run.py +++ b/dts/framework/config/test_run.py @@ -481,8 +481,6 @@ class TestRunConfiguration(FrozenModel): perf: bool #: Whether to run functional tests. func: bool - #: Whether to run cryptography tests. - crypto: bool #: Whether to run the testing with virtual functions instead of physical functions use_virtual_functions: bool #: Whether to skip smoke tests. @@ -522,7 +520,6 @@ def filter_tests( for tt in t.test_cases if (tt.test_type is TestCaseType.FUNCTIONAL and self.func) or (tt.test_type is TestCaseType.PERFORMANCE and self.perf) - or (tt.test_type is TestCaseType.CRYPTO and self.crypto) ) # Only include test suites that have at least one test case after filtering if test_cases: diff --git a/dts/framework/test_run.py b/dts/framework/test_run.py index c20a0fa885..2936e68d9f 100644 --- a/dts/framework/test_run.py +++ b/dts/framework/test_run.py @@ -360,17 +360,17 @@ def next(self) -> State | None: ctx.dpdk.setup() ctx.topology.setup() - testrun_nic_info: list[dict[str, str]] = ( - self.test_run.ctx.sut_node.main_session.get_nic_info() - ) + # Only collect NIC info if network ports exist. + testrun_nic_info: list[dict[str, str]] = [] + if ctx.topology.sut_ports: + testrun_nic_info = self.test_run.ctx.sut_node.main_session.get_nic_info() with open(f"{SETTINGS.output_dir}/dut_info.json", "w") as file: json.dump(testrun_nic_info, file, indent=3) - self.logger.info(f"DUT NIC info written to: {SETTINGS.output_dir}/dut_info.json") if test_run.config.use_virtual_functions: ctx.topology.instantiate_vf_ports() - if ctx.sut_node.cryptodevs and test_run.config.crypto: + if ctx.sut_node.cryptodevs and test_run.config.perf: ctx.topology.instantiate_crypto_ports() ctx.topology.bind_cryptodevs("dpdk") diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index 69ce26040a..48e0366b61 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -174,8 +174,6 @@ def filter_test_cases( perf_test_cases.add(test_case) case TestCaseType.FUNCTIONAL: func_test_cases.add(test_case) - case TestCaseType.CRYPTO: - pass if test_case_sublist_copy: raise ConfigurationError( @@ -281,8 +279,6 @@ class TestCaseType(Enum): FUNCTIONAL = auto() #: PERFORMANCE = auto() - #: - CRYPTO = auto() class TestCase(TestProtocol, Protocol[TestSuiteMethodType]): @@ -335,8 +331,6 @@ def _decorator(func: TestSuiteMethodType) -> type[TestCase]: func_test: Callable[[Any], type["TestCase"]] = TestCase.make_decorator(TestCaseType.FUNCTIONAL) #: The decorator for performance test cases. perf_test: Callable[[Any], type["TestCase"]] = TestCase.make_decorator(TestCaseType.PERFORMANCE) -#: The decorator for cryptography test cases. -crypto_test: Callable[[Any], type["TestCase"]] = TestCase.make_decorator(TestCaseType.CRYPTO) @dataclass diff --git a/dts/framework/testbed_model/topology.py b/dts/framework/testbed_model/topology.py index 1db444fc01..c3220553a2 100644 --- a/dts/framework/testbed_model/topology.py +++ b/dts/framework/testbed_model/topology.py @@ -143,9 +143,14 @@ def setup(self) -> None: Binds all the ports to the right kernel driver to retrieve MAC addresses and logical names. """ + from framework.context import get_ctx + + if self.type is not LinkTopology.NO_LINK or get_ctx().sut_node.cryptodevs: + self._prepare_devbind_script() + if self.type is LinkTopology.NO_LINK: return - self._prepare_devbind_script() + self._setup_ports("sut") self._setup_ports("tg") diff --git a/dts/tests/TestSuite_cryptodev_latency.py b/dts/tests/TestSuite_cryptodev_latency.py index 4e7d814faa..eac96f4a66 100644 --- a/dts/tests/TestSuite_cryptodev_latency.py +++ b/dts/tests/TestSuite_cryptodev_latency.py @@ -31,7 +31,7 @@ ) from api.test import skip, verify from framework.context import get_ctx -from framework.test_suite import BaseConfig, TestSuite, crypto_test +from framework.test_suite import BaseConfig, TestSuite, perf_test from framework.testbed_model.virtual_device import VirtualDevice config_list: list[dict[str, int | float | str]] = [ @@ -159,7 +159,7 @@ def _verify_latency( ) return result_list - @crypto_test + @perf_test def aes_cbc(self) -> None: """aes_cbc latency test. @@ -193,7 +193,7 @@ def aes_cbc(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def aes_cbc_sha1_hmac(self) -> None: """aes_cbc_sha1_hmac latency test. @@ -230,7 +230,7 @@ def aes_cbc_sha1_hmac(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def aes_cbc_sha2_hmac(self) -> None: """aes_cbc_sha2_hmac latency test. @@ -268,7 +268,7 @@ def aes_cbc_sha2_hmac(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def aes_docsisbpi(self) -> None: """aes_docsisbpi latency test. @@ -301,7 +301,7 @@ def aes_docsisbpi(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def aes_gcm(self) -> None: """aes_gcm latency test. @@ -337,7 +337,7 @@ def aes_gcm(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def kasumi_f8_kasumi_f9(self) -> None: """kasumi_f8_kasumi_f9 latency test. @@ -375,7 +375,7 @@ def kasumi_f8_kasumi_f9(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def snow3g_uea2_snow3g_uia2(self) -> None: """snow3g_uea2_snow3g_uia2 latency test. @@ -413,7 +413,7 @@ def snow3g_uea2_snow3g_uia2(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def zuc_eea3_zuc_eia3(self) -> None: """zuc_eea3_zuc_eia3 cipher and auth latency test. @@ -453,7 +453,7 @@ def zuc_eea3_zuc_eia3(self) -> None: # BEGIN VDEV TESTS - @crypto_test + @perf_test def aesni_gcm_vdev(self) -> None: """aesni_gcm virtual device latency test. @@ -489,7 +489,7 @@ def aesni_gcm_vdev(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def aesni_mb_cipher_then_auth_vdev(self) -> None: """aesni_mb vdev cipher and auth latency test. @@ -527,7 +527,7 @@ def aesni_mb_cipher_then_auth_vdev(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def aesni_mb_vdev(self) -> None: """aesni_mb vdev latency test. @@ -562,7 +562,7 @@ def aesni_mb_vdev(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def kasumi_vdev(self) -> None: """Kasumi vdev latency test. @@ -601,7 +601,7 @@ def kasumi_vdev(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def open_ssl_vdev(self) -> None: """open_ssl vdev latency test. @@ -637,7 +637,7 @@ def open_ssl_vdev(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def snow3g_vdev(self) -> None: """snow3g vdev latency test. @@ -677,7 +677,7 @@ def snow3g_vdev(self) -> None: "latency was greater than the delta tolerance above baseline", ) - @crypto_test + @perf_test def zuc_vdev(self) -> None: """Zuc vdev latency test. diff --git a/dts/tests/TestSuite_cryptodev_throughput.py b/dts/tests/TestSuite_cryptodev_throughput.py index 2fc0d8779a..17af743fd8 100644 --- a/dts/tests/TestSuite_cryptodev_throughput.py +++ b/dts/tests/TestSuite_cryptodev_throughput.py @@ -32,7 +32,7 @@ from api.test import verify from framework.context import get_ctx from framework.exception import SkippedTestException -from framework.test_suite import BaseConfig, TestSuite, crypto_test +from framework.test_suite import BaseConfig, TestSuite, perf_test from framework.testbed_model.virtual_device import VirtualDevice config_list: list[dict[str, int | float | str]] = [ @@ -145,7 +145,7 @@ def _verify_throughput( ) return result_list - @crypto_test + @perf_test def aes_cbc(self) -> None: """aes_cbc test. @@ -175,7 +175,7 @@ def aes_cbc(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def aes_cbc_sha1(self) -> None: """aes_cbc_sha1 test. @@ -210,7 +210,7 @@ def aes_cbc_sha1(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def aes_cbc_sha2(self) -> None: """aes_cbc_sha2 test. @@ -244,7 +244,7 @@ def aes_cbc_sha2(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def aes_cbc_sha2_digest_16(self) -> None: """aes_cbc_sha2_digest_16 test. @@ -278,7 +278,7 @@ def aes_cbc_sha2_digest_16(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def aead_aes_gcm(self) -> None: """aead_aes_gcm test. @@ -310,7 +310,7 @@ def aead_aes_gcm(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def aes_docsisbpi(self) -> None: """aes_docsisbpi test. @@ -340,7 +340,7 @@ def aes_docsisbpi(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def sha1_hmac(self) -> None: """sha1_hmac test. @@ -371,7 +371,7 @@ def sha1_hmac(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def snow3g_uea2_snow3g_uia2(self) -> None: """snow3g_uea2_snow3g_uia2 test. @@ -406,7 +406,7 @@ def snow3g_uea2_snow3g_uia2(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def zuc_eea3_zuc_eia3(self) -> None: """zuc_eea3_zuc_eia3 test. @@ -441,7 +441,7 @@ def zuc_eea3_zuc_eia3(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def kasumi_f8_kasumi_f9(self) -> None: """kasumi_f8 kasumi_f9 test. @@ -478,7 +478,7 @@ def kasumi_f8_kasumi_f9(self) -> None: # BEGIN VDEV TESTS - @crypto_test + @perf_test def aesni_mb_vdev(self) -> None: """aesni_mb virtual device test. @@ -515,7 +515,7 @@ def aesni_mb_vdev(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def aesni_gcm_vdev(self): """aesni_gcm virtual device test. @@ -548,7 +548,7 @@ def aesni_gcm_vdev(self): for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def kasumi_vdev(self) -> None: """Kasmumi virtual device test. @@ -584,7 +584,7 @@ def kasumi_vdev(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def snow3g_vdev(self) -> None: """snow3g virtual device test. @@ -621,7 +621,7 @@ def snow3g_vdev(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def zuc_vdev(self) -> None: """Zuc virtual device test. @@ -658,7 +658,7 @@ def zuc_vdev(self) -> None: for result in results: verify(result["passed"] == "PASS", "Gbps fell below delta tolerance") - @crypto_test + @perf_test def open_ssl_vdev(self) -> None: """open_ssl virtual device test. -- 2.55.0

