aboutsummaryrefslogtreecommitdiffstats
path: root/docs/testing/user/userguide/teststeps.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/testing/user/userguide/teststeps.rst')
-rw-r--r--docs/testing/user/userguide/teststeps.rst37
1 files changed, 28 insertions, 9 deletions
diff --git a/docs/testing/user/userguide/teststeps.rst b/docs/testing/user/userguide/teststeps.rst
index 08c95311..cb627bc5 100644
--- a/docs/testing/user/userguide/teststeps.rst
+++ b/docs/testing/user/userguide/teststeps.rst
@@ -23,6 +23,13 @@ the step number by one which is indicated in the log.
(testcases.integration) - Step 0 'vswitch add_vport ['br0']' start
+Test steps are defined as a list of steps within a ``TestSteps`` item of test
+case definition. Each step is a list with following structure:
+
+.. code-block:: python
+
+ '[' [ optional-alias ',' ] test-object ',' test-function [ ',' optional-function-params ] '],'
+
Step driven tests can be used for both performance and integration testing.
In case of integration test, each step in the test case is validated. If a step
does not pass validation the test will fail and terminate. The test will continue
@@ -57,8 +64,14 @@ Step driven testcases can be used in two different ways:
Test objects and their functions
--------------------------------
-Every test step can call a function of one of the supported test objects. The list
-of supported objects and their most common functions follows:
+Every test step can call a function of one of the supported test objects. In general
+any existing function of supported test object can be called by test step. In case
+that step validation is required (valid for integration test steps, which are not
+suppressed), then appropriate ``validate_`` method must be implemented.
+
+The list of supported objects and their most common functions is listed below. Please
+check implementation of test objects for full list of implemented functions and their
+parameters.
* ``vswitch`` - provides functions for vSwitch configuration
@@ -176,6 +189,8 @@ of supported objects and their most common functions follows:
* ``getValue param`` - returns value of given ``param``
* ``setValue param value`` - sets value of ``param`` to given ``value``
+ * ``resetValue param`` - if ``param`` was overridden by ``TEST_PARAMS`` (e.g. by "Parameters"
+ section of the test case definition), then it will be set to its original value.
Examples:
@@ -185,6 +200,8 @@ of supported objects and their most common functions follows:
['settings', 'setValue', 'GUEST_USERNAME', ['root']]
+ ['settings', 'resetValue', 'WHITELIST_NICS'],
+
It is possible and more convenient to access any VSPERF configuration option directly
via ``$NAME`` notation. Option evaluation is done during runtime and vsperf will
automatically translate it to the appropriate call of ``settings.getValue``.
@@ -747,6 +764,8 @@ destination UDP port.
]
},
+The same test can be written in a shorter form using "Deployment" : "pvpv".
+
To run the test:
.. code-block:: console
@@ -779,20 +798,20 @@ and available in both csv and rst report files.
},
},
"TestSteps": [
- ['vswitch', 'add_vport', 'br0'],
- ['vswitch', 'add_vport', 'br0'],
+ ['vswitch', 'add_vport', '$VSWITCH_BRIDGE_NAME'],
+ ['vswitch', 'add_vport', '$VSWITCH_BRIDGE_NAME'],
# priority must be higher than default 32768, otherwise flows won't match
- ['vswitch', 'add_flow', 'br0',
+ ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME',
{'in_port': '1', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x0800',
'nw_proto':'17', 'tp_dst':'0', 'priority': '33000'}],
- ['vswitch', 'add_flow', 'br0',
+ ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME',
{'in_port': '2', 'actions': ['output:#STEP[-2][1]'], 'idle_timeout': '0', 'dl_type':'0x0800',
'nw_proto':'17', 'tp_dst':'0', 'priority': '33000'}],
- ['vswitch', 'add_flow', 'br0', {'in_port': '#STEP[-4][1]', 'actions': ['output:1'],
+ ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '#STEP[-4][1]', 'actions': ['output:1'],
'idle_timeout': '0'}],
- ['vswitch', 'add_flow', 'br0', {'in_port': '#STEP[-4][1]', 'actions': ['output:2'],
+ ['vswitch', 'add_flow', '$VSWITCH_BRIDGE_NAME', {'in_port': '#STEP[-4][1]', 'actions': ['output:2'],
'idle_timeout': '0'}],
- ['vswitch', 'dump_flows', 'br0'],
+ ['vswitch', 'dump_flows', '$VSWITCH_BRIDGE_NAME'],
['vnf1', 'start'],
]
},