From 6175d493f0b07b96b34b1290822efd1adfe61fd2 Mon Sep 17 00:00:00 2001 From: wym_libra Date: Wed, 23 Sep 2015 11:56:15 +0800 Subject: 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 --- yardstick/benchmark/scenarios/networking/iperf3.py | 30 ++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'yardstick/benchmark/scenarios/networking') 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 -- cgit 1.2.3-korg