From ada154f852c368d15298bb7d85bb39d8139967a6 Mon Sep 17 00:00:00 2001
From: hardy <remi.hardy@openairinterface.org>
Date: Tue, 4 Jan 2022 15:15:28 +0100
Subject: [PATCH] add ping png to artifacts

---
 ci-scripts/cls_oaicitest.py | 8 +++++++-
 ci-scripts/ran.py           | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py
index 799e5283c4..310b71f8c0 100644
--- a/ci-scripts/cls_oaicitest.py
+++ b/ci-scripts/cls_oaicitest.py
@@ -103,17 +103,23 @@ def GetPingTimeAnalysis(ping_log_file,ping_rttavg_threshold):
 		axis.set_xlabel('Ping Events')
 		axis.set_ylabel("Ping RTT (in ms)")
 		axis.set_title(ping_log_file)
+		axis.set_xticks(ticks)
+		axis.set_xticklabels([])
 		YMAX=20 #base scale
 		if max(t_ping) > YMAX:
 			y_max=max(t_ping)+1
 		else:
 			y_max=YMAX+1
 		plt.ylim(0,y_max)
-		th_label="Ping Fail Threshold="+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(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, ping_log_file+'.png', self.eNBSourceCodePath + '/cmake_targets/')
+
 		return ping_stat
 
 	else:
diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py
index 95066d168d..32913f1ad0 100644
--- a/ci-scripts/ran.py
+++ b/ci-scripts/ran.py
@@ -738,8 +738,8 @@ class RANManagement():
 		mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*.pcap .','\$',20)
 		mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/gnb_*.pcap .','\$',20)
 		mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5)
-		mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png log/*/*.log log/*/*.pcap', '\$', 60)
-		mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png log/*/*.log log/*/*.pcap', '\$', 15)
+		mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60)
+		mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15)
 		mySSH.close()
 
 	def AnalyzeLogFile_eNB(self, eNBlogFile, HTML):
-- 
2.26.2