From 9b7367c0ce3f4ba19a2916ddf7f6c8bb121ad4f1 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 19 Mar 2019 17:52:14 +0100 Subject: [PATCH 1/6] Adding a parameter in configuration file to enable RRC Inactivity timers -- rrc_inactivity_threshold in seconds Adding support in CI to test it -- disable/enable data service on UEs -- no automatic check yet on the UE status certainly should be done w/ a Flexran controller command Signed-off-by: Raphael Defosseux --- .../enb.band7.tm1.25PRB.usrpb210.conf | 3 + ci-scripts/main.py | 126 +++++++++++++++++- .../enb_usrp210_band7_test_05mhz_tm1.xml | 41 +++++- openair2/ENB_APP/enb_config.c | 6 +- openair2/ENB_APP/enb_paramdef.h | 5 + 5 files changed, 175 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index a0d3ba6d06..808a01fc54 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -18,6 +18,9 @@ eNBs = tr_s_preference = "local_mac" + // In seconds + rrc_inactivity_threshold = 30; + ////////// Physical parameters: component_carriers = ( diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5b1dfd8901..5177e3f57c 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -509,6 +509,9 @@ class SSHConnection(): logging.debug('send adb commands') 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) + # 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 am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true', '\$', 60) @@ -963,6 +966,54 @@ class SSHConnection(): job.join() 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): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() @@ -989,6 +1040,68 @@ class SSHConnection(): sys.exit(1) self.close() + def CheckUEStatus_common(self, lock, device_id, statusQueue): + try: + self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + lock.acquire() + logging.debug('\u001B[1;37;44m Status Check (' + str(device_id) + ') \u001B[0m') + #logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m') + #logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') + #logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') + #logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') + statusQueue.put(0) + statusQueue.put(device_id) + statusQueue.put('Nothing for the moment') + 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') + initialize_eNB_flag = False + pStatus = self.CheckProcessExist(initialize_eNB_flag) + 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 (status_queue.empty()): + self.CreateHtmlTestRow('N/A', '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 = '
UE (' + device_id + ')\n' + message + '
' + html_queue.put(html_cell) + if (check_status): + self.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue) + else: + self.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue) + self.AutoTerminateUEandeNB() + self.CreateHtmlTabFooter(False) + sys.exit(1) + def GetAllUEIPAddresses(self): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() @@ -1795,7 +1908,7 @@ class SSHConnection(): result = re.search('LTE_RRCConnectionSetupComplete from UE', str(line)) if result is not None: rrcSetupComplete += 1 - result = re.search('Generate LTE_RRCConnectionRelease', str(line)) + result = re.search('Generate LTE_RRCConnectionRelease|Generate RRCConnectionRelease', str(line)) if result is not None: rrcReleaseRequest += 1 result = re.search('Generate LTE_RRCConnectionReconfiguration', str(line)) @@ -2006,6 +2119,7 @@ class SSHConnection(): def TerminateUE_common(self, device_id): try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) + # back in airplane mode on (ie radio off) self.command('stdbuf -o0 adb -s ' + device_id + ' shell /data/local/tmp/off', '\$', 60) logging.debug('\u001B[1mUE (' + device_id + ') Detach Completed\u001B[0m') @@ -2493,7 +2607,7 @@ def Usage(): print('------------------------------------------------------------') 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 != 'Ping_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 != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' 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 @@ -2793,7 +2907,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): continue SSH.ShowTestID() GetParametersFromXML(action) - if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE': + if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE' or action == 'DataDisable_UE' or action == 'DataEnable_UE' or action == 'CheckStatusUE': terminate_ue_flag = False SSH.GetAllUEDevices(terminate_ue_flag) if action == 'Build_eNB': @@ -2810,6 +2924,12 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): SSH.AttachUE() elif action == 'Detach_UE': SSH.DetachUE() + elif action == 'DataDisable_UE': + SSH.DataDisableUE() + elif action == 'DataEnable_UE': + SSH.DataEnableUE() + elif action == 'CheckStatusUE': + SSH.CheckStatusUE() elif action == 'Initialize_CatM_module': SSH.InitializeCatM() elif action == 'Terminate_CatM_module': diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index 0057eaefa4..017b39454e 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -26,10 +26,32 @@ tasks 040101 - 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + 030101 040301 040501 000010 040302 000001 000011 040303 000002 040502 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + + IdleSleep + Waiting for 35 seconds + 35 + + + + IdleSleep + Waiting for 5 seconds + 5 + + + + CheckStatusUE + Check UE(s) status before data disabling + + + + CheckStatusUE + Check UE(s) status after data disabling + + Initialize_eNB Initialize eNB (FDD/Band7/5MHz) @@ -61,6 +83,16 @@ Detach UE + + DataDisable_UE + Disabling Data Service on UE + + + + DataEnable_UE + Enabling Data Service on UE + + Ping ping (5MHz - 20 sec) @@ -68,6 +100,13 @@ 5 + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + Iperf iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 6556a34e7b..e85fe5ac89 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -54,7 +54,7 @@ #include "RRC_config_tools.h" #include "enb_paramdef.h" -#define RRC_INACTIVITY_THRESH 0 +//#define RRC_INACTIVITY_THRESH 0 extern uint16_t sf_ahead; extern void set_parallel_conf(char *parallel_conf); @@ -428,7 +428,9 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I) PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]); - RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = RRC_INACTIVITY_THRESH; // set to 0 to deactivate + //RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = RRC_INACTIVITY_THRESH; // set to 0 to deactivate + // In the configuration file it is in seconds. For RRC it has to be in milliseconds + RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = (*ENBParamList.paramarray[i][ENB_RRC_INACTIVITY_THRES_IDX].uptr) * 1000; RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id; RRC_CONFIGURATION_REQ (msg_p).tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr; AssertFatal(!ENBParamList.paramarray[i][ENB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index b44ec9de16..04c8795a2a 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -197,6 +197,7 @@ typedef enum { #define ENB_CONFIG_STRING_REMOTE_S_PORTC "remote_s_portc" #define ENB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" #define ENB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" +#define ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD "rrc_inactivity_threshold" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ @@ -217,6 +218,7 @@ typedef enum { {ENB_CONFIG_STRING_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {ENB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ +{ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \ } #define ENB_ENB_ID_IDX 0 #define ENB_CELL_TYPE_IDX 1 @@ -232,6 +234,8 @@ typedef enum { #define ENB_REMOTE_S_PORTC_IDX 11 #define ENB_LOCAL_S_PORTD_IDX 12 #define ENB_REMOTE_S_PORTD_IDX 13 +#define ENB_RRC_INACTIVITY_THRES_IDX 14 + #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define ENBPARAMS_CHECK { \ @@ -249,6 +253,7 @@ typedef enum { { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ { .s5 = { NULL } }, \ + { .s5 = { NULL } }, \ } /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ From 5d82287fa5b5a543901185217c150664eb7ddb6f Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 20 Mar 2019 21:47:56 +0100 Subject: [PATCH 2/6] CI: fully testing RRC Inactivity timers -- Connecting eNB to a Flexran Ctrler -- Checking eNB status for UEs through flexran Signed-off-by: Raphael Defosseux --- .../enb.band7.tm1.25PRB.usrpb210.conf | 6 +- ci-scripts/main.py | 95 +++++++++++++++++-- .../enb_usrp210_band7_test_05mhz_tm1.xml | 36 ++++++- 3 files changed, 127 insertions(+), 10 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index 808a01fc54..f7ca1ef0b6 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -243,9 +243,9 @@ THREAD_STRUCT = ( NETWORK_CONTROLLER : { - FLEXRAN_ENABLED = "no"; - FLEXRAN_INTERFACE_NAME = "lo"; - FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_ENABLED = "yes"; + FLEXRAN_INTERFACE_NAME = "eth0"; + FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR"; FLEXRAN_PORT = 2210; FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_AWAIT_RECONF = "no"; diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5177e3f57c..79991dd2d1 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -129,6 +129,9 @@ class SSHConnection(): self.eNBCpuNb = '' self.eNBCpuModel = '' self.eNBCpuMHz = '' + self.flexranCtrlInstalled = False + self.flexranCtrlStarted = False + self.expectedNbOfConnectedUEs = 0 def open(self, ipaddress, username, password): count = 0 @@ -388,6 +391,37 @@ class SSHConnection(): self.close() 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): if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': Usage() @@ -449,6 +483,8 @@ class SSHConnection(): 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_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); + if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False: + self.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/\' ' + ci_full_config_file, '\$', 2); # Launch eNB with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets', '\$', 5) @@ -1077,9 +1113,28 @@ class SSHConnection(): 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[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(htmlOptions) + if self.expectedNbOfConnectedUEs > -1: + if nb_ues != self.expectedNbOfConnectedUEs: + passStatus = False + else: + htmlOptions = 'N/A' + self.close() + else: + htmlOptions = 'N/A' if (status_queue.empty()): - self.CreateHtmlTestRow('N/A', 'KO', ALL_PROCESSES_OK) + self.CreateHtmlTestRow(htmlOptions, 'KO', ALL_PROCESSES_OK) self.AutoTerminateUEandeNB() self.CreateHtmlTabFooter(False) sys.exit(1) @@ -1094,10 +1149,10 @@ class SSHConnection(): message = status_queue.get() html_cell = '
UE (' + device_id + ')\n' + message + '
' html_queue.put(html_cell) - if (check_status): - self.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue) + if check_status and passStatus: + self.CreateHtmlTestRowQueue(htmlOptions, 'OK', len(self.UEDevices), html_queue) else: - self.CreateHtmlTestRowQueue('N/A', 'KO', len(self.UEDevices), html_queue) + self.CreateHtmlTestRowQueue(htmlOptions, 'KO', len(self.UEDevices), html_queue) self.AutoTerminateUEandeNB() self.CreateHtmlTabFooter(False) sys.exit(1) @@ -1785,6 +1840,8 @@ class SSHConnection(): logStatus = self.AnalyzeLogFile_eNB(self.eNBLogFile) if logStatus < 0: result = logStatus + if self.flexranCtrlInstalled and self.flexranCtrlStarted: + self.TerminateFlexranCtrl() return result def CheckeNBProcess(self, status_queue): @@ -2079,7 +2136,6 @@ class SSHConnection(): else: self.command('cd ' + self.EPCSourceCodePath, '\$', 5) self.command('cd scripts', '\$', 5) - self.command('rm -f ./kill_hss.sh', '\$', 5) self.command('echo ' + self.EPCPassword + ' | sudo -S daemon --name=simulated_hss --stop', '\$', 5) time.sleep(1) self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL hss_sim', '\$', 5) @@ -2116,6 +2172,21 @@ class SSHConnection(): self.close() self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def TerminateFlexranCtrl(self): + if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == 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('echo ' + self.EPCPassword + ' | sudo -S daemon --name=flexran_rtc_daemon --stop', '\$', 5) + time.sleep(1) + self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL rt_controller', '\$', 5) + time.sleep(1) + self.close() + self.flexranCtrlStarted = False + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) + def TerminateUE_common(self, device_id): try: self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) @@ -2607,7 +2678,7 @@ def Usage(): print('------------------------------------------------------------') 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 != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' 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': + 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 != 'DataDisable_UE' and action != 'DataEnable_UE' and action != 'CheckStatusUE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_FlexranCtrl' and action != 'Terminate_FlexranCtrl' 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 @@ -2634,6 +2705,13 @@ def GetParametersFromXML(action): else: SSH.nbMaxUEtoAttach = int(nbMaxUEtoAttach) + if action == 'CheckStatusUE': + expectedNBUE = test.findtext('expectedNbOfConnectedUEs') + if (expectedNBUE is None): + SSH.expectedNbOfConnectedUEs = -1 + else: + SSH.expectedNbOfConnectedUEs = int(expectedNBUE) + if action == 'Ping' or action == 'Ping_CatM_module': SSH.ping_args = test.findtext('ping_args') SSH.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold') @@ -2881,6 +2959,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): else: logging.debug('ERROR: requested test is invalidly formatted: ' + test) sys.exit(1) + SSH.CheckFlexranCtrlInstallation() #get the list of tests to be done todo_tests=[] @@ -2958,6 +3037,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE): SSH.InitializeSPGW() elif action == 'Terminate_SPGW': SSH.TerminateSPGW() + elif action == 'Initialize_FlexranCtrl': + SSH.InitializeFlexranCtrl() + elif action == 'Terminate_FlexranCtrl': + SSH.TerminateFlexranCtrl() elif action == 'IdleSleep': SSH.IdleSleep() else: diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index 017b39454e..bbdc56be4b 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -26,7 +26,10 @@ tasks 040101 - 030101 040301 040501 000010 040302 000001 000011 040303 000002 040502 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 + 050102 + 030102 040301 040502 000010 040302 000001 000011 040303 000002 000012 040503 040401 040201 030201 + 050202 @@ -45,11 +48,29 @@ CheckStatusUE Check UE(s) status before data disabling + 2 CheckStatusUE Check UE(s) status after data disabling + 0 + + + + CheckStatusUE + Check UE(s) status after data re-enabling + 2 + + + + Initialize_FlexranCtrl + Starting Flexran Controller + + + + Terminate_FlexranCtrl + Stopping Flexran Controller @@ -58,6 +79,12 @@ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Initialize_eNB + Initialize eNB (FDD/Band7/5MHz) + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Terminate_eNB Terminate eNB @@ -107,6 +134,13 @@ 5 + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + Iperf iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) From 8bd3075a3bd222dc4129e25d442f15846f41df05 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 21 Mar 2019 16:18:16 +0100 Subject: [PATCH 3/6] CI: more details on the UE status Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 41 ++++++++++++++++--- .../enb_usrp210_band7_test_05mhz_tm1.xml | 12 ++++-- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 79991dd2d1..5f737361ac 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1079,15 +1079,44 @@ class SSHConnection(): 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[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[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[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 ' + pal_msg + '\u001B[0m') - #logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') - #logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') - #logging.debug('\u001B[1;34m ' + max_msg + '\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) - statusQueue.put('Nothing for the moment') + qMsg = serviceState + '\n' + dataConnectionState + '\n' + dataConnectionReason + statusQueue.put(qMsg) lock.release() self.close() except: @@ -1123,7 +1152,7 @@ class SSHConnection(): if result is not None: nb_ues = int(result.group('nb_ues')) htmlOptions = 'Nb Connected UE(s) to eNB = ' + str(nb_ues) - logging.debug(htmlOptions) + logging.debug('\u001B[1;37;44m ' + htmlOptions + ' \u001B[0m') if self.expectedNbOfConnectedUEs > -1: if nb_ues != self.expectedNbOfConnectedUEs: passStatus = False diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index bbdc56be4b..63b96d7744 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -28,7 +28,7 @@ 040101 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 050102 - 030102 040301 040502 000010 040302 000001 000011 040303 000002 000012 040503 040401 040201 030201 + 030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201 050202 @@ -46,18 +46,24 @@ + CheckStatusUE + Check UE(s) status before attachment + 0 + + + CheckStatusUE Check UE(s) status before data disabling 2 - + CheckStatusUE Check UE(s) status after data disabling 0 - + CheckStatusUE Check UE(s) status after data re-enabling 2 From c153ee12044a4e5019ac58489dabd2412f735819 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 16 Apr 2019 10:33:17 +0200 Subject: [PATCH 4/6] CI: fix after bad merge in main.py Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 0395ed84b8..ab2ffc6606 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -1246,8 +1246,9 @@ class SSHConnection(): if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': Usage() sys.exit('Insufficient Parameter') - initialize_eNB_flag = False - pStatus = self.CheckProcessExist(initialize_eNB_flag) + 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) @@ -3731,7 +3732,6 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re SSH.ShowTestID() GetParametersFromXML(action) if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE' or action == 'DataDisable_UE' or action == 'DataEnable_UE' or action == 'CheckStatusUE': - if action == 'Initialize_UE' or action == 'Attach_UE' or action == 'Detach_UE' or action == 'Ping' or action == 'Iperf' or action == 'Reboot_UE': if (SSH.ADBIPAddress != 'none'): terminate_ue_flag = False SSH.GetAllUEDevices(terminate_ue_flag) From 24b46f3f020ca5f59033199b1a38fd0bbc26294d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 19 Apr 2019 12:17:02 +0200 Subject: [PATCH 5/6] CI: running the RRC Inactivity Timer scenarion first once without flexran controller Signed-off-by: Raphael Defosseux --- .../enb.band7.tm1.25PRB.usrpb210.conf | 2 +- ci-scripts/main.py | 5 +- .../enb_usrp210_band7_test_05mhz_tm1.xml | 51 +++++++++++++++++-- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index f7ca1ef0b6..c895151981 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -243,7 +243,7 @@ THREAD_STRUCT = ( NETWORK_CONTROLLER : { - FLEXRAN_ENABLED = "yes"; + FLEXRAN_ENABLED = "no"; FLEXRAN_INTERFACE_NAME = "eth0"; FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR"; FLEXRAN_PORT = 2210; diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ab2ffc6606..89c022e772 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -535,7 +535,9 @@ class SSHConnection(): 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_ENB_IP_ADDR/' + self.eNBIPAddress + '/\' ' + ci_full_config_file, '\$', 2); - if self.flexranCtrlInstalled == False or self.flexranCtrlStarted == False: + 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 self.command('source oaienv', '\$', 5) @@ -1281,6 +1283,7 @@ class SSHConnection(): htmlOptions = 'N/A' self.close() else: + passStatus = True htmlOptions = 'N/A' if (status_queue.empty()): diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml index 63b96d7744..c9dd913309 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +++ b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1.xml @@ -27,8 +27,9 @@ 040101 030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201 - 050102 030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201 + 050102 + 030102 000020 040301 040504 000021 040302 000001 000022 040303 000002 040504 000023 040401 040201 030201 050202 @@ -41,8 +42,8 @@ IdleSleep - Waiting for 5 seconds - 5 + Waiting for 10 seconds + 10 @@ -69,6 +70,30 @@ 2 + + CheckStatusUE + Check UE(s) status before attachment + 0 + + + + CheckStatusUE + Check UE(s) status before data disabling + 2 + + + + CheckStatusUE + Check UE(s) status after data disabling + 0 + + + + CheckStatusUE + Check UE(s) status after data re-enabling + 2 + + Initialize_FlexranCtrl Starting Flexran Controller @@ -91,6 +116,12 @@ -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Initialize_eNB + Initialize eNB (FDD/Band7/5MHz) + -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf + + Terminate_eNB Terminate eNB @@ -147,6 +178,20 @@ 5 + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + Iperf iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile) From aceb3a83ea565bff52333b5fa8f1eeeaf1134e8e Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 16 May 2019 15:54:03 +0200 Subject: [PATCH 6/6] Hack to break infinite loop when UE is released during RRC inactivity timeout Signed-off-by: Raphael Defosseux --- openair2/RRC/LTE/rrc_eNB_S1AP.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index b26e2c1cb0..6357bcfc64 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -257,23 +257,28 @@ rrc_eNB_S1AP_get_ue_ids( } if (ue_desc_p != NULL) { - result = rrc_eNB_S1AP_get_ue_ids(rrc_instance_pP, ue_desc_p->ue_initial_id, eNB_ue_s1ap_id); + if (ue_desc_p->ue_initial_id != UE_INITIAL_ID_INVALID) { + result = rrc_eNB_S1AP_get_ue_ids(rrc_instance_pP, ue_desc_p->ue_initial_id, eNB_ue_s1ap_id); - if (result != NULL) { - ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instance)], result->ue_rnti); + if (result != NULL) { + ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instance)], result->ue_rnti); - if ((ue_context_p != NULL) && (ue_context_p->ue_context.eNB_ue_s1ap_id == 0)) { - ue_context_p->ue_context.eNB_ue_s1ap_id = eNB_ue_s1ap_id; - } else { - LOG_E(RRC, "[eNB %ld] Incoherence between RRC context and S1AP context (%d != %d) for UE RNTI %d or UE RRC context doesn't exist\n", - rrc_instance_pP - RC.rrc[0], - (ue_context_p==NULL)?99999:ue_context_p->ue_context.eNB_ue_s1ap_id, - eNB_ue_s1ap_id, - result->ue_rnti); + if ((ue_context_p != NULL) && (ue_context_p->ue_context.eNB_ue_s1ap_id == 0)) { + ue_context_p->ue_context.eNB_ue_s1ap_id = eNB_ue_s1ap_id; + } else { + LOG_E(RRC, "[eNB %ld] Incoherence between RRC context and S1AP context (%d != %d) for UE RNTI %d or UE RRC context doesn't exist\n", + rrc_instance_pP - RC.rrc[0], + (ue_context_p==NULL)?99999:ue_context_p->ue_context.eNB_ue_s1ap_id, + eNB_ue_s1ap_id, + result->ue_rnti); + } } + } else { + LOG_E(S1AP, "[eNB %ld] S1AP context found but ue_initial_id is invalid (0)\n", rrc_instance_pP - RC.rrc[0]); + return NULL; } } else { - LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", even when looking at S1AP context\n", + LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", because ue_initial_id is invalid in S1AP context\n", rrc_instance_pP - RC.rrc[0], eNB_ue_s1ap_id); return NULL;