Commit 4f60810d authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Compute and return requested bitrate from Iperf_ComputeModifiedBW

For iperf3 (version 3.9) UDP, sender bitrate is not always equal to requested bitrate (defined by '-b' option). We need to retrieve information about the requsted bitrate from iperf command line options specified for each UDP testcase. This parameter is then used in UDP analysis functions for proper evaluation of the test results.
parent 1cae1879
...@@ -66,26 +66,28 @@ import numpy as np ...@@ -66,26 +66,28 @@ import numpy as np
def Iperf_ComputeModifiedBW(idx, ue_num, profile, args): def Iperf_ComputeModifiedBW(idx, ue_num, profile, args):
result = re.search('-b\s*(?P<iperf_bandwidth>[0-9\.]+)(?P<unit>[KMG])', str(args)) result = re.search('-b\s*(?P<iperf_bandwidth>[0-9\.]+)(?P<unit>[KMG])', str(args))
if result is None: if result is None:
raise Exception('Iperf bandwidth not found or in incorrect format!') raise ValueError(f'requested iperf bandwidth not found in iperf options "{args}"')
iperf_bandwidth = result.group('iperf_bandwidth') iperf_bandwidth = float(result.group('iperf_bandwidth'))
if iperf_bandwidth == 0:
raise ValueError('iperf bandwidth set to 0 - invalid value')
if profile == 'balanced': if profile == 'balanced':
iperf_bandwidth_new = float(iperf_bandwidth)/ue_num iperf_bandwidth_new = iperf_bandwidth/ue_num
if profile == 'single-ue': if profile =='single-ue':
iperf_bandwidth_new = float(iperf_bandwidth) iperf_bandwidth_new = iperf_bandwidth
if profile == 'unbalanced': if profile == 'unbalanced':
# residual is 2% of max bw # residual is 2% of max bw
residualBW = float(iperf_bandwidth) / 50 residualBW = iperf_bandwidth / 50
if idx == 0: if idx == 0:
iperf_bandwidth_new = float(iperf_bandwidth) - ((ue_num - 1) * residualBW) iperf_bandwidth_new = iperf_bandwidth - ((ue_num - 1) * residualBW)
else: else:
iperf_bandwidth_new = residualBW iperf_bandwidth_new = residualBW
iperf_bandwidth_str = result.group(0) iperf_bandwidth_str = result.group(0)
iperf_bandwidth_unit = result.group(2) iperf_bandwidth_unit = result.group(2)
iperf_bandwidth_str_new = f"-b {'%.2f' % iperf_bandwidth_new}{iperf_bandwidth_unit}" iperf_bandwidth_str_new = f"-b {'%.2f' % iperf_bandwidth_new}{iperf_bandwidth_unit}"
result = re.sub(iperf_bandwidth_str, iperf_bandwidth_str_new, str(args)) args_new = re.sub(iperf_bandwidth_str, iperf_bandwidth_str_new, str(args))
if result is None: if iperf_bandwidth_unit == 'K':
raise Exception('Calculate Iperf bandwidth failed!') iperf_bandwidth_new = iperf_bandwidth_new / 1000
return result return iperf_bandwidth_new, args_new
def Iperf_ComputeTime(args): def Iperf_ComputeTime(args):
result = re.search('-t\s*(?P<iperf_time>\d+)', str(args)) result = re.search('-t\s*(?P<iperf_time>\d+)', str(args))
...@@ -801,7 +803,7 @@ class OaiCiTest(): ...@@ -801,7 +803,7 @@ class OaiCiTest():
logPath = f'../cmake_targets/log/{ymlPath[1]}' logPath = f'../cmake_targets/log/{ymlPath[1]}'
if udpIperf: if udpIperf:
iperf_opt = Iperf_ComputeModifiedBW(idx, ue_num, self.iperf_profile, self.iperf_args) target_bitrate, iperf_opt = Iperf_ComputeModifiedBW(idx, ue_num, self.iperf_profile, self.iperf_args)
# note: for UDP testing we don't want to use json report - reports 0 Mbps received bitrate # note: for UDP testing we don't want to use json report - reports 0 Mbps received bitrate
jsonReport = "" jsonReport = ""
# note: enable server report collection on the UE side, no need to store and collect server report separately on the server side # note: enable server report collection on the UE side, no need to store and collect server report separately on the server side
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment