From 90f150a4a8591c83c44b587fee0208337cbca658 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 21 Dec 2021 16:12:37 +0100 Subject: [PATCH] improve iperf pass fail checker --- ci-scripts/cls_oaicitest.py | 16 +++++++++++++--- ci-scripts/main.py | 7 +++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index b8b99a053b..68b71da892 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -129,6 +129,7 @@ class OaiCiTest(): self.ping_rttavg_threshold ='' self.iperf_args = '' self.iperf_packetloss_threshold = '' + self.iperf_bitrate_threshold = '' self.iperf_profile = '' self.iperf_options = '' self.iperf_direction = '' @@ -2085,13 +2086,21 @@ class OaiCiTest(): pl = float(100 * pl_sum / ps_sum) packetloss = '%2.1f ' % (pl) packetloss += '%' + #checking packet loss compliance if float(pl) > float(self.iperf_packetloss_threshold): pal_too_high_msg = 'Packet Loss too high : actual = '+packetloss+', target = '+self.iperf_packetloss_threshold+'%\n' 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() - 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) + elif (br_loss < self.iperf_bitrate_threshold) and (float(pl) > float(self.iperf_packetloss_threshold)): + statusQueue.put(-1) else: statusQueue.put(0) statusQueue.put(device_id) @@ -2101,7 +2110,7 @@ class OaiCiTest(): brl_msg = 'Bitrate Perf: ' + bitperf jit_msg = 'Jitter : ' + jitter 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;35m ' + req_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 ' + pal_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() else: self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ddf9bb531e..415d3c4d3d 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -310,6 +310,13 @@ def GetParametersFromXML(action): CiTestObj.ue_id = ue_id CiTestObj.iperf_direction = test.findtext('direction')#used for modules only 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') if (CiTestObj.iperf_profile is None): CiTestObj.iperf_profile = 'balanced'