From 97d097347687d0caf1f6ccc2386a3a01f5a85af6 Mon Sep 17 00:00:00 2001 From: Remi Hardy Date: Tue, 8 Jun 2021 17:38:40 +0200 Subject: [PATCH] update module mgt and log collect for nsa test --- ci-scripts/cls_module_ue.py | 10 +++++++++- ci-scripts/cls_oaicitest.py | 14 +++++++++----- ci-scripts/ran.py | 20 ++++++++++++++++++-- ci-scripts/xml_files/fr1_nsa_quectel.xml | 8 ++------ 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/ci-scripts/cls_module_ue.py b/ci-scripts/cls_module_ue.py index 3130dbfa7d..e3ea863b21 100644 --- a/ci-scripts/cls_module_ue.py +++ b/ci-scripts/cls_module_ue.py @@ -101,7 +101,7 @@ class Module_UE: def GetModuleIPAddress(self): HOST=self.HostIPAddress response= [] - tentative = 10 + tentative = 3 while (len(response)==0) and (tentative>0): COMMAND="ip a show dev " + self.UENetwork + " | grep inet | grep " + self.UENetwork logging.debug(COMMAND) @@ -141,3 +141,11 @@ class Module_UE: mySSH.command('echo ' + self.HostPassword + ' | sudo -S killall --signal=SIGINT *QLog*', '\$',5) mySSH.close() + + def DisableCM(self): + mySSH = sshconnection.SSHConnection() + mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) + mySSH.command('echo ' + self.HostPassword + ' | sudo -S killall --signal SIGKILL *'+self.Process['Name']+'*', '\$', 5) + mySSH.close() + + diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index a9507b9c5d..31230a3df3 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -388,12 +388,13 @@ class OaiCiTest(): Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) is_module=Module_UE.CheckCMProcess() if is_module: + Module_UE.EnableTrace() + time.sleep(5) Module_UE.Command("wup") logging.debug("Waiting for IP address to be assigned") time.sleep(20) logging.debug("Retrieve IP address") status=Module_UE.GetModuleIPAddress() - Module_UE.EnableTrace() if status==0: HTML.CreateHtmlTestRow(Module_UE.UEIPAddress, 'OK', CONST.ALL_PROCESSES_OK) logging.debug('UE IP addresss : '+ Module_UE.UEIPAddress) @@ -1084,6 +1085,7 @@ class OaiCiTest(): Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) Module_UE.Command("detach") Module_UE.DisableTrace() + Module_UE.DisableCM() HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) @@ -3148,6 +3150,12 @@ class OaiCiTest(): HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) def AutoTerminateUEandeNB(self,HTML,RAN,COTS_UE,EPC,InfraUE): + if self.ue_id!='': + Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) + Module_UE.Command("detach") + Module_UE.DisableTrace() + Module_UE.DisableCM() + if (self.ADBIPAddress != 'none'): self.testCase_id = 'AUTO-KILL-UE' HTML.testCase_id=self.testCase_id @@ -3181,10 +3189,6 @@ class OaiCiTest(): HTML.desc='Automatic Termination of FlexRan CTL' self.ShowTestID() self.TerminateFlexranCtrl(HTML,RAN,EPC) - if self.ue_id!='': - Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) - Module_UE.Command("detach") - Module_UE.DisableTrace() RAN.prematureExit=True def IdleSleep(self,HTML): diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 66c8392662..b7675cfdac 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -344,6 +344,21 @@ class RANManagement(): HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' ' + self.Initialize_eNB_args, 'KO', self.pStatus) HTML.CreateHtmlTabFooter(False) sys.exit(1) + #Get pcap on S1 and X2 interface always + if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): + mySSH.open(lIpAddr, lUserName, lPassWord) + mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5) + result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) + if result is not None: + eth_interface = result.group('eth_interface') + logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + '\u001B[0m') + pcapfile = 'enb_' + self.testCase_id + '_s1x2log.pcap' + mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5) + mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -w /tmp/' + pcapfile + ' 2>&1 &','\$', 5) + mySSH.close() + + + # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB result = re.search('T_stdout', str(self.Initialize_eNB_args)) if (result is not None): @@ -650,9 +665,10 @@ class RANManagement(): mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) mySSH.command('cd ' + self.eNBSourceCodePath, '\$', 5) mySSH.command('cd cmake_targets', '\$', 5) + mySSH.command('cp /tmp/enb_*_s1x2log.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 enb_*txt physim_*.log', '\$', 60) - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap enb_*txt', '\$', 5) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap enb_*txt physim_*.log *stats.log', '\$', 60) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap enb_*txt physim_*.log *stats.log', '\$', 5) mySSH.close() def AnalyzeLogFile_eNB(self, eNBlogFile, HTML): diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 8992221608..7ac7b990db 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -30,15 +30,11 @@ 040000 000002 010000 + 000001 050000 050001 000001 - 070000 - 000001 - 070000 - 000001 010002 - 000001 080001 080000 @@ -61,7 +57,7 @@ Initialize_eNB Initialize eNB - -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf --T_stdout 0 + -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf 0 0 lte