<div dir="ltr">Tested-by: Patrick Robb <<a href="mailto:probb@iol.unh.edu">probb@iol.unh.edu</a>></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 3, 2023 at 5:25 AM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Document how to configure and run DTS.<br>
Also add documentation related to new features: SUT setup and a brief<br>
test suite implementation cookbook.<br>
<br>
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech><br>
---<br>
doc/guides/tools/dts.rst | 165 ++++++++++++++++++++++++++++++++++++++-<br>
1 file changed, 163 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/doc/guides/tools/dts.rst b/doc/guides/tools/dts.rst<br>
index daf54359ed..ebd6dceb6a 100644<br>
--- a/doc/guides/tools/dts.rst<br>
+++ b/doc/guides/tools/dts.rst<br>
@@ -1,5 +1,5 @@<br>
.. SPDX-License-Identifier: BSD-3-Clause<br>
- Copyright(c) 2022 PANTHEON.tech s.r.o.<br>
+ Copyright(c) 2022-2023 PANTHEON.tech s.r.o.<br>
<br>
DPDK Test Suite<br>
===============<br>
@@ -56,7 +56,7 @@ DTS runtime environment or just plain DTS environment are used interchangeably.<br>
<br>
<br>
Setting up DTS environment<br>
---------------------------<br>
+~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<br>
#. **Python Version**<br>
<br>
@@ -93,6 +93,167 @@ Setting up DTS environment<br>
poetry install<br>
poetry shell<br>
<br>
+#. **SSH Connection**<br>
+<br>
+ DTS uses Python pexpect for SSH connections between DTS environment and the other hosts.<br>
+ The pexpect implementation is a wrapper around the ssh command in the DTS environment.<br>
+ This means it'll use the SSH agent providing the ssh command and its keys.<br>
+<br>
+<br>
+Setting up System Under Test<br>
+----------------------------<br>
+<br>
+There are two areas that need to be set up on a System Under Test:<br>
+<br>
+#. **DPDK dependencies**<br>
+<br>
+ DPDK will be built and run on the SUT.<br>
+ Consult the Getting Started guides for the list of dependencies for each distribution.<br>
+<br>
+#. **Hardware dependencies**<br>
+<br>
+ Any hardware DPDK uses needs a proper driver<br>
+ and most OS distributions provide those, but the version may not be satisfactory.<br>
+ It's up to each user to install the driver they're interested in testing.<br>
+ The hardware also may also need firmware upgrades, which is also left at user discretion.<br>
+<br>
+#. **Hugepages**<br>
+<br>
+ There are two ways to configure hugepages:<br>
+<br>
+ * DTS configuration<br>
+<br>
+ You may specify the optional hugepage configuration in the DTS config file.<br>
+ If you do, DTS will take care of configuring hugepages,<br>
+ overwriting your current SUT hugepage configuration.<br>
+<br>
+ * System under test configuration<br>
+<br>
+ It's possible to use the hugepage configuration already present on the SUT.<br>
+ If you wish to do so, don't specify the hugepage configuration in the DTS config file.<br>
+<br>
+<br>
+Running DTS<br>
+-----------<br>
+<br>
+DTS needs to know which nodes to connect to and what hardware to use on those nodes.<br>
+Once that's configured, DTS needs a DPDK tarball and it's ready to run.<br>
+<br>
+Configuring DTS<br>
+~~~~~~~~~~~~~~~<br>
+<br>
+DTS configuration is split into nodes and executions and build targets within executions.<br>
+By default, DTS will try to use the ``dts/conf.yaml`` config file,<br>
+which is a template that illustrates what can be configured in DTS:<br>
+<br>
+ .. literalinclude:: ../../../dts/conf.yaml<br>
+ :language: yaml<br>
+ :start-at: executions:<br>
+<br>
+<br>
+The user must be root or any other user with prompt starting with ``#``.<br>
+The other fields are mostly self-explanatory<br>
+and documented in more detail in ``dts/framework/config/conf_yaml_schema.json``.<br>
+<br>
+DTS Execution<br>
+~~~~~~~~~~~~~<br>
+<br>
+DTS is run with ``main.py`` located in the ``dts`` directory after entering Poetry shell::<br>
+<br>
+ usage: main.py [-h] [--config-file CONFIG_FILE] [--output-dir OUTPUT_DIR] [-t TIMEOUT]<br>
+ [-v VERBOSE] [-s SKIP_SETUP] [--tarball TARBALL]<br>
+ [--compile-timeout COMPILE_TIMEOUT] [--test-cases TEST_CASES]<br>
+ [--re-run RE_RUN]<br>
+<br>
+ Run DPDK test suites. All options may be specified with the environment variables provided in<br>
+ brackets. Command line arguments have higher priority.<br>
+<br>
+ options:<br>
+ -h, --help show this help message and exit<br>
+ --config-file CONFIG_FILE<br>
+ [DTS_CFG_FILE] configuration file that describes the test cases, SUTs<br>
+ and targets. (default: conf.yaml)<br>
+ --output-dir OUTPUT_DIR, --output OUTPUT_DIR<br>
+ [DTS_OUTPUT_DIR] Output directory where dts logs and results are<br>
+ saved. (default: output)<br>
+ -t TIMEOUT, --timeout TIMEOUT<br>
+ [DTS_TIMEOUT] The default timeout for all DTS operations except for<br>
+ compiling DPDK. (default: 15)<br>
+ -v VERBOSE, --verbose VERBOSE<br>
+ [DTS_VERBOSE] Set to 'Y' to enable verbose output, logging all<br>
+ messages to the console. (default: N)<br>
+ -s SKIP_SETUP, --skip-setup SKIP_SETUP<br>
+ [DTS_SKIP_SETUP] Set to 'Y' to skip all setup steps on SUT and TG<br>
+ nodes. (default: N)<br>
+ --tarball TARBALL, --snapshot TARBALL<br>
+ [DTS_DPDK_TARBALL] Path to DPDK source code tarball which will be<br>
+ used in testing. (default: dpdk.tar.xz)<br>
+ --compile-timeout COMPILE_TIMEOUT<br>
+ [DTS_COMPILE_TIMEOUT] The timeout for compiling DPDK. (default: 1200)<br>
+ --test-cases TEST_CASES<br>
+ [DTS_TESTCASES] Comma-separated list of test cases to execute.<br>
+ Unknown test cases will be silently ignored. (default: )<br>
+ --re-run RE_RUN, --re_run RE_RUN<br>
+ [DTS_RERUN] Re-run each test case the specified amount of times if a<br>
+ test failure occurs (default: 0)<br>
+<br>
+<br>
+The brackets contain the names of environment variables that set the same thing.<br>
+The minimum DTS needs is a config file and a DPDK tarball.<br>
+You may pass those to DTS using the command line arguments or use the default paths.<br>
+<br>
+<br>
+DTS Results<br>
+~~~~~~~~~~~<br>
+<br>
+Results are stored in the output dir by default<br>
+which be changed with the ``--output-dir`` command line argument.<br>
+The results contain basic statistics of passed/failed test cases and DPDK version.<br>
+<br>
+<br>
+How To Write a Test Suite<br>
+-------------------------<br>
+<br>
+All test suites inherit from ``TestSuite`` defined in ``dts/framework/test_suite.py``.<br>
+There are four types of methods that comprise a test suite:<br>
+<br>
+#. **Test cases**<br>
+<br>
+ | Test cases are methods that start with a particular prefix.<br>
+ | Functional test cases start with ``test_``, e.g. ``test_hello_world_single_core``.<br>
+ | Performance test cases start with ``test_perf_``, e.g. ``test_perf_nic_single_core``.<br>
+ | A test suite may have any number of functional and/or performance test cases.<br>
+ However, these test cases must test the same feature,<br>
+ following the rule of one feature = one test suite.<br>
+ Test cases for one feature don't need to be grouped in just one test suite, though.<br>
+ If the feature requires many testing scenarios to cover,<br>
+ the test cases would be better off spread over multiple test suites<br>
+ so that each test suite doesn't take too long to execute.<br>
+<br>
+#. **Setup and Teardown methods**<br>
+<br>
+ | There are setup and teardown methods for the whole test suite and each individual test case.<br>
+ | Methods ``set_up_suite`` and ``tear_down_suite`` will be executed<br>
+ before any and after all test cases have been executed, respectively.<br>
+ | Methods ``set_up_test_case`` and ``tear_down_test_case`` will be executed<br>
+ before and after each test case, respectively.<br>
+ | These methods don't need to be implemented if there's no need for them in a test suite.<br>
+ In that case, nothing will happen when they're is executed.<br>
+<br>
+#. **Test case verification**<br>
+<br>
+ Test case verification should be done with the ``verify`` method, which records the result.<br>
+ The method should be called at the end of each test case.<br>
+<br>
+#. **Other methods**<br>
+<br>
+ Of course, all test suite code should adhere to coding standards.<br>
+ Only the above methods will be treated specially and any other methods may be defined<br>
+ (which should be mostly private methods needed by each particular test suite).<br>
+ Any specific features (such as NIC configuration) required by a test suite<br>
+ should be implemented in the ``SutNode`` class (and the underlying classes that ``SutNode`` uses)<br>
+ and used by the test suite via the ``sut_node`` field.<br>
+<br>
<br>
DTS Developer Tools<br>
-------------------<br>
-- <br>
2.30.2<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font color="#000000" face="Arial"><span style="font-size:13.3333px;white-space:pre-wrap">Patrick Robb</span></font></p><p style="color:rgb(34,34,34);line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Technical Service Manager</span></p><p dir="ltr" style="color:rgb(34,34,34);line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">UNH InterOperability Laboratory</span></p><p dir="ltr" style="color:rgb(34,34,34);line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">21 Madbury Rd, Suite 100, Durham, NH 03824</span></p><p dir="ltr" style="color:rgb(34,34,34);line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(17,85,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><a href="http://www.iol.unh.edu/" style="color:rgb(17,85,204)" target="_blank">www.iol.unh.edu</a></span></p><p dir="ltr" style="color:rgb(34,34,34);line-height:1.2;margin-top:0pt;margin-bottom:0pt"><br></p><p dir="ltr" style="color:rgb(34,34,34);line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(51,51,51);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh4.googleusercontent.com/7sTY8VswXadak_YT0J13osh5ockNVRX2BuYaRsKoTTpkpilBokA0WlocYHLB4q7XUgXNHka6-ns47S8R_am0sOt7MYQQ1ILQ3S-P5aezsrjp3-IsJMmMrErHWmTARNgZhpAx06n2" width="150" height="37" style="border: none;"></span></p></div></div>