improve iperf pass fail checker
This commit is contained in:
@@ -129,6 +129,7 @@ class OaiCiTest():
|
|||||||
self.ping_rttavg_threshold =''
|
self.ping_rttavg_threshold =''
|
||||||
self.iperf_args = ''
|
self.iperf_args = ''
|
||||||
self.iperf_packetloss_threshold = ''
|
self.iperf_packetloss_threshold = ''
|
||||||
|
self.iperf_bitrate_threshold = ''
|
||||||
self.iperf_profile = ''
|
self.iperf_profile = ''
|
||||||
self.iperf_options = ''
|
self.iperf_options = ''
|
||||||
self.iperf_direction = ''
|
self.iperf_direction = ''
|
||||||
@@ -2085,13 +2086,21 @@ class OaiCiTest():
|
|||||||
pl = float(100 * pl_sum / ps_sum)
|
pl = float(100 * pl_sum / ps_sum)
|
||||||
packetloss = '%2.1f ' % (pl)
|
packetloss = '%2.1f ' % (pl)
|
||||||
packetloss += '%'
|
packetloss += '%'
|
||||||
|
#checking packet loss compliance
|
||||||
if float(pl) > float(self.iperf_packetloss_threshold):
|
if float(pl) > float(self.iperf_packetloss_threshold):
|
||||||
pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%\n'
|
pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%\n'
|
||||||
else:
|
else:
|
||||||
pal_too_high_msg=''
|
pal_too_high_msg=''
|
||||||
|
#checking bitrate perf compliance
|
||||||
|
if float(br_loss) < float(self.iperf_bitrate_threshold):
|
||||||
|
bit_too_low_msg = 'Bitrate too low : actual = '+bitperf+', target = '+self.iperf_bitrate_threshold+'%\n'
|
||||||
|
else:
|
||||||
|
bit_too_low_msg=''
|
||||||
lock.acquire()
|
lock.acquire()
|
||||||
if (br_loss < 90) or (float(pl) > float(self.iperf_packetloss_threshold)):
|
if (br_loss < self.iperf_bitrate_threshold) or (float(pl) > float(self.iperf_packetloss_threshold)):
|
||||||
statusQueue.put(1)
|
statusQueue.put(1)
|
||||||
|
elif (br_loss < self.iperf_bitrate_threshold) and (float(pl) > float(self.iperf_packetloss_threshold)):
|
||||||
|
statusQueue.put(-1)
|
||||||
else:
|
else:
|
||||||
statusQueue.put(0)
|
statusQueue.put(0)
|
||||||
statusQueue.put(device_id)
|
statusQueue.put(device_id)
|
||||||
@@ -2101,7 +2110,7 @@ class OaiCiTest():
|
|||||||
brl_msg = 'Bitrate Perf: ' + bitperf
|
brl_msg = 'Bitrate Perf: ' + bitperf
|
||||||
jit_msg = 'Jitter : ' + jitter
|
jit_msg = 'Jitter : ' + jitter
|
||||||
pal_msg = 'Packet Loss : ' + packetloss
|
pal_msg = 'Packet Loss : ' + packetloss
|
||||||
statusQueue.put(req_msg + '\n' + bir_msg + '\n' + brl_msg + '\n' + jit_msg + '\n' + pal_msg + '\n' + pal_too_high_msg + '\n')
|
statusQueue.put(req_msg + '\n' + bir_msg + '\n' + brl_msg + '\n' + jit_msg + '\n' + pal_msg + '\n' + pal_too_high_msg + '\n' + bit_too_low_msg + '\n')
|
||||||
logging.debug('\u001B[1;37;45m iperf result (' + UE_IPAddress + ') \u001B[0m')
|
logging.debug('\u001B[1;37;45m iperf result (' + UE_IPAddress + ') \u001B[0m')
|
||||||
logging.debug('\u001B[1;35m ' + req_msg + '\u001B[0m')
|
logging.debug('\u001B[1;35m ' + req_msg + '\u001B[0m')
|
||||||
logging.debug('\u001B[1;35m ' + bir_msg + '\u001B[0m')
|
logging.debug('\u001B[1;35m ' + bir_msg + '\u001B[0m')
|
||||||
@@ -2109,6 +2118,7 @@ class OaiCiTest():
|
|||||||
logging.debug('\u001B[1;35m ' + jit_msg + '\u001B[0m')
|
logging.debug('\u001B[1;35m ' + jit_msg + '\u001B[0m')
|
||||||
logging.debug('\u001B[1;35m ' + pal_msg + '\u001B[0m')
|
logging.debug('\u001B[1;35m ' + pal_msg + '\u001B[0m')
|
||||||
logging.debug('\u001B[1;35m ' + pal_too_high_msg + '\u001B[0m')
|
logging.debug('\u001B[1;35m ' + pal_too_high_msg + '\u001B[0m')
|
||||||
|
logging.debug('\u001B[1;35m ' + bit_too_low_msg + '\u001B[0m')
|
||||||
lock.release()
|
lock.release()
|
||||||
else:
|
else:
|
||||||
self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log')
|
self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log')
|
||||||
|
|||||||
@@ -310,6 +310,13 @@ def GetParametersFromXML(action):
|
|||||||
CiTestObj.ue_id = ue_id
|
CiTestObj.ue_id = ue_id
|
||||||
CiTestObj.iperf_direction = test.findtext('direction')#used for modules only
|
CiTestObj.iperf_direction = test.findtext('direction')#used for modules only
|
||||||
CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold')
|
CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold')
|
||||||
|
iperf_bitrate_threshold = test.findtext('iperf_bitrate_threshold')
|
||||||
|
if (iperf_bitrate_threshold is None):
|
||||||
|
CiTestObj.iperf_bitrate_threshold = "90" #if no threshold is specified, default will be 90%
|
||||||
|
else:
|
||||||
|
CiTestObj.iperf_bitrate_threshold = iperf_bitrate_threshold
|
||||||
|
|
||||||
|
|
||||||
CiTestObj.iperf_profile = test.findtext('iperf_profile')
|
CiTestObj.iperf_profile = test.findtext('iperf_profile')
|
||||||
if (CiTestObj.iperf_profile is None):
|
if (CiTestObj.iperf_profile is None):
|
||||||
CiTestObj.iperf_profile = 'balanced'
|
CiTestObj.iperf_profile = 'balanced'
|
||||||
|
|||||||
Reference in New Issue
Block a user