From 5afec8db5756130a0bc88ce95c00759e1acbfd3a Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 5 Jan 2022 16:05:51 +0100 Subject: [PATCH] fix ping analysis if no threshold defined + escape if scp fails --- ci-scripts/cls_oaicitest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 42ed46cca5..3ba014b7c9 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -112,14 +112,18 @@ def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold): else: y_max=YMAX+1 plt.ylim(0,y_max) - th_label="AVG Ping Fail Threshold="+ping_rttavg_threshold - plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label) - axis.legend() + if ping_rttavg_threshold != '': + th_label="AVG Ping Fail Threshold="+ping_rttavg_threshold + plt.axhline(y=float(ping_rttavg_threshold), color='r', linestyle='-',label=th_label) + axis.legend() plt.savefig(ping_log_file+'.png') #copy the png file already to enb to move it move it later into the artifacts - mySSH = sshconnection.SSHConnection() - mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/') + try: + mySSH = sshconnection.SSHConnection() + mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/') + except: + logging.debug('\u001B[1;37;41m Ping PNG SCP to eNB FAILED\u001B[0m') return ping_stat