summaryrefslogtreecommitdiff
path: root/dts/framework/testbed_model/sut_node.py
AgeCommit message (Collapse)Author
2024-11-18dts: remove redundant test suitePaul Szczepanek
The test suite served as a demonstration of the Scapy traffic generator implementation. Now that we have a test suite that uses DPDK code (via testpmd), there is no reason to keep the test suite, as there's no expectation it'll be actually used in any setup. Signed-off-by: Juraj Linkeš <[email protected]> Signed-off-by: Paul Szczepanek <[email protected]> Reviewed-by: Luca Vizzarro <[email protected]> Reviewed-by: Patrick Robb <[email protected]>
2024-11-11dts: use Pydantic in the configurationLuca Vizzarro
This change brings in pydantic in place of warlock. Pydantic offers a built-in model validation system in the classes, which allows for a more resilient and simpler code. As a consequence of this change: - most validation is now built-in - further validation is added to verify: - cross referencing of node names and ports - test suite and test cases names - dictionaries representing the config schema are removed - the config schema is no longer used and therefore dropped - the TrafficGeneratorType enum has been changed from inheriting StrEnum to the native str and Enum. This change was necessary to enable the discriminator for object unions - the structure of the classes has been slightly changed to perfectly match the structure of the configuration files - the test suite argument catches the ValidationError that TestSuiteConfig can now raise - the DPDK location has been wrapped under another configuration mapping `dpdk_location` - the DPDK locations are now structured and enforced by classes, further simplifying the validation and handling thanks to pattern matching Bugzilla ID: 1508 Signed-off-by: Luca Vizzarro <[email protected]> Reviewed-by: Paul Szczepanek <[email protected]> Reviewed-by: Nicholas Pratte <[email protected]> Reviewed-by: Patrick Robb <[email protected]>
2024-11-08dts: refactor build and node info classesLuca Vizzarro
The DPDKBuildInfo and NodeInfo classes, representing information gathered in runtime, were erroneously placed in the configuration package. This moves them in more appropriate modules. NodeInfo, specifically, is moved to os_session instead of node mostly as a consequence of circular dependencies. And given os_session is the top-most module to reference it, it appears to be the most suitable place outside of node. Finally NodeInfo, is better renamed to OSSessionInfo as it represents the information on the target OS session. Signed-off-by: Luca Vizzarro <[email protected]> Reviewed-by: Paul Szczepanek <[email protected]> Reviewed-by: Nicholas Pratte <[email protected]> Reviewed-by: Patrick Robb <[email protected]>
2024-10-30dts: support externally compiled DPDKTomáš Ďurovec
Enable the user to use either a DPDK source tree directory or a tarball, with and without a pre-built build directory. These can be stored on either SUT node or the DTS host. The DPDK build setup or the pre-built binaries can be specified through the configuration file, the command line arguments or environment variables. Signed-off-by: Tomáš Ďurovec <[email protected]> Signed-off-by: Luca Vizzarro <[email protected]>
2024-10-30dts: enforce one DPDK build per test runTomáš Ďurovec
Given a pre-built DPDK repository can be supplied to DTS, there is no need to define multiple build targets. To simplify the process this change makes each test run use only one DPDK build whether it's pre-built or it needs to be built by DTS. Signed-off-by: Tomáš Ďurovec <[email protected]> Signed-off-by: Luca Vizzarro <[email protected]>
2024-10-30dts: rename build target to DPDK buildTomáš Ďurovec
Since the DPDK may already be built, some more general name is needed that includes both the DPDK location and the build config (if we are going to build). Signed-off-by: Tomáš Ďurovec <[email protected]> Signed-off-by: Luca Vizzarro <[email protected]>
2024-06-20dts: rework interactive shellsLuca Vizzarro
The way nodes and interactive shells interact makes it difficult to develop for static type checking and hinting. The current system relies on a top-down approach, attempting to give a generic interface to the test developer, hiding the interaction of concrete shell classes as much as possible. When working with strong typing this approach is not ideal, as Python's implementation of generics is still rudimentary. This rework reverses the tests interaction to a bottom-up approach, allowing the test developer to call concrete shell classes directly, and let them ingest nodes independently. While also re-enforcing type checking and making the code easier to read. Signed-off-by: Luca Vizzarro <[email protected]> Reviewed-by: Paul Szczepanek <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]>
2024-06-20dts: remove module-wide importsLuca Vizzarro
Remove the imports in the testbed_model and remote_session modules init file, to avoid the initialisation of unneeded modules, thus removing or limiting the risk of circular dependencies. Signed-off-by: Luca Vizzarro <[email protected]> Reviewed-by: Paul Szczepanek <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]> Reviewed-by: Jeremy Spewock <[email protected]> Reviewed-by: Nicholas Pratte <[email protected]>
2024-06-20dts: refactor EAL parameters classLuca Vizzarro
Move EalParams to its own module to avoid circular dependencies. Also the majority of the attributes are now optional. Signed-off-by: Luca Vizzarro <[email protected]> Reviewed-by: Paul Szczepanek <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]> Reviewed-by: Jeremy Spewock <[email protected]> Reviewed-by: Nicholas Pratte <[email protected]>
2024-06-20dts: use params module for interactive shellsLuca Vizzarro
Make it so that interactive shells accept an implementation of `Params` for app arguments. Convert EalParameters to use `Params` instead. String command line parameters can still be supplied by using the `Params.from_str()` method. Signed-off-by: Luca Vizzarro <[email protected]> Reviewed-by: Paul Szczepanek <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]> Reviewed-by: Jeremy Spewock <[email protected]> Reviewed-by: Nicholas Pratte <[email protected]>
2024-06-20dts: refine pre-test setup and teardown stepsJuraj Linkeš
The major part is the removal of _set_up_test_run() and _tear_down_test_run() of Node in lieu of using super() in the superclasses, which simplifies the code while achieving the same thing. The minor changes are the move of virtual devices and build target setup/teardown into SutNode from Node since both are DPDK-related which are only going to run on the SutNode. Signed-off-by: Juraj Linkeš <[email protected]> Reviewed-by: Luca Vizzarro <[email protected]> Reviewed-by: Jeremy Spewock <[email protected]>
2024-06-20dts: unify super callsJuraj Linkeš
We have two ways of calling super() in the codebase. For single inheritance, there's no benefit in listing the arguments, as the function will do exactly what we need it to do. Signed-off-by: Juraj Linkeš <[email protected]> Reviewed-by: Luca Vizzarro <[email protected]> Reviewed-by: Patrick Robb <[email protected]> Reviewed-by: Jeremy Spewock <[email protected]>
2024-06-20dts: unify class inheritance from objectJuraj Linkeš
There are two ways we specify that a class inherits from object - implicitly and explicitly. There's no need to explicitly specify that a class inherits from object and is in fact mostly a remnant from Python2. Leaving it implicit is the standard in Python3 and offers a small bonus in cases where something would assign something else to the builtin object variable. Signed-off-by: Juraj Linkeš <[email protected]> Reviewed-by: Luca Vizzarro <[email protected]> Reviewed-by: Patrick Robb <[email protected]> Reviewed-by: Jeremy Spewock <[email protected]>
2024-03-15dts: add PCI device address to parametersJeremy Spewock
Added allow list to the EAL parameters created in DTS to ensure that only the relevant PCI devices are considered when launching DPDK applications. Signed-off-by: Jeremy Spewock <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]> Tested-by: Patrick Robb <[email protected]>
2024-03-15dts: extend application parametersJeremy Spewock
Changed the factory method for creating interactive apps in the SUT Node so that EAL parameters would only be passed into DPDK apps since non-DPDK apps wouldn't be able to process them. Also modified interactive apps to allow for the ability to pass parameters into the app on startup so that the applications can be started with certain configuration steps passed on the command line. Signed-off-by: Jeremy Spewock <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]> Tested-by: Patrick Robb <[email protected]>
2023-12-21dts: update docstringsJuraj Linkeš
Format according to the Google format and PEP257, with slight deviations. Signed-off-by: Juraj Linkeš <[email protected]>
2023-12-21dts: adjust code for doc generationJuraj Linkeš
The standard Python tool for generating API documentation, Sphinx, imports modules one-by-one when generating the documentation. This requires code changes: * properly guarding argument parsing in the if __name__ == '__main__' block, * the logger used by DTS runner underwent the same treatment so that it doesn't create log files outside of a DTS run, * however, DTS uses the arguments to construct an object holding global variables. The defaults for the global variables needed to be moved from argument parsing elsewhere, * importing the remote_session module from framework resulted in circular imports because of one module trying to import another module. This is fixed by reorganizing the code, * some code reorganization was done because the resulting structure makes more sense, improving documentation clarity. The are some other changes which are documentation related: * added missing type annotation so they appear in the generated docs, * reordered arguments in some methods, * removed superfluous arguments and attributes, * change private functions/methods/attributes to private and vice-versa. The above all appear in the generated documentation and the with them, the documentation is improved. Signed-off-by: Juraj Linkeš <[email protected]>
2023-11-20dts: reformat to 100 line lengthJuraj Linkeš
Reformat to 100 from the previous 88 to unify with C recommendations. The C recommendation is the maximum with the ideal being 80. The Python tools are not suitable for this flexibility. We require all patches with DTS code to be validated with the devtools/dts-check-format.sh script, part of which is the black formatting tool. We've set up black to format all of the codebase and the reformat is needed so that future submitters are not affected. Signed-off-by: Juraj Linkeš <[email protected]> Acked-by: Jeremy Spewock <[email protected]>
2023-11-14dts: bind to DPDK driver before running testsJeremy Spewock
Modifies the current process so that we bind to os_driver_for_dpdk from the configuration file before running test suites and bind back to the os_driver afterwards. This allows test suites to assume that the ports are bound to a DPDK supported driver or bind to either driver as needed. Signed-off-by: Jeremy Spewock <[email protected]> Acked-by: Patrick Robb <[email protected]>
2023-07-24dts: add basic UDP test caseJuraj Linkeš
The test cases showcases the scapy traffic generator code. Signed-off-by: Juraj Linkeš <[email protected]> Acked-by: Jeremy Spewock <[email protected]>
2023-07-24dts: add traffic generator abstractionsJuraj Linkeš
There are traffic abstractions for all traffic generators and for traffic generators that can capture (not just count) packets. There also related abstractions, such as TGNode where the traffic generators reside and some related code. Signed-off-by: Juraj Linkeš <[email protected]>
2023-07-24dts: add traffic generator configJuraj Linkeš
Node configuration - where to connect, what ports to use and what TG to use. Signed-off-by: Juraj Linkeš <[email protected]>
2023-07-22dts: add smoke testsJeremy Spewock
Adds a new test suite for running smoke tests that verify general configuration aspects of the system under test. If any of these tests fail, the DTS execution terminates as part of a "fail-fast" model. Signed-off-by: Jeremy Spewock <[email protected]> Reviewed-by: Juraj Linkeš <[email protected]>
2023-07-12dts: replace pexpect with fabricJuraj Linkeš
Pexpect is not a dedicated SSH connection library while Fabric is. With Fabric, all SSH-related logic is provided and we can just focus on what's DTS specific. Signed-off-by: Juraj Linkeš <[email protected]> Acked-by: Jeremy Spewock <[email protected]> Tested-by: Patrick Robb <[email protected]>
2023-03-19dts: add hello world test suiteJuraj Linkeš
The test suite implements test cases defined in the corresponding test plan. Signed-off-by: Juraj Linkeš <[email protected]> Tested-by: Bruce Richardson <[email protected]> Tested-by: Chenyu Huang <[email protected]> Tested-by: Patrick Robb <[email protected]>
2023-03-19dts: add DPDK execution handlingJuraj Linkeš
Add methods for setting up and shutting down DPDK apps and for constructing EAL parameters. Signed-off-by: Juraj Linkeš <[email protected]> Tested-by: Bruce Richardson <[email protected]> Tested-by: Chenyu Huang <[email protected]> Tested-by: Patrick Robb <[email protected]>
2023-03-19dts: add DPDK build on SUTJuraj Linkeš
Add the ability to build DPDK and apps on the SUT, using a configured target. Signed-off-by: Juraj Linkeš <[email protected]> Tested-by: Bruce Richardson <[email protected]> Tested-by: Chenyu Huang <[email protected]> Tested-by: Patrick Robb <[email protected]>
2023-03-19dts: add node and OS abstractionsJuraj Linkeš
The abstraction model in DTS is as follows: Node, defining and implementing methods common to and the base of SUT (system under test) Node and TG (traffic generator) Node. Remote Session, defining and implementing methods common to any remote session implementation, such as SSH Session. OSSession, defining and implementing methods common to any operating system/distribution, such as Linux. OSSession uses a derived Remote Session and Node in turn uses a derived OSSession. This split delegates OS-specific and connection-specific code to specialized classes designed to handle the differences. The base classes implement the methods or parts of methods that are common to all implementations and defines abstract methods that must be implemented by derived classes. Part of the abstractions is the DTS test execution skeleton: execution setup, build setup and then test execution. Signed-off-by: Juraj Linkeš <[email protected]> Tested-by: Bruce Richardson <[email protected]> Tested-by: Chenyu Huang <[email protected]> Tested-by: Patrick Robb <[email protected]>