CI: adding profiling option to iperf:
-- balanced (current version): all UE shares the same BW
-- single-ue : one UE will use the whole requested BW
-- unbalanced : all but one UE will use a residual 2% of the requested BW
the rest of requested BW will be used by one UE
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
+26
-5
@@ -81,6 +81,7 @@ class SSHConnection():
|
||||
self.ping_packetloss_threshold = ''
|
||||
self.iperf_args = ''
|
||||
self.iperf_packetloss_threshold = ''
|
||||
self.iperf_profile = ''
|
||||
self.UEDevices = []
|
||||
self.UEIPAddresses = []
|
||||
self.htmlFile = ''
|
||||
@@ -547,13 +548,23 @@ class SSHConnection():
|
||||
sys.exit(1)
|
||||
return result.group('iperf_time')
|
||||
|
||||
def Iperf_ComputeModifiedBW(self, ue_num):
|
||||
def Iperf_ComputeModifiedBW(self, idx, ue_num):
|
||||
result = re.search('-b (?P<iperf_bandwidth>[0-9\.]+)[KMG]', str(self.iperf_args))
|
||||
if result is None:
|
||||
logging.debug('\u001B[1;37;41m Iperf bandwidth Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
iperf_bandwidth = result.group('iperf_bandwidth')
|
||||
iperf_bandwidth_new = float(iperf_bandwidth)/ue_num
|
||||
if SSH.iperf_profile == 'balanced':
|
||||
iperf_bandwidth_new = float(iperf_bandwidth)/ue_num
|
||||
if SSH.iperf_profile == 'single-ue':
|
||||
iperf_bandwidth_new = float(iperf_bandwidth)
|
||||
if SSH.iperf_profile == 'unbalanced':
|
||||
# residual is 2% of max bw
|
||||
residualBW = float(iperf_bandwidth) / 50
|
||||
if idx == 0:
|
||||
iperf_bandwidth_new = float(iperf_bandwidth) - ((ue_num - 1) * residualBW)
|
||||
else:
|
||||
iperf_bandwidth_new = residualBW
|
||||
iperf_bandwidth_str = '-b ' + iperf_bandwidth
|
||||
iperf_bandwidth_str_new = '-b ' + str(iperf_bandwidth_new)
|
||||
result = re.sub(iperf_bandwidth_str, iperf_bandwidth_str_new, str(self.iperf_args))
|
||||
@@ -571,7 +582,7 @@ class SSHConnection():
|
||||
else:
|
||||
logging.debug('\u001B[1;37;41m Server Report and Connection refused Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
result = re.search('Server Report:\\\\r\\\\n(?:|\[ *\d+\].*) (?P<bitrate>[0-9\.]+ [KMG]bits\/sec) +(?P<jitter>[0-9\.]+ ms) +(\d+\/.\d+) (\((?P<packetloss>[0-9\.]+)%\))', str(self.ssh.before))
|
||||
result = re.search('Server Report:\\\\r\\\\n(?:|\[ *\d+\].*) (?P<bitrate>[0-9\.]+ [KMG]bits\/sec) +(?P<jitter>[0-9\.]+ ms) +(\d+\/..\d+) (\((?P<packetloss>[0-9\.]+)%\))', str(self.ssh.before))
|
||||
if result is not None:
|
||||
bitrate = result.group('bitrate')
|
||||
packetloss = result.group('packetloss')
|
||||
@@ -633,7 +644,7 @@ class SSHConnection():
|
||||
iperf_time = self.Iperf_ComputeTime()
|
||||
time.sleep(0.5)
|
||||
|
||||
modified_options = self.Iperf_ComputeModifiedBW(ue_num)
|
||||
modified_options = self.Iperf_ComputeModifiedBW(idx, ue_num)
|
||||
time.sleep(0.5)
|
||||
|
||||
self.command('rm -f iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5)
|
||||
@@ -647,6 +658,9 @@ class SSHConnection():
|
||||
|
||||
def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num):
|
||||
try:
|
||||
# Single-UE profile -- iperf only on one UE
|
||||
if SSH.iperf_profile == 'single-ue' and idx != 0:
|
||||
return
|
||||
useIperf3 = False
|
||||
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
|
||||
# if by chance ADB server and EPC are on the same remote host, at least log collection will take of it
|
||||
@@ -683,7 +697,7 @@ class SSHConnection():
|
||||
iperf_time = self.Iperf_ComputeTime()
|
||||
time.sleep(0.5)
|
||||
|
||||
modified_options = self.Iperf_ComputeModifiedBW(ue_num)
|
||||
modified_options = self.Iperf_ComputeModifiedBW(idx, ue_num)
|
||||
time.sleep(0.5)
|
||||
|
||||
self.command('rm -f iperf_' + SSH.testCase_id + '_' + device_id + '.log', '\$', 5)
|
||||
@@ -1145,6 +1159,13 @@ def GetParametersFromXML(action):
|
||||
if action == 'Iperf':
|
||||
SSH.iperf_args = test.findtext('iperf_args')
|
||||
SSH.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold')
|
||||
SSH.iperf_profile = test.findtext('iperf_profile')
|
||||
if (SSH.iperf_profile is None):
|
||||
SSH.iperf_profile = 'balanced'
|
||||
else:
|
||||
if SSH.iperf_profile != 'balanced' and SSH.iperf_profile != 'unbalanced' and SSH.iperf_profile != 'single-ue':
|
||||
logging.debug('ERROR: test-case has wrong profile ' + SSH.iperf_profile)
|
||||
SSH.iperf_profile = 'balanced'
|
||||
|
||||
#check if given test is in list
|
||||
#it is in list if one of the strings in 'list' is at the beginning of 'test'
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<TestCaseRequestedList>010101 050101 060101 070101 040101 030101 040301 040501 040601 040602 040603 040641 040401 040201 030201 030111 040301 040511 040611 040612 040613 040651 040401 040201 030201 030121 040301 040521 040621 040622 040623 040661 040401 040201 030201 </TestCaseRequestedList>
|
||||
<TestCaseRequestedList>010101 050101 060101 070101 040101 030101 040301 040501 040601 040602 040603 040604 040605 040641 040401 040201 030201 030111 040301 040511 040611 040612 040613 040614 040615 040651 040401 040201 030201 030121 040301 040521 040621 040622 040623 040661 040401 040201 030201 </TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="010101">
|
||||
@@ -115,6 +115,22 @@
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040604">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040605">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(60 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>unbalanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040641">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - UL/9Mbps/UDP)(60 sec)</desc>
|
||||
@@ -143,6 +159,22 @@
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040614">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/30Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 30M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040615">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/30Mbps/UDP)(60 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 30M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>unbalanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040651">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - UL/20Mbps/UDP)(60 sec)</desc>
|
||||
@@ -171,6 +203,22 @@
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040624">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/70Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040624">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/70Mbps/UDP)(60 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>unbalanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040661">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - UL/20Mbps/UDP)(60 sec)</desc>
|
||||
|
||||
Reference in New Issue
Block a user