[v1,3/3] dts: add vf_smoke tests suite
Checks
Commit Message
From: Jeremy Spewock <jspewock@iol.unh.edu>
VFs should be tested against the same criteria as PFs, therefore the
smoke testing suite for VFs inherits the same test cases and testing
coverage from the PF smoke testing suite. The primary difference between
the two suites is that VF smoke initially creates virtual functions to
use for testing, and then tears them down at the end of testing and
resets the state of the PFs.
Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
dts/framework/config/conf_yaml_schema.json | 3 ++-
dts/tests/TestSuite_vf_smoke_tests.py | 28 ++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 dts/tests/TestSuite_vf_smoke_tests.py
@@ -188,7 +188,8 @@
"hello_world",
"os_udp",
"pmd_buffer_scatter",
- "pf_smoke_tests"
+ "pf_smoke_tests",
+ "vf_smoke_tests"
]
},
"test_target": {
new file mode 100644
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 University of New Hampshire
+"""Virtual Function (VF) smoke testing suite.
+
+The same common DPDK functionality that is tested on physical functions (PFs) in
+:class:`.TestSuite_pf_smoke_tests.TestPfSmokeTests` should be tested on VFs. Therefore, this test
+suite inherits its test cases from the PF smoke testing suite. The primary difference in this
+testing suite is that it creates virtual functions prior to running its test cases and then removes
+them and resets the state of the PFs after it is finished.
+"""
+from .TestSuite_pf_smoke_tests import TestPfSmokeTests # type: ignore[import-untyped]
+
+
+class TestVfSmokeTests(TestPfSmokeTests):
+ """VF smoke testing suite."""
+
+ def set_up_suite(self) -> None:
+ """Extends :meth:`TestPfSmokeTests.set_up_suite` with methods to create Rx/Tx VFs."""
+ super().set_up_suite()
+ self.sut_egress_port = self.sut_node.create_virtual_functions(1, self._sut_port_egress)[0]
+ self.sut_ingress_port = self.sut_node.create_virtual_functions(1, self._sut_port_ingress)[0]
+
+ def tear_down_suite(self) -> None:
+ """Extends :meth:`TestPfSmokeTests.tear_down_suite` with VF cleanup and PF rebinding."""
+ super().tear_down_suite()
+ self.sut_node.remove_virtual_functions(self._sut_port_egress)
+ self.sut_node.remove_virtual_functions(self._sut_port_ingress)
+ self.sut_node.bind_all_ports_to_driver()