summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaryam Tahhan <maryam.tahhan@intel.com>2016-02-21 14:29:32 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-02-23 11:35:53 +0000
commit9d4b0644730076007490afe0ca7ddddc3bc6b3ef (patch)
tree5be808852857ba23051d95bc1722a88260a73944
parent3456f7b0aebd7509c0de4a2e850572cbf0e8d600 (diff)
trafficgen: pause trafficgenerator
Add a mode to pause the traffic generator before transmission to bypass manual setup if required. Change-Id: Iad62a5e7cb83a311e2814d8a9ee2bc9b2d2ed4de Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Al Morton <acmorton@att.com>
-rwxr-xr-xdocs/userguide/testusage.rst1
-rw-r--r--testcases/testcase.py10
-rwxr-xr-xvsperf3
3 files changed, 13 insertions, 1 deletions
diff --git a/docs/userguide/testusage.rst b/docs/userguide/testusage.rst
index 06583d83..824ae6fc 100755
--- a/docs/userguide/testusage.rst
+++ b/docs/userguide/testusage.rst
@@ -393,6 +393,7 @@ Mode of operation is driven by configuration parameter -m or --mode
"normal" - execute vSwitch, VNF and traffic generator
"trafficgen" - execute only traffic generator
"trafficgen-off" - execute vSwitch and VNF
+ "trafficgen-pause" - execute vSwitch and VNF but wait before traffic transmission
In case, that VSPERF is executed in "trafficgen" mode, then configuration
of traffic generator should be configured through --test-param option.
diff --git a/testcases/testcase.py b/testcases/testcase.py
index 6fa1092e..c79e4d0f 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -199,6 +199,16 @@ class TestCase(object):
self._logger.debug("All is set. Please run traffic generator manually.")
input(os.linesep + "Press Enter to terminate vswitchperf..." + os.linesep + os.linesep)
else:
+ if S.getValue('mode') == 'trafficgen-pause':
+ time.sleep(2)
+ true_vals = ('yes', 'y', 'ye', None)
+ while True:
+ choice = input(os.linesep + 'Transmission paused, should'
+ ' transmission be resumed? ' + os.linesep).lower()
+ if not choice or choice not in true_vals:
+ print('Please respond with \'yes\' or \'y\' ', end='')
+ else:
+ break
with traffic_ctl:
traffic_ctl.send_traffic(self._traffic)
diff --git a/vsperf b/vsperf
index 63913c77..d141227c 100755
--- a/vsperf
+++ b/vsperf
@@ -145,7 +145,8 @@ def parse_arguments():
group.add_argument('-m', '--mode', help='vsperf mode of operation;\
Values: "normal" - execute vSwitch, VNF and traffic generator;\
"trafficgen" - execute only traffic generator; "trafficgen-off" \
- - execute vSwitch and VNF', default='normal')
+ - execute vSwitch and VNF; trafficgen-pause - execute vSwitch \
+ and VNF but pause before traffic transmission ', default='normal')
group.add_argument('-f', '--test-spec', help='test specification file')
group.add_argument('-d', '--test-dir', help='directory containing tests')