diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index 3a52a6118cc3c770594b602cc3582942a605b00d..09d500f203d185fc00fd0778721a1b5e542d4a38 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -63,6 +63,8 @@ class EPCManagement(): self.PcapFileName = '' self.htmlObj = None self.testCase_id = '' + self.MmeIPAddress = '' + self.containerPrefix = 'prod' #----------------------------------------------------------- # Setter and Getters on Public Members @@ -92,6 +94,10 @@ class EPCManagement(): self.htmlObj = obj def SetTestCase_id(self, idx): self.testCase_id = idx + def GetMmeIPAddress(self): + return self.MmeIPAddress + def SetContainerPrefix(self, prefix): + self.containerPrefix = prefix #----------------------------------------------------------- # EPC management functions @@ -104,7 +110,14 @@ class EPCManagement(): sys.exit('Insufficient EPC Parameters') mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + logging.debug('Using the OAI EPC Release 14 Cassandra-based HSS in Docker') + mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) + mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-hss /bin/bash -c "nohup tshark -i eth0 -i eth1 -w /tmp/hss_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + time.sleep(5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-hss /bin/bash -c "nohup ./bin/oai_hss -j ./etc/hss_rel14.json --reloadkey true > hss_check_run.log 2>&1"', '\$', 5) + elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): logging.debug('Using the OAI EPC Release 14 Cassandra-based HSS') mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) logging.debug('\u001B[1m Launching tshark on all interfaces \u001B[0m') @@ -142,7 +155,12 @@ class EPCManagement(): sys.exit('Insufficient EPC Parameters') mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + logging.debug('Using the OAI EPC Release 14 MME in Docker') + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + time.sleep(5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/mme.conf > mme_check_run.log 2>&1"', '\$', 5) + elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): logging.debug('Using the OAI EPC Release 14 MME') mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S rm -f mme_' + self.testCase_id + '.log', '\$', 5) @@ -169,6 +187,25 @@ class EPCManagement(): if self.htmlObj is not None: self.htmlObj.CreateHtmlTestRow(self.Type, 'OK', CONST.ALL_PROCESSES_OK) + def SetMmeIPAddress(self): + # Not an error if we don't need an EPC + if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': + return + if self.IPAddress == 'none': + return + # Only in case of Docker containers, MME IP address is not the EPC HOST IP address + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH = SSH.SSHConnection() + mySSH.open(self.IPAddress, self.UserName, self.Password) + mySSH.command('docker inspect --format="MME_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" ' + self.containerPrefix + '-oai-mme', '\$', 5) + result = re.search('MME_IP_ADDR = (?P<mme_ip_addr>[0-9\.]+)', mySSH.getBefore()) + if result is not None: + self.MmeIPAddress = result.group('mme_ip_addr') + logging.debug('MME IP Address is ' + self.MmeIPAddress) + mySSH.close() + else: + self.MmeIPAddress = self.IPAddress + def InitializeSPGW(self): if self.IPAddress == '' or self.UserName == '' or self.Password == '' or self.SourceCodePath == '' or self.Type == '': HELP.GenericHelp(CONST.Version) @@ -176,7 +213,15 @@ class EPCManagement(): sys.exit('Insufficient EPC Parameters') mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + logging.debug('Using the OAI EPC Release 14 SPGW-CUPS in Docker') + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup tshark -i eth0 -i lo:p5c -i lo:s5c -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup tshark -i eth0 -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 5) + time.sleep(5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "nohup ./bin/oai_spgwc -o -c ./etc/spgw_c.conf > spgwc_check_run.log 2>&1"', '\$', 5) + time.sleep(5) + mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "nohup ./bin/oai_spgwu -o -c ./etc/spgw_u.conf > spgwu_check_run.log 2>&1"', '\$', 5) + elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): logging.debug('Using the OAI EPC Release 14 SPGW-CUPS') mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S rm -f spgwc_' + self.testCase_id + '.log spgwu_' + self.testCase_id + '.log', '\$', 5) @@ -205,8 +250,11 @@ class EPCManagement(): try: mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - mySSH.command('stdbuf -o0 ps -aux | grep --color=never hss | grep -v grep', '\$', 5) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "ps aux | grep oai_hss"', '\$', 5) + else: + mySSH.command('stdbuf -o0 ps -aux | grep --color=never hss | grep -v grep', '\$', 5) + if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): result = re.search('oai_hss -j', mySSH.getBefore()) elif re.match('OAI', self.Type, re.IGNORECASE): result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) @@ -227,8 +275,13 @@ class EPCManagement(): try: mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - mySSH.command('stdbuf -o0 ps -aux | grep --color=never mme | grep -v grep', '\$', 5) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "ps aux | grep oai_mme"', '\$', 5) + else: + mySSH.command('stdbuf -o0 ps -aux | grep --color=never mme | grep -v grep', '\$', 5) + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + result = re.search('oai_mme -c ', mySSH.getBefore()) + elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): result = re.search('mme -c', mySSH.getBefore()) elif re.match('OAI', self.Type, re.IGNORECASE): result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) @@ -249,7 +302,13 @@ class EPCManagement(): try: mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "ps aux | grep oai_spgwc"', '\$', 5) + result = re.search('oai_spgwc -o -c ', mySSH.getBefore()) + if result is not None: + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "ps aux | grep oai_spgwu"', '\$', 5) + result = re.search('oai_spgwu -o -c ', mySSH.getBefore()) + elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('stdbuf -o0 ps -aux | grep --color=never spgw | grep -v grep', '\$', 5) result = re.search('spgwu -c ', mySSH.getBefore()) elif re.match('OAI', self.Type, re.IGNORECASE): @@ -272,7 +331,14 @@ class EPCManagement(): def TerminateHSS(self): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "killall --signal SIGINT oai_hss tshark"', '\$', 5) + time.sleep(2) + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "ps aux | grep oai_hss"', '\$', 5) + result = re.search('oai_hss -j ', mySSH.getBefore()) + if result is not None: + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-hss /bin/bash -c "killall --signal SIGKILL oai_hss"', '\$', 5) + elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT oai_hss || true', '\$', 5) time.sleep(2) mySSH.command('stdbuf -o0 ps -aux | grep hss | grep -v grep', '\$', 5) @@ -301,7 +367,14 @@ class EPCManagement(): def TerminateMME(self): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "killall --signal SIGINT oai_mme tshark"', '\$', 5) + time.sleep(2) + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "ps aux | grep oai_mme"', '\$', 5) + result = re.search('oai_mme -c ', mySSH.getBefore()) + if result is not None: + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-mme /bin/bash -c "killall --signal SIGKILL oai_mme"', '\$', 5) + elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT run_mme mme || true', '\$', 5) time.sleep(2) mySSH.command('stdbuf -o0 ps -aux | grep mme | grep -v grep', '\$', 5) @@ -321,7 +394,19 @@ class EPCManagement(): def TerminateSPGW(self): mySSH = SSH.SSHConnection() mySSH.open(self.IPAddress, self.UserName, self.Password) - if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "killall --signal SIGINT oai_spgwc tshark"', '\$', 5) + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "killall --signal SIGINT oai_spgwu tshark"', '\$', 5) + time.sleep(2) + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "ps aux | grep oai_spgwc"', '\$', 5) + result = re.search('oai_spgwc -o -c ', mySSH.getBefore()) + if result is not None: + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwc /bin/bash -c "killall --signal SIGKILL oai_spgwc"', '\$', 5) + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "ps aux | grep oai_spgwu"', '\$', 5) + result = re.search('oai_spgwu -o -c ', mySSH.getBefore()) + if result is not None: + mySSH.command('docker exec -it ' + self.containerPrefix + '-oai-spgwu-tiny /bin/bash -c "killall --signal SIGKILL oai_spgwu"', '\$', 5) + elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT spgwc spgwu || true', '\$', 5) time.sleep(2) mySSH.command('stdbuf -o0 ps -aux | grep spgw | grep -v grep', '\$', 5) @@ -355,7 +440,11 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('rm -f hss.log.zip', '\$', 5) - if re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker cp ' + self.containerPrefix + '-oai-hss:/openair-hss/hss_check_run.log .', '\$', 60) + mySSH.command('docker cp ' + self.containerPrefix + '-oai-hss:/tmp/hss_check_run.pcap .', '\$', 60) + mySSH.command('zip hss.log.zip hss_check_run.*', '\$', 60) + elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('zip hss.log.zip hss*.log', '\$', 60) mySSH.command('echo ' + self.Password + ' | sudo -S rm hss*.log', '\$', 5) if re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): @@ -373,7 +462,11 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('rm -f mme.log.zip', '\$', 5) - if re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker cp ' + self.containerPrefix + '-oai-mme:/openair-mme/mme_check_run.log .', '\$', 60) + mySSH.command('docker cp ' + self.containerPrefix + '-oai-mme:/tmp/mme_check_run.pcap .', '\$', 60) + mySSH.command('zip mme.log.zip mme_check_run.*', '\$', 60) + elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('zip mme.log.zip mme*.log', '\$', 60) mySSH.command('echo ' + self.Password + ' | sudo -S rm mme*.log', '\$', 5) elif re.match('ltebox', self.Type, re.IGNORECASE): @@ -388,7 +481,13 @@ class EPCManagement(): mySSH.open(self.IPAddress, self.UserName, self.Password) mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('rm -f spgw.log.zip', '\$', 5) - if re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): + if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE): + mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwc:/openair-spgwc/spgwc_check_run.log .', '\$', 60) + mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwu-tiny:/openair-spgwu-tiny/spgwu_check_run.log .', '\$', 60) + mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwc:/tmp/spgwc_check_run.pcap .', '\$', 60) + mySSH.command('docker cp ' + self.containerPrefix + '-oai-spgwu-tiny:/tmp/spgwu_check_run.pcap .', '\$', 60) + mySSH.command('zip spgw.log.zip spgw*_check_run.*', '\$', 60) + elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): mySSH.command('zip spgw.log.zip spgw*.log', '\$', 60) mySSH.command('echo ' + self.Password + ' | sudo -S rm spgw*.log', '\$', 5) elif re.match('ltebox', self.Type, re.IGNORECASE): diff --git a/ci-scripts/main.py b/ci-scripts/main.py index a01eed2ac5cff1941b79a2c75caf24ac304f2eb8..bdc1d09a405d2c57d241ef437d9893e85d165598 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -403,23 +403,50 @@ class OaiCiTest(): if (outterLoopCounter == 0): doOutterLoop = False continue + # We are now checking if sync w/ eNB DOES NOT OCCUR + # Usually during the cell synchronization stage, the UE returns with No cell synchronization message + # That is the case for LTE + # In NR case, it's a positive message that will show if synchronization occurs + doLoop = True if RAN.Getair_interface() == 'nr': - fullSyncStatus = True - doOutterLoop = False + loopCounter = 10 else: # We are now checking if sync w/ eNB DOES NOT OCCUR # Usually during the cell synchronization stage, the UE returns with No cell synchronization message - doLoop = True loopCounter = 10 - while (doLoop): - loopCounter = loopCounter - 1 - if (loopCounter == 0): + while (doLoop): + loopCounter = loopCounter - 1 + if (loopCounter == 0): + if RAN.Getair_interface() == 'nr': + # Here we do have great chances that UE did NOT cell-sync w/ gNB + doLoop = False + fullSyncStatus = False + logging.debug('Never seen the NR-Sync message (Measured Carrier Frequency) --> try again') + time.sleep(6) + # Stopping the NR-UE + SSH.command('ps -aux | grep --text --color=never softmodem | grep -v grep', '\$', 4) + result = re.search('nr-uesoftmodem', SSH.getBefore()) + if result is not None: + SSH.command('echo ' + self.UEPassword + ' | sudo -S killall --signal=SIGINT nr-uesoftmodem', '\$', 4) + time.sleep(6) + else: # Here we do have a great chance that the UE did cell-sync w/ eNB doLoop = False doOutterLoop = False fullSyncStatus = True continue - SSH.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4) + SSH.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync|Frequency"', '\$', 4) + if RAN.Getair_interface() == 'nr': + # Positive messaging --> + result = re.search('Measured Carrier Frequency', SSH.getBefore()) + if result is not None: + doLoop = False + doOutterLoop = False + fullSyncStatus = True + else: + time.sleep(6) + else: + # Negative messaging --> result = re.search('No cell synchronization found', SSH.getBefore()) if result is None: time.sleep(6) @@ -432,13 +459,22 @@ class OaiCiTest(): result = re.search('lte-uesoftmodem', SSH.getBefore()) if result is not None: SSH.command('echo ' + self.UEPassword + ' | sudo -S killall --signal=SIGINT lte-uesoftmodem', '\$', 4) - outterLoopCounter = outterLoopCounter - 1 - if (outterLoopCounter == 0): - doOutterLoop = False + outterLoopCounter = outterLoopCounter - 1 + if (outterLoopCounter == 0): + doOutterLoop = False - if fullSyncStatus and gotSyncStatus and RAN.Getair_interface() == 'lte': - result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) - if result is None: + if fullSyncStatus and gotSyncStatus: + doInterfaceCheck = False + if RAN.Getair_interface() == 'lte': + result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) + if result is None: + doInterfaceCheck = True + # For the moment, only in explicit noS1 without kernel module (ie w/ tunnel interface) + if RAN.Getair_interface() == 'nr': + result = re.search('--noS1 --nokrnmod 1', str(self.Initialize_OAI_UE_args)) + if result is not None: + doInterfaceCheck = True + if doInterfaceCheck: SSH.command('ifconfig oaitun_ue1', '\$', 4) SSH.command('ifconfig oaitun_ue1', '\$', 4) # ifconfig output is different between ubuntu 16 and ubuntu 18 @@ -3316,10 +3352,13 @@ while len(argvs) > 1: EPC.SetSourceCodePath(matchReg.group(1)) elif re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-EPCType=(.+)$', myArgv, re.IGNORECASE) - if re.match('OAI', matchReg.group(1), re.IGNORECASE) or re.match('ltebox', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-CUPS', matchReg.group(1), re.IGNORECASE): + if re.match('OAI', matchReg.group(1), re.IGNORECASE) or re.match('ltebox', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-CUPS', matchReg.group(1), re.IGNORECASE) or re.match('OAI-Rel14-Docker', matchReg.group(1), re.IGNORECASE): EPC.SetType(matchReg.group(1)) else: - sys.exit('Invalid EPC Type: ' + matchReg.group(1) + ' -- (should be OAI or ltebox or OAI-Rel14-CUPS)') + sys.exit('Invalid EPC Type: ' + matchReg.group(1) + ' -- (should be OAI or ltebox or OAI-Rel14-CUPS or OAI-Rel14-Docker)') + elif re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE): + matchReg = re.match('^\-\-EPCContainerPrefix=(.+)$', myArgv, re.IGNORECASE) + EPC.SetContainerPrefix(matchReg.group(1)) elif re.match('^\-\-ADBIPAddress=(.+)$', myArgv, re.IGNORECASE): matchReg = re.match('^\-\-ADBIPAddress=(.+)$', myArgv, re.IGNORECASE) CiTestObj.ADBIPAddress = matchReg.group(1) @@ -3542,6 +3581,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re sys.exit(1) if (EPC.GetIPAddress() != '') and (EPC.GetIPAddress() != 'none'): CiTestObj.CheckFlexranCtrlInstallation() + EPC.SetMmeIPAddress() #get the list of tests to be done todo_tests=[] diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 350098e66ee20e74a20915f3f72d084742f5acf5..5b5add0adb5b968f8197e8bc91a283d7c32f9a7a 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -522,8 +522,8 @@ class RANManagement(): # Make a copy and adapt to EPC / eNB IP addresses mySSH.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) if self.epcObj is not None: - localEpcIpAddr = self.epcObj.GetIPAddress() - mySSH.command('sed -i -e \'s/CI_MME_IP_ADDR/' + localEpcIpAddr + '/\' ' + ci_full_config_file, '\$', 2); + localMmeIpAddr = self.epcObj.GetMmeIPAddress() + mySSH.command('sed -i -e \'s/CI_MME_IP_ADDR/' + localMmeIpAddr + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + lIpAddr + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_RCC_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/CI_RRU1_IP_ADDR/' + self.eNB1IPAddress + '/\' ' + ci_full_config_file, '\$', 2); @@ -801,6 +801,7 @@ class RANManagement(): pdcpFailure = 0 ulschFailure = 0 ulschReceiveOK = 0 + gnbRxTxWakeUpFailure = 0 cdrxActivationMessageCount = 0 dropNotEnoughRBs = 0 mbmsRequestMsg = 0 @@ -910,7 +911,10 @@ class RANManagement(): result = re.search('PDCP.*Out of Resources.*reason', str(line)) if result is not None: pdcpFailure += 1 - result = re.search('ULSCH in error in round', str(line)) + result = re.search('could not wakeup gNB rxtx process', str(line)) + if result is not None: + gnbRxTxWakeUpFailure += 1 + result = re.search('ULSCH in error in round|ULSCH 0 in error', str(line)) if result is not None: ulschFailure += 1 result = re.search('ULSCH received ok', str(line)) @@ -940,6 +944,10 @@ class RANManagement(): statMsg = nodeB_prefix + 'NB showed ' + str(ulschReceiveOK) + ' "ULSCH received ok" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') htmleNBFailureMsg += statMsg + '\n' + if gnbRxTxWakeUpFailure > 0: + statMsg = nodeB_prefix + 'NB showed ' + str(gnbRxTxWakeUpFailure) + ' "could not wakeup gNB rxtx process" message(s)' + logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') + htmleNBFailureMsg += statMsg + '\n' if uciStatMsgCount > 0: statMsg = nodeB_prefix + 'NB showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index 68a1d7836c78cf8a6b306736ee0d9685ae48a450..ba0f900f2940482589e3e9711c942031af88cd9a 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -52,15 +52,19 @@ class SSHConnection(): self.picocom_closure = True def open(self, ipaddress, username, password): + extraSshOptions = '' count = 0 connect_status = False + if ipaddress == '192.168.18.197': + extraSshOptions = ' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' while count < 4: - self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress], timeout = 5) + self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress + extraSshOptions], timeout = 5) self.sshresponse = self.ssh.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', 'Last login', pexpect.EOF, pexpect.TIMEOUT]) if self.sshresponse == 0: self.ssh.sendline('yes') - self.ssh.expect('password:') - self.ssh.sendline(password) + self.sshresponse = self.ssh.expect(['password:', username + '@']) + if self.sshresponse == 0: + self.ssh.sendline(password) self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) if self.sshresponse == 0: count = 10