aboutsummaryrefslogtreecommitdiffstats
path: root/tools/teststepstools.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2017-12-19 08:58:43 +0000
committerMartin Klozik <martinx.klozik@intel.com>2018-01-11 11:28:02 +0000
commita2d97b05fb3b7ff62f62bcb16d36c51e3df6ca77 (patch)
tree8cb4e2cd7a463275416d8ac2422b6907166f2a94 /tools/teststepstools.py
parent58d53561bad01ae7829fdeee0c67f5dae4a9dc34 (diff)
capture: Traffic capture examples
Traffic can be captured also at DUT side. Two options are supported by vsperf: 1) Traffic is captured inside VM after it has been processed by vSwitch. This can be used for verification of vSwitch frame modification functionality, including HW offloading at ingress side. 2) Another NIC under the test (NIC2) is added into standard VSPERF DUT setup. Traffic is then forwarded from TGen through NIC and vSwitch to NIC2 and then over patch cable back to NIC2, the vSwitch, NIC and to the traffic generator. This setup supports also verification of HW offloading at egress side of NIC2 and thus it can be used for validation of smart NICS. Both options above are traffic generator agnostic if compared to direct support of traffic capture by traffic generator. This patch introduces example testcases for both options. Detailed documentation will be pushed as a standalone patch. JIRA: VSPERF-556 Change-Id: I23e12e45768ae4dbe9442f74d8391c3d5b2c7895 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Richard Elias <richardx.elias@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com> Reviewed-by: Trevor Cooper <trevor.cooper@intel.com>
Diffstat (limited to 'tools/teststepstools.py')
-rw-r--r--tools/teststepstools.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/teststepstools.py b/tools/teststepstools.py
index 639e3437..33db8f79 100644
--- a/tools/teststepstools.py
+++ b/tools/teststepstools.py
@@ -19,6 +19,7 @@ import logging
import subprocess
import locale
from tools.functions import filter_output
+from tools.tasks import run_background_task
_LOGGER = logging.getLogger(__name__)
@@ -102,3 +103,19 @@ class TestStepsTools(object):
""" validate result of shell `command' execution
"""
return result is not None
+
+ @staticmethod
+ def Exec_Shell_Background(command):
+ """ Execute a shell `command' at the background and return its PID id
+ """
+ try:
+ pid = run_background_task(command.split(), _LOGGER, "Background task: {}".format(command))
+ return pid
+ except OSError:
+ return None
+
+ @staticmethod
+ def validate_Exec_Shell_Background(result, dummy_command, dummy_regex=None):
+ """ validate result of shell `command' execution on the background
+ """
+ return result is not None