From 6c64382d606d12e0eb553319231710a5de1b45b9 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 11 Oct 2021 22:35:58 +0200 Subject: [PATCH 01/14] collect stats log for multiple nodes --- ci-scripts/ran.py | 21 +++++++++++++++----- ci-scripts/stats_monitor.py | 18 ++++++++++------- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 ++ 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 6d8d00610c..28b2b714e0 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -482,13 +482,14 @@ class RANManagement(): mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh > ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '.log 2>&1 &', lUserName, 10) - #tentative + #stats monitoring during runtime time.sleep(20) + monitor_file='stats_monitor.py' if self.eNB_Stats=='yes': - monitor_file='stats_monitor.py' - #mySSH.command('echo ' + lPassWord + ' | sudo -S cp ' + self.eNBSourceCodePath + '/ci-scripts/'+ monitor_file + ' ' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build/.','\$', 5) - #mySSH.command('echo $USER; nohup python3 ' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build/' + monitor_file + ' 2>&1 &', '\$', 5) - mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' 2>&1 > stats_monitor_execution.log &', '\$', 5) + if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'enb\' 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) + else: + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'gnb\' 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) @@ -686,6 +687,11 @@ class RANManagement(): fileToAnalyze = self.eNBLogFiles[int(self.eNB_instance)] self.eNBLogFiles[int(self.eNB_instance)] = '' if analyzeFile: + #*stats.log files + pickle + png + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*stats.log', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.pickle', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.png', '.') + # copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.') if (copyin_res == -1): logging.debug('\u001B[1;37;41m Could not copy ' + nodeB_prefix + 'NB logfile to analyze it! \u001B[0m') @@ -694,6 +700,11 @@ class RANManagement(): self.eNBmbmsEnables[int(self.eNB_instance)] = False return if self.eNB_serverId[self.eNB_instance] != '0': + #*stats.log files + pickle + png + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*stats.log', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.pickle', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.png', self.eNBSourceCodePath + '/cmake_targets/') + # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze, HTML) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 7ce00dab46..57a7ad0437 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -8,8 +8,11 @@ import pickle import numpy as np import os -def collect(d): - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' +def collect(d, node_type): + if node_type=='enb': + cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' + else: #'gnb' + cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) output = process.stdout.readlines() for l in output: @@ -22,7 +25,7 @@ def collect(d): d['mcs'].append(int(result.group(4))) -def graph(d): +def graph(d, node_type): figure, axis = plt.subplots(4, 1,figsize=(10, 10)) @@ -61,11 +64,12 @@ def graph(d): plt.tight_layout() # Combine all the operations and display - plt.savefig('/tmp/stats_monitor.png') + plt.savefig('/tmp/'+node_type+'_stats_monitor.png') plt.show() if __name__ == "__main__": + node_type = sys.argv[1]#enb or gnb d={} d['PHR']=[] @@ -78,13 +82,13 @@ if __name__ == "__main__": process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() while len(output)!=0 : - collect(d) + collect(d, node_type) process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() time.sleep(1) print('process stopped') - with open('/tmp/stats_monitor.pickle', 'wb') as handle: + with open('/tmp/'+node_type+'_stats_monitor.pickle', 'wb') as handle: pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL) - graph(d) + graph(d, node_type) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 9e1c7afde3..d04719fda8 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -65,6 +65,7 @@ 0 lte yes + yes 192.168.18.241 @@ -76,6 +77,7 @@ 1 1 nr + yes 192.168.18.240 From f9d5a87570727f4798b462fb3b1f9d5efc0e9265 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 11 Oct 2021 23:12:30 +0200 Subject: [PATCH 02/14] more fixes for test framework --- ci-scripts/ran.py | 4 ++-- ci-scripts/stats_monitor.py | 4 ++-- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 28b2b714e0..907a6cd667 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -487,9 +487,9 @@ class RANManagement(): monitor_file='stats_monitor.py' if self.eNB_Stats=='yes': if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): - mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'enb\' 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' enb 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) else: - mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'gnb\' 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' gnb 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 57a7ad0437..875f40f5e3 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -64,7 +64,7 @@ def graph(d, node_type): plt.tight_layout() # Combine all the operations and display - plt.savefig('/tmp/'+node_type+'_stats_monitor.png') + plt.savefig(node_type+'_stats_monitor.png') plt.show() if __name__ == "__main__": @@ -87,7 +87,7 @@ if __name__ == "__main__": output = process.stdout.readlines() time.sleep(1) print('process stopped') - with open('/tmp/'+node_type+'_stats_monitor.pickle', 'wb') as handle: + with open(node_type+'_stats_monitor.pickle', 'wb') as handle: pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL) graph(d, node_type) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index d04719fda8..ae5f11c975 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -122,8 +122,8 @@ Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 + iperf (UL/1Mbps/UDP)(60 sec)(single-ue profile) + -u -b 1M -t 60 UL nrmodule2_quectel 5 From 8570aaa59bc3f3e345c22ef01e73ba2e17e0b916 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 12 Oct 2021 00:15:39 +0200 Subject: [PATCH 03/14] debug --- ci-scripts/ran.py | 4 +--- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 907a6cd667..5315466d25 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -730,11 +730,9 @@ class RANManagement(): mySSH.command('cd cmake_targets', '\$', 5) 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 mv /tmp/*monitor.pickle .','\$',20) - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/*monitor.png .','\$',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', '\$', 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', '\$', 5) +# mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *.pickle *.png', '\$', 5) mySSH.close() def AnalyzeLogFile_eNB(self, eNBlogFile, HTML): diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index ae5f11c975..1bc7e918f5 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -113,7 +113,7 @@ Iperf iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile) - -u -b 20M -t 60 + -u -b 20M -t 10 DL nrmodule2_quectel 5 @@ -123,7 +123,7 @@ Iperf iperf (UL/1Mbps/UDP)(60 sec)(single-ue profile) - -u -b 1M -t 60 + -u -b 1M -t 10 UL nrmodule2_quectel 5 From 42deebac480ebda0fbec4f18f3adff3b29287352 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 11 Oct 2021 13:58:34 +0200 Subject: [PATCH 04/14] fix copyout fail --- ci-scripts/ran.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index d447883316..acf31b8242 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -340,10 +340,9 @@ class RANManagement(): sys.exit('Insufficient Parameter') logging.debug('Starting eNB/gNB on server: ' + lIpAddr) - SSH.copyout(lIpAddr,lUserName,lPassWord, cwd + "/active_net_interfaces.awk", "/tmp") - self.testCase_id = HTML.testCase_id mySSH = SSH.SSHConnection() + mySSH.copyout(lIpAddr,lUserName,lPassWord, cwd + "/active_net_interfaces.awk", "/tmp") #reboot USRP if requested in xml if self.USRPIPAddress!='': From 8a3f69049da1596efce9d2f7d86ad22e63286f44 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 11 Oct 2021 14:06:09 +0200 Subject: [PATCH 05/14] more tests to be triggered by NSA tag --- ci-scripts/Jenkinsfile-trig-nsa | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 2dcaf1a04f..f4db9fd19b 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -47,30 +47,30 @@ pipeline { COMMIT_ID=sh returnStdout: true, script: """curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/${MR}" | jq ".sha" || true """ COMMIT_ID=COMMIT_ID.trim() echo "Testing NSA on : ${MR} ${SRC_BRANCH} ${COMMIT_ID}" - //calling NSA sub job - build job: "RAN-NSA-Mini-Module", wait : true, propagate : false, parameters: [ + //calling NSA B200 + build job: "RAN-NSA-B200-Module-LTEBOX", wait : true, propagate : false, parameters: [ string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) ] - //calling NSA long sub job -// build job: "RAN-NSA-Mini-Module-Long", wait : true, propagate : false, parameters: [ -// string(name: 'eNB_MR', value: String.valueOf(MR)), -// string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), -// string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), -// string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), -// booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) -// ] - //calling NSA attach/detach job -// build job: "RAN-NSA-Mini-Module-Attach-Detach", wait : true, propagate : false, parameters: [ -// string(name: 'eNB_MR', value: String.valueOf(MR)), -// string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), -// string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), -// string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), -// booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) -// ] + //calling NSA 2x2 + build job: "RAN-NSA-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) + ] + //calling LTE 2x2 + build job: "RAN-LTE-2x2-Module-OAIEPC", wait : true, propagate : false, parameters: [ + string(name: 'eNB_MR', value: String.valueOf(MR)), + string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) + ] } } From 3a0161f10f57ba4c6e39e039773d93fe3b8beec3 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 11 Oct 2021 15:30:52 +0200 Subject: [PATCH 06/14] fix NSA 2x2 pipeline and test --- ci-scripts/ran.py | 1 + ci-scripts/xml_files/fr1_multi_node_build.xml | 7 ++++++- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index acf31b8242..6d8d00610c 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -342,6 +342,7 @@ class RANManagement(): self.testCase_id = HTML.testCase_id mySSH = SSH.SSHConnection() + cwd = os.getcwd() mySSH.copyout(lIpAddr,lUserName,lPassWord, cwd + "/active_net_interfaces.awk", "/tmp") #reboot USRP if requested in xml diff --git a/ci-scripts/xml_files/fr1_multi_node_build.xml b/ci-scripts/xml_files/fr1_multi_node_build.xml index 57c4685341..60bc734e65 100644 --- a/ci-scripts/xml_files/fr1_multi_node_build.xml +++ b/ci-scripts/xml_files/fr1_multi_node_build.xml @@ -26,7 +26,7 @@ wrench 000001 000002 - 000003 000004 + 000004 000005 000003 @@ -64,5 +64,10 @@ 1 + + IdleSleep + Sleep + 120 + diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 09ba970977..9e1c7afde3 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -60,7 +60,7 @@ Initialize_eNB Initialize eNB - -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf + -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 0 0 lte @@ -72,7 +72,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q + -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 1 1 nr From a7fe9715228511c5590c7ddb733e111e013bf413 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 11 Oct 2021 22:35:58 +0200 Subject: [PATCH 07/14] collect stats log for multiple nodes --- ci-scripts/ran.py | 21 +++++++++++++++----- ci-scripts/stats_monitor.py | 18 ++++++++++------- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 ++ 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 6d8d00610c..28b2b714e0 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -482,13 +482,14 @@ class RANManagement(): mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh > ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '.log 2>&1 &', lUserName, 10) - #tentative + #stats monitoring during runtime time.sleep(20) + monitor_file='stats_monitor.py' if self.eNB_Stats=='yes': - monitor_file='stats_monitor.py' - #mySSH.command('echo ' + lPassWord + ' | sudo -S cp ' + self.eNBSourceCodePath + '/ci-scripts/'+ monitor_file + ' ' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build/.','\$', 5) - #mySSH.command('echo $USER; nohup python3 ' + self.eNBSourceCodePath + '/cmake_targets/ran_build/build/' + monitor_file + ' 2>&1 &', '\$', 5) - mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' 2>&1 > stats_monitor_execution.log &', '\$', 5) + if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'enb\' 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) + else: + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'gnb\' 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) @@ -686,6 +687,11 @@ class RANManagement(): fileToAnalyze = self.eNBLogFiles[int(self.eNB_instance)] self.eNBLogFiles[int(self.eNB_instance)] = '' if analyzeFile: + #*stats.log files + pickle + png + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*stats.log', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.pickle', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.png', '.') + # copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.') if (copyin_res == -1): logging.debug('\u001B[1;37;41m Could not copy ' + nodeB_prefix + 'NB logfile to analyze it! \u001B[0m') @@ -694,6 +700,11 @@ class RANManagement(): self.eNBmbmsEnables[int(self.eNB_instance)] = False return if self.eNB_serverId[self.eNB_instance] != '0': + #*stats.log files + pickle + png + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*stats.log', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.pickle', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.png', self.eNBSourceCodePath + '/cmake_targets/') + # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze, HTML) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 7ce00dab46..57a7ad0437 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -8,8 +8,11 @@ import pickle import numpy as np import os -def collect(d): - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' +def collect(d, node_type): + if node_type=='enb': + cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' + else: #'gnb' + cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) output = process.stdout.readlines() for l in output: @@ -22,7 +25,7 @@ def collect(d): d['mcs'].append(int(result.group(4))) -def graph(d): +def graph(d, node_type): figure, axis = plt.subplots(4, 1,figsize=(10, 10)) @@ -61,11 +64,12 @@ def graph(d): plt.tight_layout() # Combine all the operations and display - plt.savefig('/tmp/stats_monitor.png') + plt.savefig('/tmp/'+node_type+'_stats_monitor.png') plt.show() if __name__ == "__main__": + node_type = sys.argv[1]#enb or gnb d={} d['PHR']=[] @@ -78,13 +82,13 @@ if __name__ == "__main__": process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() while len(output)!=0 : - collect(d) + collect(d, node_type) process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() time.sleep(1) print('process stopped') - with open('/tmp/stats_monitor.pickle', 'wb') as handle: + with open('/tmp/'+node_type+'_stats_monitor.pickle', 'wb') as handle: pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL) - graph(d) + graph(d, node_type) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 9e1c7afde3..d04719fda8 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -65,6 +65,7 @@ 0 lte yes + yes 192.168.18.241 @@ -76,6 +77,7 @@ 1 1 nr + yes 192.168.18.240 From dd8a0798a7f2f1e3e351756f04994a6ac7efa189 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 11 Oct 2021 23:12:30 +0200 Subject: [PATCH 08/14] more fixes for test framework --- ci-scripts/ran.py | 4 ++-- ci-scripts/stats_monitor.py | 4 ++-- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 28b2b714e0..907a6cd667 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -487,9 +487,9 @@ class RANManagement(): monitor_file='stats_monitor.py' if self.eNB_Stats=='yes': if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): - mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'enb\' 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' enb 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) else: - mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' \'gnb\' 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ../ci-scripts/' + monitor_file + ' gnb 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 57a7ad0437..875f40f5e3 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -64,7 +64,7 @@ def graph(d, node_type): plt.tight_layout() # Combine all the operations and display - plt.savefig('/tmp/'+node_type+'_stats_monitor.png') + plt.savefig(node_type+'_stats_monitor.png') plt.show() if __name__ == "__main__": @@ -87,7 +87,7 @@ if __name__ == "__main__": output = process.stdout.readlines() time.sleep(1) print('process stopped') - with open('/tmp/'+node_type+'_stats_monitor.pickle', 'wb') as handle: + with open(node_type+'_stats_monitor.pickle', 'wb') as handle: pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL) graph(d, node_type) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index d04719fda8..ae5f11c975 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -122,8 +122,8 @@ Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 + iperf (UL/1Mbps/UDP)(60 sec)(single-ue profile) + -u -b 1M -t 60 UL nrmodule2_quectel 5 From 12a773ac32849c2a91002259fcf8bc86e7d676e9 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 12 Oct 2021 12:07:19 +0200 Subject: [PATCH 09/14] tentative to fix artifacts copyout --- ci-scripts/ran.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 5315466d25..514dd1308f 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -38,7 +38,7 @@ import os import time from multiprocessing import Process, Lock, SimpleQueue import yaml - +import subprocess #----------------------------------------------------------- # OAI Testing modules @@ -701,9 +701,19 @@ class RANManagement(): return if self.eNB_serverId[self.eNB_instance] != '0': #*stats.log files + pickle + png - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*stats.log', self.eNBSourceCodePath + '/cmake_targets/') - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.pickle', self.eNBSourceCodePath + '/cmake_targets/') - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.png', self.eNBSourceCodePath + '/cmake_targets/') + + #debug / tentative + target = self.eNBUserName + '@' + self.eNBIPAddress + ':' + cmd = 'scp ./*stats.log '+ target + self.eNBSourceCodePath + '/cmake_targets/' + lSsh = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + cmd = 'scp ./*.pickle '+ target + self.eNBSourceCodePath + '/cmake_targets/' + lSsh = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + cmd = 'scp ./*.png '+ target + self.eNBSourceCodePath + '/cmake_targets/' + lSsh = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + + #mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*stats.log', self.eNBSourceCodePath + '/cmake_targets/') + #mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.pickle', self.eNBSourceCodePath + '/cmake_targets/') + #mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.png', self.eNBSourceCodePath + '/cmake_targets/') # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) @@ -732,7 +742,7 @@ class RANManagement(): 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', '\$', 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 *.pickle *.png', '\$', 5) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *.pickle *.png', '\$', 5) mySSH.close() def AnalyzeLogFile_eNB(self, eNBlogFile, HTML): From 90c6b8b58b7f0c1696b173a5dd2e8936dbfca4da Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 12 Oct 2021 13:26:25 +0200 Subject: [PATCH 10/14] copyout workaround --- ci-scripts/ran.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 514dd1308f..d29936d1bb 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -38,7 +38,6 @@ import os import time from multiprocessing import Process, Lock, SimpleQueue import yaml -import subprocess #----------------------------------------------------------- # OAI Testing modules @@ -703,17 +702,10 @@ class RANManagement(): #*stats.log files + pickle + png #debug / tentative - target = self.eNBUserName + '@' + self.eNBIPAddress + ':' - cmd = 'scp ./*stats.log '+ target + self.eNBSourceCodePath + '/cmake_targets/' - lSsh = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - cmd = 'scp ./*.pickle '+ target + self.eNBSourceCodePath + '/cmake_targets/' - lSsh = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - cmd = 'scp ./*.png '+ target + self.eNBSourceCodePath + '/cmake_targets/' - lSsh = subprocess.Popen(cmd,shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - - #mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*stats.log', self.eNBSourceCodePath + '/cmake_targets/') - #mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.pickle', self.eNBSourceCodePath + '/cmake_targets/') - #mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './*.png', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrL1_stats.log', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrMAC_stats.log', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.pickle.pickle', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/') # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) From 90eb329da9df144bee347e58fbdb6b32b3a6a76d Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 12 Oct 2021 16:06:41 +0200 Subject: [PATCH 11/14] refactor stat_monitor --- ci-scripts/stats_monitor.py | 2 +- ci-scripts/stats_monitor_conf.yaml | 11 +++++ ci-scripts/stats_monitor_dev.py | 79 ++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 ci-scripts/stats_monitor_conf.yaml create mode 100755 ci-scripts/stats_monitor_dev.py diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index 875f40f5e3..ae9b39bfa6 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -78,7 +78,7 @@ if __name__ == "__main__": d['mcs']=[] - cmd='ps aux | grep mode | grep -v grep' + cmd='ps aux | grep modem | grep -v grep' process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() while len(output)!=0 : diff --git a/ci-scripts/stats_monitor_conf.yaml b/ci-scripts/stats_monitor_conf.yaml new file mode 100644 index 0000000000..3da7c1e8ba --- /dev/null +++ b/ci-scripts/stats_monitor_conf.yaml @@ -0,0 +1,11 @@ +enb : + PHR: + bler: + mcsoff: + mcs: + +gnb : + PHR: + bler: + mcsoff: + mcs: \ No newline at end of file diff --git a/ci-scripts/stats_monitor_dev.py b/ci-scripts/stats_monitor_dev.py new file mode 100755 index 0000000000..26fc93f486 --- /dev/null +++ b/ci-scripts/stats_monitor_dev.py @@ -0,0 +1,79 @@ +import subprocess +import time +import shlex +import re +import sys +import matplotlib.pyplot as plt +import pickle +import numpy as np +import os +import yaml + + +class Stat_Monitor(): + def __init__(self,): + with open('stats_monitor_conf.yaml','r') as f: + self.d = yaml.load(f) + for node in self.d: + for metric in self.d[node]: + self.d[node][metric]=[] + + + def collect(self,node_type): + if node_type=='enb': + cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' + else: #'gnb' + cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' + process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) + output = process.stdout.readlines() + for l in output: + tmp=l.decode("utf-8") + result=re.match(rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp) + if result is not None: + self.d[node_type]['PHR'].append(int(result.group(1))) + self.d[node_type]['bler'].append(float(result.group(2))) + self.d[node_type]['mcsoff'].append(int(result.group(3))) + self.d[node_type]['mcs'].append(int(result.group(4))) + + + def graph(self,node_type): + + col = 1 + figure, axis = plt.subplots(len(self.d[node_type]), col ,figsize=(10, 10)) + i=0 + for metric in self.d[node_type]: + major_ticks = np.arange(0, len(self.d[node_type][metric])+1, 1) + axis[i].set_xticks(major_ticks) + axis[i].set_xticklabels([]) + axis[i].plot(self.d[node_type][metric],marker='o') + axis[i].set_xlabel('time') + axis[i].set_ylabel(metric) + axis[i].set_title(metric) + i+=1 + + plt.tight_layout() + # Combine all the operations and display + plt.savefig(node_type+'_stats_monitor.png') + plt.show() + + +if __name__ == "__main__": + + node_type = sys.argv[1]#enb or gnb + mon=Stat_Monitor() + + #collecting stats when modem process is stopped + cmd='ps aux | grep mode | grep -v grep' + process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) + output = process.stdout.readlines() + while len(output)!=0 : + mon.collect(node_type) + process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) + output = process.stdout.readlines() + time.sleep(1) + print('Process stopped') + with open(node_type+'_stats_monitor.pickle', 'wb') as handle: + pickle.dump(mon.d, handle, protocol=pickle.HIGHEST_PROTOCOL) + mon.graph(node_type) + + From 02e48dea4a93b489d057e43cead8651dfc8e0efd Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 13 Oct 2021 12:34:58 +0200 Subject: [PATCH 12/14] change in 2x2 config file 5g carrier frequency --- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 1 + .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 7abe460215..3460b82ac5 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -31,6 +31,7 @@ eNBs = prefix_type = "NORMAL"; eutra_band = 38; downlink_frequency = 2605000000L; + nr_scg_ssb_freq = 624608; uplink_frequency_offset = 0; Nid_cell = 0; N_RB_DL = 100; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index 640ec6830c..aac4f5d220 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -34,11 +34,11 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL - # this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP) - absoluteFrequencySSB = 641272; //641032; #641968; 641968=start of ssb at 3600MHz + 82 RBs 641032=center of SSB at center of cell + # this is 3350.04 MHz + 53 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 624608; dl_frequencyBand = 78; - # this is 3600 MHz - dl_absoluteFrequencyPointA = 640000; + # this is 3350.04 MHz + dl_absoluteFrequencyPointA = 623336; #scs-SpecificCarrierList dl_offstToCarrier = 0; # subcarrierSpacing @@ -47,7 +47,7 @@ gNBs = dl_carrierBandwidth = 106; #initialDownlinkBWP #genericParameters - # this is RBstart=84,L=13 (275*(L-1))+RBstart + # this is RBstart=43,L=24 (275*(L-1))+RBstart initialDLBWPlocationAndBandwidth = 6368; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 @@ -234,7 +234,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; - prach_dtx_threshold = 100; + prach_dtx_threshold = 120; } ); From 13dcddf40ce31ca1560d6ca8094e79e06cef7cdf Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 13 Oct 2021 14:04:28 +0200 Subject: [PATCH 13/14] add mtu 1500 in epc docker compose --- ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml b/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml index 31eee2ca3d..0005ce8844 100644 --- a/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml +++ b/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml @@ -143,6 +143,7 @@ services: TAC: 1 GW_ID: 1 REALM: openairinterface.org + UE_MTU_IPV4: 1500 healthcheck: test: /bin/bash -c "pgrep oai_spgwc" interval: 10s From 37c66efd01ba3fd6174a29e9b6c02d6564204aec Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 13 Oct 2021 14:35:28 +0200 Subject: [PATCH 14/14] improve script struct --- ci-scripts/stats_monitor_dev.py | 35 ++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/ci-scripts/stats_monitor_dev.py b/ci-scripts/stats_monitor_dev.py index 26fc93f486..cbf0d20880 100755 --- a/ci-scripts/stats_monitor_dev.py +++ b/ci-scripts/stats_monitor_dev.py @@ -19,13 +19,7 @@ class Stat_Monitor(): self.d[node][metric]=[] - def collect(self,node_type): - if node_type=='enb': - cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' - else: #'gnb' - cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' - process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) - output = process.stdout.readlines() + def process_enb (self,node_type,output): for l in output: tmp=l.decode("utf-8") result=re.match(rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp) @@ -36,6 +30,33 @@ class Stat_Monitor(): self.d[node_type]['mcs'].append(int(result.group(4))) + + def process_gnb (self,node_type,output): + for l in output: + tmp=l.decode("utf-8") + result=re.match(rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp) + if result is not None: + self.d[node_type]['PHR'].append(int(result.group(1))) + self.d[node_type]['bler'].append(float(result.group(2))) + self.d[node_type]['mcsoff'].append(int(result.group(3))) + self.d[node_type]['mcs'].append(int(result.group(4))) + + + + + + def collect(self,node_type): + if node_type=='enb': + cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log' + else: #'gnb' + cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log' + process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) + output = process.stdout.readlines() + if node_type=='enb': + self.process_enb(node_type,output) + else: #'gnb' + self.process_gnb(node_type,output) + def graph(self,node_type): col = 1