Commit ebd40e8d authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

Merge branch 'develop_integration_2019_w21' into 'develop'

See merge request oai/openairinterface5g!595

The following Merge Requests are included:

* MR 544: RRC Inactivity Timer testing
* MR 581: Remove deprecated build options
* MR 583: RRC: add an option to enable measurement reports
* MR 590: bugfix UE realtime bug
parents dfd5f316 afdeaa63
...@@ -360,6 +360,8 @@ eNBs = ...@@ -360,6 +360,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -141,6 +141,8 @@ eNBs = ...@@ -141,6 +141,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -141,6 +141,8 @@ eNBs = ...@@ -141,6 +141,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -141,6 +141,8 @@ eNBs = ...@@ -141,6 +141,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -178,6 +178,8 @@ eNBs = ...@@ -178,6 +178,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -18,6 +18,9 @@ eNBs = ...@@ -18,6 +18,9 @@ eNBs =
tr_s_preference = "local_mac" tr_s_preference = "local_mac"
// In seconds
rrc_inactivity_threshold = 30;
////////// Physical parameters: ////////// Physical parameters:
component_carriers = ( component_carriers = (
...@@ -178,6 +181,8 @@ eNBs = ...@@ -178,6 +181,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
...@@ -241,8 +246,8 @@ THREAD_STRUCT = ( ...@@ -241,8 +246,8 @@ THREAD_STRUCT = (
NETWORK_CONTROLLER : NETWORK_CONTROLLER :
{ {
FLEXRAN_ENABLED = "no"; FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo"; FLEXRAN_INTERFACE_NAME = "eth0";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR";
FLEXRAN_PORT = 2210; FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no"; FLEXRAN_AWAIT_RECONF = "no";
......
...@@ -186,6 +186,8 @@ eNBs = ...@@ -186,6 +186,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -181,6 +181,8 @@ eNBs = ...@@ -181,6 +181,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -178,6 +178,8 @@ eNBs = ...@@ -178,6 +178,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -141,6 +141,8 @@ eNBs = ...@@ -141,6 +141,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -144,6 +144,8 @@ eNBs = ...@@ -144,6 +144,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -144,6 +144,8 @@ eNBs = ...@@ -144,6 +144,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -144,6 +144,8 @@ eNBs = ...@@ -144,6 +144,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -181,6 +181,8 @@ eNBs = ...@@ -181,6 +181,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -181,6 +181,8 @@ eNBs = ...@@ -181,6 +181,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -181,6 +181,8 @@ eNBs = ...@@ -181,6 +181,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
...@@ -179,6 +179,8 @@ eNBs = ...@@ -179,6 +179,8 @@ eNBs =
} }
); );
enable_measurement_reports = "no";
///X2 ///X2
enable_x2 = "no"; enable_x2 = "no";
t_reloc_prep = 1000; /* unit: millisecond */ t_reloc_prep = 1000; /* unit: millisecond */
......
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with # * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership. # * this work for additional information regarding copyright ownership.
...@@ -144,6 +145,9 @@ class SSHConnection(): ...@@ -144,6 +145,9 @@ class SSHConnection():
self.UELogFile = '' self.UELogFile = ''
self.Build_OAI_UE_args = '' self.Build_OAI_UE_args = ''
self.Initialize_OAI_UE_args = '' self.Initialize_OAI_UE_args = ''
self.flexranCtrlInstalled = False
self.flexranCtrlStarted = False
self.expectedNbOfConnectedUEs = 0
def open(self, ipaddress, username, password): def open(self, ipaddress, username, password):
count = 0 count = 0
...@@ -461,6 +465,37 @@ class SSHConnection(): ...@@ -461,6 +465,37 @@ class SSHConnection():
self.close() self.close()
self.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK) self.CreateHtmlTestRow(self.EPCType, 'OK', ALL_PROCESSES_OK)
def CheckFlexranCtrlInstallation(self):
if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '':
return
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('ls -ls /opt/flexran_rtc/*/rt_controller', '\$', 5)
result = re.search('/opt/flexran_rtc/build/rt_controller', str(self.ssh.before))
if result is not None:
self.flexranCtrlInstalled = True
logging.debug('Flexran Controller is installed')
self.close()
def InitializeFlexranCtrl(self):
if self.flexranCtrlInstalled == False:
return
if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '':
Usage()
sys.exit('Insufficient Parameter')
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('cd /opt/flexran_rtc', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f log/*.log', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S echo "build/rt_controller -c log_config/basic_log" > ./my-flexran-ctl.sh', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S chmod 755 ./my-flexran-ctl.sh', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --unsafe --name=flexran_rtc_daemon --chdir=/opt/flexran_rtc -o /opt/flexran_rtc/log/flexranctl_' + self.testCase_id + '.log ././my-flexran-ctl.sh', '\$', 5)
self.command('ps -aux | grep --color=never rt_controller', '\$', 5)
result = re.search('rt_controller -c ', str(self.ssh.before))
if result is not None:
logging.debug('\u001B[1m Initialize FlexRan Controller Completed\u001B[0m')
self.flexranCtrlStarted = True
self.close()
self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK)
def InitializeeNB(self): def InitializeeNB(self):
if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '':
Usage() Usage()
...@@ -524,6 +559,10 @@ class SSHConnection(): ...@@ -524,6 +559,10 @@ class SSHConnection():
self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5)
self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2); self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2);
self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); self.command('sed -i -e \'s/CI_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2);
if self.flexranCtrlInstalled and self.flexranCtrlStarted:
self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "yes";/\' ' + ci_full_config_file, '\$', 2);
else:
self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/\' ' + ci_full_config_file, '\$', 2);
# Launch eNB with the modified config file # Launch eNB with the modified config file
self.command('source oaienv', '\$', 5) self.command('source oaienv', '\$', 5)
self.command('cd cmake_targets', '\$', 5) self.command('cd cmake_targets', '\$', 5)
...@@ -591,6 +630,9 @@ class SSHConnection(): ...@@ -591,6 +630,9 @@ class SSHConnection():
logging.debug('send adb commands') logging.debug('send adb commands')
try: try:
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
# enable data service
self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data enable', '\$', 60)
# The following commands are deprecated since we no longer work on Android 7+ # The following commands are deprecated since we no longer work on Android 7+
# self.command('stdbuf -o0 adb -s ' + device_id + ' shell settings put global airplane_mode_on 1', '\$', 10) # self.command('stdbuf -o0 adb -s ' + device_id + ' shell settings put global airplane_mode_on 1', '\$', 10)
# self.command('stdbuf -o0 adb -s ' + device_id + ' shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true', '\$', 60) # self.command('stdbuf -o0 adb -s ' + device_id + ' shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true', '\$', 60)
...@@ -1172,6 +1214,54 @@ class SSHConnection(): ...@@ -1172,6 +1214,54 @@ class SSHConnection():
job.join() job.join()
self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK)
def DataDisableUE_common(self, device_id):
try:
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
# enable data service
self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data disable', '\$', 60)
logging.debug('\u001B[1mUE (' + device_id + ') Disabled Data Service\u001B[0m')
self.close()
except:
os.kill(os.getppid(),signal.SIGUSR1)
def DataDisableUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
Usage()
sys.exit('Insufficient Parameter')
multi_jobs = []
for device_id in self.UEDevices:
p = Process(target = self.DataDisableUE_common, args = (device_id,))
p.daemon = True
p.start()
multi_jobs.append(p)
for job in multi_jobs:
job.join()
self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK)
def DataEnableUE_common(self, device_id):
try:
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
# enable data service
self.command('stdbuf -o0 adb -s ' + device_id + ' shell svc data enable', '\$', 60)
logging.debug('\u001B[1mUE (' + device_id + ') Enabled Data Service\u001B[0m')
self.close()
except:
os.kill(os.getppid(),signal.SIGUSR1)
def DataEnableUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
Usage()
sys.exit('Insufficient Parameter')
multi_jobs = []
for device_id in self.UEDevices:
p = Process(target = self.DataEnableUE_common, args = (device_id,))
p.daemon = True
p.start()
multi_jobs.append(p)
for job in multi_jobs:
job.join()
self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK)
def GetAllUEDevices(self, terminate_ue_flag): def GetAllUEDevices(self, terminate_ue_flag):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
Usage() Usage()
...@@ -1198,6 +1288,118 @@ class SSHConnection(): ...@@ -1198,6 +1288,118 @@ class SSHConnection():
sys.exit(1) sys.exit(1)
self.close() self.close()
def CheckUEStatus_common(self, lock, device_id, statusQueue):
try:
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
self.command('stdbuf -o0 adb -s ' + device_id + ' shell dumpsys telephony.registry', '\$', 15)
result = re.search('mServiceState=(?P<serviceState>[0-9]+)', str(self.ssh.before))
serviceState = 'Service State: UNKNOWN'
if result is not None:
lServiceState = int(result.group('serviceState'))
if lServiceState == 3:
serviceState = 'Service State: RADIO_POWERED_OFF'
if lServiceState == 1:
serviceState = 'Service State: OUT_OF_SERVICE'
if lServiceState == 0:
serviceState = 'Service State: IN_SERVICE'
if lServiceState == 2:
serviceState = 'Service State: EMERGENCY_ONLY'
result = re.search('mDataConnectionState=(?P<dataConnectionState>[0-9]+)', str(self.ssh.before))
dataConnectionState = 'Data State: UNKNOWN'
if result is not None:
lDataConnectionState = int(result.group('dataConnectionState'))
if lDataConnectionState == 0:
dataConnectionState = 'Data State: DISCONNECTED'
if lDataConnectionState == 1:
dataConnectionState = 'Data State: CONNECTING'
if lDataConnectionState == 2:
dataConnectionState = 'Data State: CONNECTED'
if lDataConnectionState == 3:
dataConnectionState = 'Data State: SUSPENDED'
result = re.search('mDataConnectionReason=(?P<dataConnectionReason>[0-9a-zA-Z_]+)', str(self.ssh.before))
dataConnectionReason = 'Data Reason: UNKNOWN'
if result is not None:
dataConnectionReason = 'Data Reason: ' + result.group('dataConnectionReason')
lock.acquire()
logging.debug('\u001B[1;37;44m Status Check (' + str(device_id) + ') \u001B[0m')
logging.debug('\u001B[1;34m ' + serviceState + '\u001B[0m')
logging.debug('\u001B[1;34m ' + dataConnectionState + '\u001B[0m')
logging.debug('\u001B[1;34m ' + dataConnectionReason + '\u001B[0m')
statusQueue.put(0)
statusQueue.put(device_id)
qMsg = serviceState + '\n' + dataConnectionState + '\n' + dataConnectionReason
statusQueue.put(qMsg)
lock.release()
self.close()
except:
os.kill(os.getppid(),signal.SIGUSR1)
def CheckStatusUE(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
Usage()
sys.exit('Insufficient Parameter')
check_eNB = True
check_OAI_UE = False
pStatus = self.CheckProcessExist(check_eNB, check_OAI_UE)
if (pStatus < 0):
self.CreateHtmlTestRow('N/A', 'KO', pStatus)
self.CreateHtmlTabFooter(False)
sys.exit(1)
multi_jobs = []
lock = Lock()
status_queue = SimpleQueue()
for device_id in self.UEDevices:
p = Process(target = self.CheckUEStatus_common, args = (lock,device_id,status_queue,))
p.daemon = True
p.start()
multi_jobs.append(p)
for job in multi_jobs:
job.join()
if self.flexranCtrlInstalled and self.flexranCtrlStarted:
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
self.command('cd /opt/flexran_rtc', '\$', 5)
self.command('curl http://localhost:9999/stats | jq \'.\' > log/check_status_' + self.testCase_id + '.log 2>&1', '\$', 5)
self.command('cat log/check_status_' + self.testCase_id + '.log | jq \'.eNB_config[0].UE\' | grep -c rnti | sed -e "s#^#Nb Connected UE = #"', '\$', 5)
result = re.search('Nb Connected UE = (?P<nb_ues>[0-9]+)', str(self.ssh.before))
passStatus = True
if result is not None:
nb_ues = int(result.group('nb_ues'))
htmlOptions = 'Nb Connected UE(s) to eNB = ' + str(nb_ues)
logging.debug('\u001B[1;37;44m ' + htmlOptions + ' \u001B[0m')
if self.expectedNbOfConnectedUEs > -1:
if nb_ues != self.expectedNbOfConnectedUEs:
passStatus = False
else:
htmlOptions = 'N/A'
self.close()
else:
passStatus = True
htmlOptions = 'N/A'
if (status_queue.empty()):
self.CreateHtmlTestRow(htmlOptions, 'KO', ALL_PROCESSES_OK)
self.AutoTerminateUEandeNB()
self.CreateHtmlTabFooter(False)
sys.exit(1)
else:
check_status = True
html_queue = SimpleQueue()
while (not status_queue.empty()):
count = status_queue.get()
if (count < 0):
check_status = False
device_id = status_queue.get()
message = status_queue.get()
html_cell = '<pre style="background-color:white">UE (' + device_id + ')\n' + message + '</pre>'
html_queue.put(html_cell)
if check_status and passStatus:
self.CreateHtmlTestRowQueue(htmlOptions, 'OK', len(self.UEDevices), html_queue)
else:
self.CreateHtmlTestRowQueue(htmlOptions, 'KO', len(self.UEDevices), html_queue)
self.AutoTerminateUEandeNB()
self.CreateHtmlTabFooter(False)
sys.exit(1)
def GetAllUEIPAddresses(self): def GetAllUEIPAddresses(self):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
Usage() Usage()
...@@ -1320,6 +1522,12 @@ class SSHConnection(): ...@@ -1320,6 +1522,12 @@ class SSHConnection():
except: except:
os.kill(os.getppid(),signal.SIGUSR1) os.kill(os.getppid(),signal.SIGUSR1)
def PingNoS1_wrong_exit(self, qMsg):
html_queue = SimpleQueue()
html_cell = '<pre style="background-color:white">OAI UE ping result\n' + qMsg + '</pre>'
html_queue.put(html_cell)
self.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue)
def PingNoS1(self): def PingNoS1(self):
check_eNB = True check_eNB = True
check_OAI_UE = True check_OAI_UE = True
...@@ -1352,21 +1560,25 @@ class SSHConnection(): ...@@ -1352,21 +1560,25 @@ class SSHConnection():
if ping_status < 0: if ping_status < 0:
message = 'Ping with OAI UE crashed due to TIMEOUT!' message = 'Ping with OAI UE crashed due to TIMEOUT!'
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
self.PingNoS1_wrong_exit(message)
return return
result = re.search(', (?P<packetloss>[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before)) result = re.search(', (?P<packetloss>[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before))
if result is None: if result is None:
message = 'Packet Loss Not Found!' message = 'Packet Loss Not Found!'
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
self.PingNoS1_wrong_exit(message)
return return
packetloss = result.group('packetloss') packetloss = result.group('packetloss')
if float(packetloss) == 100: if float(packetloss) == 100:
message =<