aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking
diff options
context:
space:
mode:
authorwym_libra <yimin.wang@huawei.com>2015-09-23 11:56:15 +0800
committerwym_libra <yimin.wang@huawei.com>2015-10-08 10:02:13 +0800
commit6175d493f0b07b96b34b1290822efd1adfe61fd2 (patch)
tree451c045bc00a1e5a39514dbda85da20dc8553a92 /yardstick/benchmark/scenarios/networking
parent882af7878ab8119fede93a215c9e402023f817be (diff)
Add testing packet delay variation between VMs
1)create test case("iperfs-jitter") for measuring packet delay variation 2)and modify "iperf3.py" to support it JIRA:YARDSTICK-131 Change-Id: Ic3416a713b69dc7687f6f85ecc0b79da8dfb7ed9 Signed-off-by: wym_libra <yimin.wang@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking')
-rw-r--r--yardstick/benchmark/scenarios/networking/iperf3.py30
1 files changed, 22 insertions, 8 deletions
diff --git a/yardstick/benchmark/scenarios/networking/iperf3.py b/yardstick/benchmark/scenarios/networking/iperf3.py
index ff625de4d..e31a892d2 100644
--- a/yardstick/benchmark/scenarios/networking/iperf3.py
+++ b/yardstick/benchmark/scenarios/networking/iperf3.py
@@ -95,8 +95,12 @@ For more info see http://software.es.net/iperf
if not options:
options = ""
+ use_UDP = False
if "udp" in options:
cmd += " --udp"
+ use_UDP = True
+ if "bandwidth" in options:
+ cmd += " --bandwidth %s" % options["bandwidth"]
else:
# tcp obviously
if "nodelay" in options:
@@ -120,15 +124,25 @@ For more info see http://software.es.net/iperf
output = json.loads(stdout)
- # convert bits per second to bytes per second
- bytes_per_second = \
- int((output["end"]["sum_received"]["bits_per_second"])) / 8
-
if "sla" in args:
- sla_bytes_per_second = int(args["sla"]["bytes_per_second"])
- assert bytes_per_second >= sla_bytes_per_second, \
- "bytes_per_second %d < sla (%d)" % \
- (bytes_per_second, sla_bytes_per_second)
+ sla_iperf = args["sla"]
+ if not use_UDP:
+ sla_bytes_per_second = int(sla_iperf["bytes_per_second"])
+
+ # convert bits per second to bytes per second
+ bit_per_second = \
+ int(output["end"]["sum_received"]["bits_per_second"])
+ bytes_per_second = bit_per_second / 8
+ assert bytes_per_second >= sla_bytes_per_second, \
+ "bytes_per_second %d < sla:bytes_per_second (%d)" % \
+ (bytes_per_second, sla_bytes_per_second)
+ else:
+ sla_jitter = float(sla_iperf["jitter"])
+
+ jitter_ms = float(output["end"]["sum"]["jitter_ms"])
+ assert jitter_ms <= sla_jitter, \
+ "jitter_ms %f > sla:jitter %f" % \
+ (jitter_ms, sla_jitter)
return output