\n')
self.htmlFile.write(' | ' + self.testCase_id + ' | \n')
@@ -2213,15 +2879,17 @@ class SSHConnection():
if (processesStatus == 0):
self.htmlFile.write(' ' + str(status) + ' | \n')
elif (processesStatus == ENB_PROCESS_FAILED):
- self.htmlFile.write(' KO - eNB process not found | \n')
+ self.htmlFile.write(' KO - ' + machine + ' process not found | \n')
elif (processesStatus == ENB_PROCESS_SEG_FAULT):
- self.htmlFile.write(' KO - eNB process ended in Segmentation Fault | \n')
- elif (processesStatus == ENB_PROCESS_ASSERTION):
- self.htmlFile.write(' KO - eNB process ended in Assertion | \n')
+ self.htmlFile.write(' KO - ' + machine + ' process ended in Segmentation Fault | \n')
+ elif (processesStatus == ENB_PROCESS_ASSERTION) or (processesStatus == UE_PROCESS_ASSERTION):
+ self.htmlFile.write(' KO - ' + machine + ' process ended in Assertion | \n')
elif (processesStatus == ENB_PROCESS_REALTIME_ISSUE):
- self.htmlFile.write(' KO - eNB process faced Real Time issue(s) | \n')
- elif (processesStatus == ENB_PROCESS_NOLOGFILE_TO_ANALYZE):
- self.htmlFile.write(' OK | \n')
+ self.htmlFile.write(' KO - ' + machine + ' process faced Real Time issue(s) | \n')
+ elif (processesStatus == ENB_PROCESS_NOLOGFILE_TO_ANALYZE) or (processesStatus == UE_PROCESS_NOLOGFILE_TO_ANALYZE):
+ self.htmlFile.write(' OK? | \n')
+ elif (processesStatus == UE_PROCESS_COULD_NOT_SYNC):
+ self.htmlFile.write(' KO - UE could not sync | \n')
elif (processesStatus == HSS_PROCESS_FAILED):
self.htmlFile.write(' KO - HSS process not found | \n')
elif (processesStatus == MME_PROCESS_FAILED):
@@ -2325,8 +2993,11 @@ def Usage():
print(' --XMLTestFile=[XML Test File to be run]')
print('------------------------------------------------------------')
+#def GetModeFromXML():
+# SSH.mode = test.findtext('mode')
+
def CheckClassValidity(action,id):
- if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'IdleSleep':
+ if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Build_OAI_UE' and action != 'Initialize_OAI_UE' and action != 'Terminate_OAI_UE' and action != 'Initialize_OAI_eNB' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep':
logging.debug('ERROR: test-case ' + id + ' has wrong class ' + action)
return False
return True
@@ -2340,11 +3011,21 @@ def GetParametersFromXML(action):
SSH.eNB_instance = test.findtext('eNB_instance')
if (SSH.eNB_instance is None):
SSH.eNB_instance = '0'
-
+ SSH.air_interface = test.findtext('air_interface')
+ if (SSH.air_interface is None):
+ SSH.air_interface = 'lte'
+ else:
+ SSH.air_interface = SSH.air_interface.lower()
+
if action == 'Terminate_eNB':
SSH.eNB_instance = test.findtext('eNB_instance')
if (SSH.eNB_instance is None):
SSH.eNB_instance = '0'
+ SSH.air_interface = test.findtext('air_interface')
+ if (SSH.air_interface is None):
+ SSH.air_interface = 'lte'
+ else:
+ SSH.air_interface = SSH.air_interface.lower()
if action == 'Attach_UE':
nbMaxUEtoAttach = test.findtext('nbMaxUEtoAttach')
@@ -2353,7 +3034,42 @@ def GetParametersFromXML(action):
else:
SSH.nbMaxUEtoAttach = int(nbMaxUEtoAttach)
- if action == 'Ping':
+ if action == 'Build_OAI_UE':
+ SSH.Build_OAI_UE_args = test.findtext('Build_OAI_UE_args')
+ SSH.clean_repository = test.findtext('clean_repository')
+ if (SSH.clean_repository == 'false'):
+ SSH.clean_repository = False
+ else:
+ SSH.clean_repository = True
+
+ if action == 'Initialize_OAI_UE':
+ SSH.Initialize_OAI_UE_args = test.findtext('Initialize_OAI_UE_args')
+ SSH.UE_instance = test.findtext('UE_instance')
+ if (SSH.UE_instance is None):
+ SSH.UE_instance = '0'
+ SSH.air_interface = test.findtext('air_interface')
+ if (SSH.air_interface is None):
+ SSH.air_interface = 'lte'
+ else:
+ SSH.air_interface = SSH.air_interface.lower()
+
+ if action == 'Initialize_OAI_eNB':
+ SSH.Initialize_OAI_eNB_args = test.findtext('Initialize_OAI_eNB_args')
+ SSH.UE_instance = test.findtext('eNB_instance')
+ if (SSH.eNB_instance is None):
+ SSH.eNB_instance = '0'
+ SSH.air_interface = test.findtext('air_interface')
+ if (SSH.air_interface is None):
+ SSH.air_interface = 'lte'
+ else:
+ SSH.air_interface = SSH.air_interface.lower()
+
+ if action == 'Terminate_OAI_UE':
+ SSH.eNB_instance = test.findtext('UE_instance')
+ if (SSH.UE_instance is None):
+ SSH.UE_instance = '0'
+
+ if action == 'Ping' or action == 'Ping_CatM_module':
SSH.ping_args = test.findtext('ping_args')
SSH.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold')
@@ -2395,6 +3111,7 @@ SSH = SSHConnection()
argvs = sys.argv
argc = len(argvs)
+cwd = os.getcwd()
while len(argvs) > 1:
myArgv = argvs.pop(1) # 0th is this file's name
@@ -2403,6 +3120,9 @@ while len(argvs) > 1:
sys.exit(0)
elif re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-mode=(.+)$', myArgv, re.IGNORECASE)
+ #if matchReg and mode is not None:
+ #print('Warning: the mode is defined in both xml file and command line')
+ #print('ignoring the mode defined in the xml file')
mode = matchReg.group(1)
elif re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-eNBIPAddress=(.+)$', myArgv, re.IGNORECASE)
@@ -2467,6 +3187,18 @@ while len(argvs) > 1:
matchReg = re.match('^\-\-XMLTestFile=(.+)$', myArgv, re.IGNORECASE)
SSH.testXMLfiles.append(matchReg.group(1))
SSH.nbTestXMLfiles += 1
+ elif re.match('^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE):
+ matchReg = re.match('^\-\-UEIPAddress=(.+)$', myArgv, re.IGNORECASE)
+ SSH.UEIPAddress = matchReg.group(1)
+ elif re.match('^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE):
+ matchReg = re.match('^\-\-UEUserName=(.+)$', myArgv, re.IGNORECASE)
+ SSH.UEUserName = matchReg.group(1)
+ elif re.match('^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE):
+ matchReg = re.match('^\-\-UEPassword=(.+)$', myArgv, re.IGNORECASE)
+ SSH.UEPassword = matchReg.group(1)
+ elif re.match('^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE):
+ matchReg = re.match('^\-\-UESourceCodePath=(.+)$', myArgv, re.IGNORECASE)
+ SSH.UESourceCodePath = matchReg.group(1)
elif re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-finalStatus=(.+)$', myArgv, re.IGNORECASE)
finalStatus = matchReg.group(1)
@@ -2482,11 +3214,17 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE):
sys.exit('Insufficient Parameter')
SSH.TerminateeNB()
elif re.match('^TerminateUE$', mode, re.IGNORECASE):
- if SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '':
+ if (SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == ''):
Usage()
sys.exit('Insufficient Parameter')
signal.signal(signal.SIGUSR1, receive_signal)
SSH.TerminateUE()
+elif re.match('^TerminateOAIUE$', mode, re.IGNORECASE):
+ if SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == '':
+ Usage()
+ sys.exit('Insufficient Parameter')
+ signal.signal(signal.SIGUSR1, receive_signal)
+ SSH.TerminateOAIUE()
elif re.match('^TerminateHSS$', mode, re.IGNORECASE):
if SSH.EPCIPAddress == '' or SSH.EPCUserName == '' or SSH.EPCPassword == '' or SSH.EPCType == '' or SSH.EPCSourceCodePath == '':
Usage()
@@ -2503,7 +3241,7 @@ elif re.match('^TerminateSPGW$', mode, re.IGNORECASE):
sys.exit('Insufficient Parameter')
SSH.TerminateSPGW()
elif re.match('^LogCollectBuild$', mode, re.IGNORECASE):
- if SSH.eNBIPAddress == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '' or SSH.eNBSourceCodePath == '':
+ if (SSH.eNBIPAddress == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '' or SSH.eNBSourceCodePath == '') and (SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == '' or SSH.UESourceCodePath == ''):
Usage()
sys.exit('Insufficient Parameter')
SSH.LogCollectBuild()
@@ -2537,16 +3275,24 @@ elif re.match('^LogCollectIperf$', mode, re.IGNORECASE):
Usage()
sys.exit('Insufficient Parameter')
SSH.LogCollectIperf()
+elif re.match('^LogCollectOAIUE$', mode, re.IGNORECASE):
+ if SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == '' or SSH.UESourceCodePath == '':
+ Usage()
+ sys.exit('Insufficient Parameter')
+ SSH.LogCollectOAIUE()
elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
- if SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '':
+ if (SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == ''):
Usage()
sys.exit('Insufficient Parameter')
count = 0
foundCount = 0
while (count < SSH.nbTestXMLfiles):
- xml_test_file = sys.path[0] + "/" + SSH.testXMLfiles[count]
+ xml_test_file = cwd + "/" + SSH.testXMLfiles[count]
if (os.path.isfile(xml_test_file)):
- xmlTree = ET.parse(xml_test_file)
+ try:
+ xmlTree = ET.parse(xml_test_file)
+ except:
+ print("Error while parsing file: " + xml_test_file)
xmlRoot = xmlTree.getroot()
SSH.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-' + str(count)))
SSH.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-' + str(count)))
@@ -2558,20 +3304,33 @@ elif re.match('^InitiateHtml$', mode, re.IGNORECASE):
SSH.CreateHtmlHeader()
elif re.match('^FinalizeHtml$', mode, re.IGNORECASE):
SSH.CreateHtmlFooter(SSH.finalStatus)
-elif re.match('^TesteNB$', mode, re.IGNORECASE):
- if SSH.eNBIPAddress == '' or SSH.eNBRepository == '' or SSH.eNBBranch == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '' or SSH.eNBSourceCodePath == '' or SSH.EPCIPAddress == '' or SSH.EPCUserName == '' or SSH.EPCPassword == '' or SSH.EPCType == '' or SSH.EPCSourceCodePath == '' or SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '':
- Usage()
- sys.exit('Insufficient Parameter')
+elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE):
+ if re.match('^TesteNB$', mode, re.IGNORECASE):
+ if (SSH.eNBRepository == '' or SSH.eNBBranch == '' or SSH.eNBSourceCodePath == ''):
+ Usage()
+ sys.exit('Insufficient Parameter')
+ if (SSH.eNBIPAddress == '' or SSH.eNBUserName == '' or SSH.eNBPassword == '') and (SSH.UEIPAddress == '' or SSH.UEUserName == '' or SSH.UEPassword == ''):
+ Usage()
+ sys.exit('Insufficient Parameter')
+ elif SSH.ADBIPAddress == 'none' and SSH.EPCIPAddress == 'none':
+ pass
+ elif SSH.EPCIPAddress == '' or SSH.EPCUserName == '' or SSH.EPCPassword == '' or SSH.EPCType == '' or SSH.EPCSourceCodePath == '' or SSH.ADBIPAddress == '' or SSH.ADBUserName == '' or SSH.ADBPassword == '':
+ Usage()
+ sys.exit('Insufficient Parameter')
+ if (SSH.EPCIPAddress != ''):
+ SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, cwd + "/tcp_iperf_stats.awk", "/tmp")
+ SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, cwd + "/active_net_interfaces.awk", "/tmp")
+ else:
+ if SSH.UEIPAddress == '' or SSH.eNBRepository == '' or SSH.eNBBranch == '' or SSH.UEUserName == '' or SSH.UEPassword == '' or SSH.UESourceCodePath == '':
+ Usage()
+ sys.exit('UE: Insufficient Parameter')
- if (SSH.EPCIPAddress != 'none'):
- SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, sys.path[0] + "/tcp_iperf_stats.awk", "/tmp")
- SSH.copyout(SSH.EPCIPAddress, SSH.EPCUserName, SSH.EPCPassword, sys.path[0] + "/active_net_interfaces.awk", "/tmp")
#read test_case_list.xml file
# if no parameters for XML file, use default value
if (SSH.nbTestXMLfiles != 1):
- xml_test_file = sys.path[0] + "/test_case_list.xml"
+ xml_test_file = cwd + "/test_case_list.xml"
else:
- xml_test_file = sys.path[0] + "/" + SSH.testXMLfiles[0]
+ xml_test_file = cwd + "/" + SSH.testXMLfiles[0]
xmlTree = ET.parse(xml_test_file)
xmlRoot = xmlTree.getroot()
@@ -2627,6 +3386,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE):
SSH.testCase_id = id
SSH.desc = test.findtext('desc')
action = test.findtext('class')
+ mode = test.findtext('mode')
if (CheckClassValidity(action, id) == False):
continue
SSH.ShowTestID()
@@ -2648,6 +3408,14 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE):
SSH.AttachUE()
elif action == 'Detach_UE':
SSH.DetachUE()
+ elif action == 'Build_OAI_UE':
+ SSH.BuildOAIUE()
+ elif action == 'Initialize_OAI_UE':
+ SSH.InitializeOAIUE()
+ elif action == 'Terminate_OAI_UE':
+ SSH.TerminateOAIUE()
+ elif action == 'Initialize_OAI_eNB':
+ SSH.InitializeOAIeNB()
elif action == 'Initialize_CatM_module':
SSH.InitializeCatM()
elif action == 'Terminate_CatM_module':
@@ -2656,6 +3424,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE):
SSH.AttachCatM()
elif action == 'Detach_CatM_module':
SSH.TerminateCatM()
+ elif action == 'Ping_CatM_module':
+ SSH.PingCatM()
elif action == 'Ping':
SSH.Ping()
elif action == 'Iperf':
diff --git a/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml b/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml
new file mode 100644
index 0000000000..c8cf457c71
--- /dev/null
+++ b/ci-scripts/xml_files/gnb_nr_ue_usrp_run.xml
@@ -0,0 +1,64 @@
+
+
+ run OAI gNB and OAI NR UE USRP
+ run-OAI-gNB-NR-UE-USRP
+ tasks
+
+090101 000001 090102 000001 090108 090109
+
+
+
+
+ Initialize_OAI_eNB
+ Initialize gNB USRP
+ -O ../../../ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
+ NR
+
+
+
+ IdleSleep
+ Sleep
+ 5
+
+
+
+ Initialize_OAI_UE
+ Initialize NR UE USRP
+ -C 3510000000 --numerology 1 -r 106 --phy-test --usrp-args "addr=192.168.30.2,clock_source=external,time_source=external" --threadoffset 16
+ NR
+
+
+
+ Terminate_OAI_UE
+ Terminate NR UE
+ NR
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ NR
+
+
+
diff --git a/ci-scripts/xml_files/gnb_usrp_build.xml b/ci-scripts/xml_files/gnb_usrp_build.xml
new file mode 100644
index 0000000000..91db988fd8
--- /dev/null
+++ b/ci-scripts/xml_files/gnb_usrp_build.xml
@@ -0,0 +1,39 @@
+
+
+ build-tab
+ Build-gNB
+ wrench
+
+010101
+
+
+
+
+ TesteNB
+ Build_eNB
+ Build gNB (USRP)
+ --gNB -w USRP
+
+
+
diff --git a/ci-scripts/xml_files/nr_ue_usrp_build.xml b/ci-scripts/xml_files/nr_ue_usrp_build.xml
new file mode 100644
index 0000000000..63c4d4f58b
--- /dev/null
+++ b/ci-scripts/xml_files/nr_ue_usrp_build.xml
@@ -0,0 +1,40 @@
+
+
+ build-tab
+ Build-NR-UE
+ wrench
+
+010102
+
+
+
+
+ TestUE
+ Build_OAI_UE
+ Build NR UE (USRP)
+ --nrUE -w USRP
+ false
+
+
+
diff --git a/targets/RT/USER/nr-softmodem.c b/targets/RT/USER/nr-softmodem.c
index 5561258694..1495d8b1f1 100644
--- a/targets/RT/USER/nr-softmodem.c
+++ b/targets/RT/USER/nr-softmodem.c
@@ -1237,6 +1237,8 @@ int main( int argc, char **argv )
// wait for end of program
printf("TYPE TO TERMINATE\n");
+ fflush(stdout);
+ fflush(stderr);
//getchar();
#if defined(ENABLE_ITTI)