From 9d4b0644730076007490afe0ca7ddddc3bc6b3ef Mon Sep 17 00:00:00 2001 From: Maryam Tahhan Date: Sun, 21 Feb 2016 14:29:32 +0000 Subject: 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 Reviewed-by: Christian Trautman Reviewed-by: Martin Klozik Reviewed-by: Al Morton --- docs/userguide/testusage.rst | 1 + testcases/testcase.py | 10 ++++++++++ vsperf | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) 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') -- cgit 1.2.3-korg