aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking/pktgen.py
diff options
context:
space:
mode:
authorKristian Hunt <kristian.hunt@gmail.com>2015-06-26 10:53:33 +0200
committerKristian Hunt <kristian.hunt@gmail.com>2015-06-29 13:08:07 +0200
commita56e63d45362104919c9de89fb8b6da0c89e4a3b (patch)
treee1ed9b0920254443dc1eff8072cc6f4f6ca6556f /yardstick/benchmark/scenarios/networking/pktgen.py
parentd7fd300e9a9bd480ad9f1500494021c42ec6ecee (diff)
Add Pktgen test step duration
JIRA: YARDSTICK-48 Step duration for Pktgen can be configured for each step. Change-Id: Ida6e2f7d8a1c7d86fb2e65389b5b56d5958d3ad9 Signed-off-by: Kristian Hunt <kristian.hunt@gmail.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/pktgen.py')
-rw-r--r--yardstick/benchmark/scenarios/networking/pktgen.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/yardstick/benchmark/scenarios/networking/pktgen.py b/yardstick/benchmark/scenarios/networking/pktgen.py
index 430c95905..e6d6893c9 100644
--- a/yardstick/benchmark/scenarios/networking/pktgen.py
+++ b/yardstick/benchmark/scenarios/networking/pktgen.py
@@ -21,7 +21,18 @@ class Pktgen(base.Scenario):
"""Execute pktgen between two hosts
Parameters
- TBD
+ packetsize - packet size in bytes without the CRC
+ type: int
+ unit: bytes
+ default: 60
+ number_of_ports - number of UDP ports to test
+ type: int
+ unit: na
+ default: 10
+ duration - duration of the test
+ type: int
+ unit: seconds
+ default: 20
"""
__scenario_type__ = "Pktgen"
@@ -87,11 +98,22 @@ class Pktgen(base.Scenario):
options = args['options']
packetsize = options.get("packetsize", 60)
self.number_of_ports = options.get("number_of_ports", 10)
+ # if run by a duration runner
+ duration_time = self.context.get("duration", None)
+ # if run by an arithmetic runner
+ arithmetic_time = options.get("duration", None)
+
+ if duration_time:
+ duration = duration_time
+ elif arithmetic_time:
+ duration = arithmetic_time
+ else:
+ duration = 20
self._iptables_setup()
- cmd = "sudo bash pktgen.sh %s %s %s" \
- % (ipaddr, self.number_of_ports, packetsize)
+ cmd = "sudo bash pktgen.sh %s %s %s %s" \
+ % (ipaddr, self.number_of_ports, packetsize, duration)
LOG.debug("Executing command: %s", cmd)
status, stdout, stderr = self.client.execute(cmd)