Commit b768e32e authored by Remi Hardy's avatar Remi Hardy

Merge remote-tracking branch 'origin/ci-deploy-docker-compose' into rh_fr1_newjenkins

parents 5a15c14e 2d6fea51
......@@ -225,7 +225,16 @@ class OaiCiTest():
result = re.search('/opt/flexran_rtc/build/rt_controller', SSH.getBefore())
if result is not None:
RAN.flexranCtrlInstalled=True
RAN.flexranCtrlIpAddress=EPC.IPAddress
logging.debug('Flexran Controller is installed')
else:
# Maybe flexran-rtc is deployed into a container
SSH.command('docker inspect --format="FLEX_RTC_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-flexran-rtc', '\$', 5)
result = re.search('FLEX_RTC_IP_ADDR = (?P<flex_ip_addr>[0-9\.]+)', SSH.getBefore())
if result is not None:
RAN.flexranCtrlDeployed=True
RAN.flexranCtrlIpAddress=result.group('flex_ip_addr')
logging.debug('Flexran Controller is deployed: ' + RAN.flexranCtrlIpAddress)
SSH.close()
def InitializeFlexranCtrl(self, HTML,RAN,EPC):
......@@ -1267,12 +1276,12 @@ class OaiCiTest():
i += 1
for job in multi_jobs:
job.join()
if RAN.flexranCtrlInstalled and RAN.flexranCtrlStarted:
if (RAN.flexranCtrlInstalled and RAN.flexranCtrlStarted) or RAN.flexranCtrlDeployed:
SSH = sshconnection.SSHConnection()
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
SSH.command('cd /opt/flexran_rtc', '\$', 5)
SSH.command('curl http://localhost:9999/stats | jq \'.\' > log/check_status_' + self.testCase_id + '.log 2>&1', '\$', 5)
SSH.command('cat log/check_status_' + self.testCase_id + '.log | jq \'.eNB_config[0].UE\' | grep -c rnti | sed -e "s#^#Nb Connected UE = #"', '\$', 5)
SSH.command('cd ' + EPC.SourceCodePath + '/scripts', '\$', 5)
SSH.command('curl http://' + RAN.flexranCtrlIpAddress + ':9999/stats | jq \'.\' > check_status_' + self.testCase_id + '.log 2>&1', '\$', 5)
SSH.command('cat 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]+)', SSH.getBefore())
passStatus = True
if result is not None:
......@@ -1934,15 +1943,34 @@ class OaiCiTest():
ret = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, encoding='utf-8')
if ret.stdout is not None:
EPC_Iperf_UE_IPAddress = ret.stdout.strip()
# When using a docker-based deployment, IPERF client shall be launched from trf container
launchFromTrfContainer = False
if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE):
launchFromTrfContainer = True
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
SSH.command('docker inspect --format="TRF_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-trf-gen', '\$', 5)
result = re.search('TRF_IP_ADDR = (?P<trf_ip_addr>[0-9\.]+)', SSH.getBefore())
if result is not None:
EPC_Iperf_UE_IPAddress = result.group('trf_ip_addr')
SSH.close()
port = 5001 + idx
udpOptions = ''
if udpIperf:
udpOptions = '-u '
if launchFromEpc:
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
SSH.command('cd ' + EPC.SourceCodePath + '/scripts', '\$', 5)
SSH.command('rm -f iperf_server_' + self.testCase_id + '_' + device_id + '.log', '\$', 5)
if udpIperf:
SSH.command('echo $USER; nohup iperf -u -s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', EPC.UserName, 5)
if launchFromTrfContainer:
if self.ueIperfVersion == self.dummyIperfVersion:
prefix = ''
else:
prefix = ''
if self.ueIperfVersion == '2.0.5':
prefix = '/iperf-2.0.5/bin/'
SSH.command('docker exec -d prod-trf-gen /bin/bash -c "nohup ' + prefix + 'iperf ' + udpOptions + '-s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log &"', '\$', 5)
else:
SSH.command('echo $USER; nohup iperf -s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', EPC.UserName, 5)
SSH.command('echo $USER; nohup iperf ' + udpOptions + '-s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log &', EPC.UserName, 5)
SSH.close()
else:
if self.ueIperfVersion == self.dummyIperfVersion:
......@@ -1951,10 +1979,7 @@ class OaiCiTest():
prefix = ''
if self.ueIperfVersion == '2.0.5':
prefix = '/opt/iperf-2.0.5/bin/'
if udpIperf:
cmd = 'nohup ' + prefix + 'iperf -u -s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 &'
else:
cmd = 'nohup ' + prefix + 'iperf -s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 &'
cmd = 'nohup ' + prefix + 'iperf ' + udpOptions + '-s -i 1 -p ' + str(port) + ' > iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 &'
logging.debug(cmd)
subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, encoding='utf-8')
time.sleep(0.5)
......@@ -2000,13 +2025,16 @@ class OaiCiTest():
# Kill iperf server on EPC side
if launchFromEpc:
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
SSH.command('killall --signal SIGKILL iperf', EPC.UserName, 5)
if launchFromTrfContainer:
SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5)
else:
SSH.command('killall --signal SIGKILL iperf', EPC.UserName, 5)
SSH.close()
else:
cmd = 'killall --signal SIGKILL iperf'
logging.debug(cmd)
subprocess.run(cmd, shell=True)
time.sleep(1)
time.sleep(1)
SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, 'iperf_server_' + self.testCase_id + '_' + device_id + '.log', EPC.SourceCodePath + '/scripts')
# in case of failure, retrieve server log
if (clientStatus == -1) or (clientStatus == -2):
......@@ -2014,6 +2042,10 @@ class OaiCiTest():
time.sleep(1)
if (os.path.isfile('iperf_server_' + self.testCase_id + '_' + device_id + '.log')):
os.remove('iperf_server_' + self.testCase_id + '_' + device_id + '.log')
if launchFromTrfContainer:
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
SSH.command('docker cp prod-trf-gen:/iperf-2.0.5/iperf_server_' + self.testCase_id + '_' + device_id + '.log ' + EPC.SourceCodePath + '/scripts', '\$', 5)
SSH.close()
SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath+ '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.')
self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options)
# in case of OAI-UE
......@@ -2212,8 +2244,16 @@ class OaiCiTest():
else:
SSH.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, EPC.SourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.')
# fromdos has to be called on the python executor not on ADB server
cmd = 'fromdos -o iperf_server_' + self.testCase_id + '_' + device_id + '.log'
subprocess.run(cmd, shell=True)
cmd = 'fromdos -o iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 > /dev/null'
try:
subprocess.run(cmd, shell=True)
except:
pass
cmd = 'dos2unix -o iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 > /dev/null'
try:
subprocess.run(cmd, shell=True)
except:
pass
self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options)
# in case of OAI UE:
......@@ -2902,13 +2942,17 @@ class OaiCiTest():
self.ShowTestID()
self.TerminateOAIUE(HTML,RAN,COTS_UE)
if (RAN.Initialize_eNB_args != ''):
self.testCase_id = 'AUTO-KILL-eNB'
self.testCase_id = 'AUTO-KILL-RAN'
HTML.testCase_id=self.testCase_id
self.desc = 'Automatic Termination of eNB'
HTML.desc='Automatic Termination of eNB'
self.desc = 'Automatic Termination of all RAN nodes'
HTML.desc='Automatic Termination of RAN nodes'
self.ShowTestID()
RAN.eNB_instance=0
RAN.TerminateeNB()
#terminate all RAN nodes eNB/gNB/OCP
for instance in range(0, len(RAN.air_interface)):
if RAN.air_interface[instance]!='':
logging.debug('Auto Termination of Instance ' + str(instance) + ' : ' + RAN.air_interface[instance])
RAN.eNB_instance=instance
RAN.TerminateeNB()
if RAN.flexranCtrlInstalled and RAN.flexranCtrlStarted:
self.testCase_id = 'AUTO-KILL-flexran-ctl'
HTML.testCase_id=self.testCase_id
......@@ -3050,7 +3094,7 @@ class OaiCiTest():
SSH.command('cd ' + SourceCodePath, '\$', 5)
SSH.command('cd cmake_targets', '\$', 5)
SSH.command('rm -f build.log.zip', '\$', 5)
SSH.command('zip build.log.zip build_log_*/*', '\$', 60)
SSH.command('zip -r build.log.zip build_log_*/*', '\$', 60)
SSH.close()
def LogCollectPing(self,EPC):
......
......@@ -215,7 +215,7 @@ log_config = {
NETWORK_CONTROLLER : {
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -215,7 +215,7 @@ log_config = {
NETWORK_CONTROLLER : {
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -215,7 +215,7 @@ log_config = {
NETWORK_CONTROLLER : {
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -112,7 +112,7 @@ log_config = {
NETWORK_CONTROLLER : {
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -112,7 +112,7 @@ log_config = {
NETWORK_CONTROLLER : {
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -112,7 +112,7 @@ log_config = {
NETWORK_CONTROLLER : {
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -239,7 +239,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "eth0";
FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -448,7 +448,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -251,7 +251,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "eth0";
FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -395,7 +395,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "eth0";
FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -228,7 +228,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -228,7 +228,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -228,7 +228,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -226,7 +226,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -247,7 +247,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -256,7 +256,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "eth0";
FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -250,7 +250,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "eth0";
FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -255,7 +255,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
File mode changed from 100755 to 100644
......@@ -249,7 +249,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -244,7 +244,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "eth0";
FLEXRAN_IPV4_ADDRESS = "CI_MME_IP_ADDR";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
File mode changed from 100755 to 100644
......@@ -235,7 +235,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -235,7 +235,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -235,7 +235,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -254,7 +254,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -254,7 +254,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -254,7 +254,7 @@ NETWORK_CONTROLLER :
{
FLEXRAN_ENABLED = "no";
FLEXRAN_INTERFACE_NAME = "lo";
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
FLEXRAN_IPV4_ADDRESS = "CI_FLEXRAN_CTL_IP_ADDR";
FLEXRAN_PORT = 2210;
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
FLEXRAN_AWAIT_RECONF = "no";
......
......@@ -59,6 +59,7 @@ OAI_UE_PROCESS_NO_TUNNEL_INTERFACE = -24
OAI_UE_PROCESS_SEG_FAULT = -25
OAI_UE_PROCESS_NO_MBMS_MSGS = -26
OAI_UE_PROCESS_OK = +6
INVALID_PARAMETER = -50
UE_STATUS_DETACHED = 0
UE_STATUS_DETACHING = 1
......
This diff is collapsed.
......@@ -98,8 +98,9 @@ def AssignParams(params_dict):
def GetParametersFromXML(action):
if action == 'Build_eNB':
if action == 'Build_eNB' or action == 'Build_Image':
RAN.Build_eNB_args=test.findtext('Build_eNB_args')
RAN.imageKind=test.findtext('kind')
forced_workspace_cleanup = test.findtext('forced_workspace_cleanup')
if (forced_workspace_cleanup is None):
RAN.Build_eNB_forced_workspace_cleanup=False
......@@ -113,9 +114,11 @@ def GetParametersFromXML(action):
RAN.eNB_instance=0
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0'
eNB_serverId=test.findtext('eNB_serverId')
if (eNB_serverId is None):
RAN.eNB_serverId[RAN.eNB_instance]='0'
else:
RAN.eNB_serverId[RAN.eNB_instance]=eNB_serverId
xmlBgBuildField = test.findtext('backgroundBuild')
if (xmlBgBuildField is None):
RAN.backgroundBuild=False
......@@ -127,14 +130,17 @@ def GetParametersFromXML(action):
elif action == 'WaitEndBuild_eNB':
RAN.Build_eNB_args=test.findtext('Build_eNB_args')
RAN.imageKind=test.findtext('kind')
eNB_instance=test.findtext('eNB_instance')
if (eNB_instance is None):
RAN.eNB_instance=0
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0'
eNB_serverId=test.findtext('eNB_serverId')
if (eNB_serverId is None):
RAN.eNB_serverId[RAN.eNB_instance]='0'
else:
RAN.eNB_serverId[RAN.eNB_instance]=eNB_serverId
elif action == 'Initialize_eNB':
RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args')
......@@ -143,9 +149,11 @@ def GetParametersFromXML(action):
RAN.eNB_instance=0
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0'
eNB_serverId=test.findtext('eNB_serverId')
if (eNB_serverId is None):
RAN.eNB_serverId[RAN.eNB_instance]='0'
else:
RAN.eNB_serverId[RAN.eNB_instance]=eNB_serverId
#local variable air_interface
air_interface = test.findtext('air_interface')
......@@ -162,10 +170,12 @@ def GetParametersFromXML(action):
RAN.eNB_instance=0
else:
RAN.eNB_instance=int(eNB_instance)
RAN.eNB_serverId=test.findtext('eNB_serverId')
if (RAN.eNB_serverId is None):
RAN.eNB_serverId='0'
eNB_serverId=test.findtext('eNB_serverId')
if (eNB_serverId is None):
RAN.eNB_serverId[RAN.eNB_instance]='0'
else:
RAN.eNB_serverId[RAN.eNB_instance]=eNB_serverId
#local variable air_interface
air_interface = test.findtext('air_interface')
if (air_interface is None) or (air_interface.lower() not in ['nr','lte','ocp']):
......@@ -288,6 +298,11 @@ def GetParametersFromXML(action):
if (string_field is not None):
EPC.mmeConfFile = string_field
elif action == 'Deploy_EPC':
string_field = test.findtext('parameters')
if (string_field is not None):
EPC.yamlPath = string_field
else: # ie action == 'Run_PhySim':
ldpc.runargs = test.findtext('physim_run_args')
......@@ -383,8 +398,8 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE):
if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
RAN.eNB_serverId='0'
RAN.eNB_instance=0
RAN.eNB_serverId[0]='0'
RAN.eNBSourceCodePath='/tmp/'
RAN.TerminateeNB()
elif re.match('^TerminateUE$', mode, re.IGNORECASE):
......@@ -495,7 +510,7 @@ elif re.match('^FinalizeHtml$', mode, re.IGNORECASE):
HTML.CreateHtmlFooter(CiTestObj.finalStatus)
elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE):
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
logging.debug('\u001B[1m Starting Scenario \u001B[0m')
logging.debug('\u001B[1m Starting Scenario: ' + CiTestObj.testXMLfiles[0] + '\u001B[0m')
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
if re.match('^TesteNB$', mode, re.IGNORECASE):
if RAN.eNBIPAddress == '' or RAN.ranRepository == '' or RAN.ranBranch == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '' or EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '' or CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == '':
......@@ -627,6 +642,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
break
if action == 'Build_eNB':
RAN.BuildeNB()
elif action == 'Build_Image':
RAN.BuildImage()
elif action == 'WaitEndBuild_eNB':
RAN.WaitBuildeNBisFinished()
elif action == 'Initialize_eNB':
......@@ -685,6 +702,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
EPC.InitializeSPGW()
elif action == 'Terminate_SPGW':
EPC.TerminateSPGW()
elif action == 'Deploy_EPC':
EPC.DeployEpc()
elif action == 'Undeploy_EPC':
EPC.UndeployEpc()
elif action == 'Initialize_FlexranCtrl':
CiTestObj.InitializeFlexranCtrl(HTML,RAN,EPC)
elif action == 'Terminate_FlexranCtrl':
......@@ -707,14 +728,14 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML.testStabilityPointReached = True
CiTestObj.FailReportCnt += 1
if CiTestObj.FailReportCnt == CiTestObj.repeatCounts[0] and RAN.prematureExit:
logging.debug('Testsuite failed ' + str(CiTestObj.FailReportCnt) + ' time(s)')
logging.debug('Scenario failed ' + str(CiTestObj.FailReportCnt) + ' time(s)')
HTML.CreateHtmlTabFooter(False)
if CiTestObj.testUnstable and (CiTestObj.testStabilityPointReached or CiTestObj.testMinStableId == '999999'):
logging.debug('Scenario has reached minimal stability point -- Not a Failure')
else:
sys.exit('Failed Scenario')
else:
logging.info('Testsuite passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)')
logging.info('Scenario passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)')
HTML.CreateHtmlTabFooter(True)
elif re.match('^LoadParams$', mode, re.IGNORECASE):
pass
......
This diff is collapsed.
......@@ -21,7 +21,11 @@
BEGIN{max=0;min=10000}
{
if ($0 ~/Mbits/) {
split($0,a,"MBytes")
if ($0 ~/KBytes/) {
split($0,a,"KBytes")
} else {
split($0,a,"MBytes")
}
split(a[2],b)
if (b[1]>max) {
max=b[1]
......
- Build_PhySim
- Run_PhySim
- Build_eNB
- Build_Image
- WaitEndBuild_eNB
- Initialize_eNB
- Terminate_eNB
......@@ -19,6 +20,8 @@
- Reboot_UE
- Initialize_FlexranCtrl
- Terminate_FlexranCtrl
- Deploy_EPC
- Undeploy_EPC
- Initialize_HSS
- Terminate_HSS
- Initialize_MME
......
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>build-tab</htmlTabRef>
<htmlTabName>Build</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
000001
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001">
<class>Build_Image</class>
<desc>Build eNB Image</desc>
<kind>all</kind>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
</testCaseList>
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>epc-deploy-tab</htmlTabRef>
<htmlTabName>EPC-Deploy</htmlTabName>
<htmlTabIcon>log-in</htmlTabIcon>
<TestCaseRequestedList>
000100
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
<testCase id="000100">
<class>Deploy_EPC</class>
<desc>Deploy all EPC containers</desc>
<parameters>yaml_files/fr1_epc_tim</parameters>
</testCase>
</testCaseList>
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>epc-undeploy-tab</htmlTabRef>
<htmlTabName>EPC-Undeploy</htmlTabName>
<htmlTabIcon>log-out</htmlTabIcon>
<TestCaseRequestedList>
000200
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
<testCase id="000200">
<class>Undeploy_EPC</class>
<desc>Undeploy all EPC containers</desc>
</testCase>
</testCaseList>
version: '3.8'
services:
cassandra:
image: cassandra:2.1
container_name: prod-cassandra
networks:
private_net:
ipv4_address: 192.168.68.2
environment:
CASSANDRA_CLUSTER_NAME: "OAI HSS Cluster"
CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch
healthcheck:
test: /bin/bash -c "nodetool status"
interval: 10s
timeout: 5s
retries: 5
db_init:
image: cassandra:2.1
container_name: prod-db-init
depends_on: [cassandra]
deploy:
restart_policy:
condition: on-failure
max_attempts: 10
networks:
private_net:
ipv4_address: 192.168.68.4
volumes:
- ./oai_db.cql:/home/oai_db.cql
entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'"
oai_hss:
image: oai-hss:production
container_name: prod-oai-hss
privileged: true
depends_on: [cassandra]
networks:
private_net:
ipv4_address: 192.168.68.3
public_net:
ipv4_address: 192.168.61.2
environment:
REALM: openairinterface.org
HSS_FQDN: hss.openairinterface.org
PREFIX: /openair-hss/etc
cassandra_Server_IP: 192.168.68.2
OP_KEY: 1006020f0a478bf6b699f15c062e42b3
LTE_K: fec86ba6eb707ed08905757b1bb44b8f
APN1: oai.ipv4
APN2: internet
FIRST_IMSI: 222010100001120
NB_USERS: 10
healthcheck:
test: /bin/bash -c "pgrep oai_hss"
interval: 10s
timeout: 5s
retries: 5
oai_mme:
image: oai-mme:production
container_name: prod-oai-mme
privileged: true
depends_on: [oai_hss]
networks:
public_net:
ipv4_address: 192.168.61.3
environment:
REALM: openairinterface.org
PREFIX: /openair-mme/etc
INSTANCE: 1
PID_DIRECTORY: /var/run
HSS_IP_ADDR: 192.168.61.2
HSS_HOSTNAME: hss
HSS_FQDN: hss.openairinterface.org
HSS_REALM: openairinterface.org
MCC: '222'
MNC: '01'
MME_GID: 32768
MME_CODE: 3
TAC_0: 1
TAC_1: 2
TAC_2: 3
MME_FQDN: mme.openairinterface.org
MME_S6A_IP_ADDR: 192.168.61.3
MME_INTERFACE_NAME_FOR_S1_MME: eth0
MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3
MME_INTERFACE_NAME_FOR_S11: eth0
MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3
MME_INTERFACE_NAME_FOR_S10: lo
MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10
OUTPUT: CONSOLE
SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4
PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0
PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0
MCC_SGW_0: '222'
MNC3_SGW_0: '001'
TAC_LB_SGW_0: '01'
TAC_HB_SGW_0: '00'
MCC_MME_0: '222'
MNC3_MME_0: '001'
TAC_LB_MME_0: '02'
TAC_HB_MME_0: '00'
MCC_MME_1: '222'
MNC3_MME_1: '001'
TAC_LB_MME_1: '03'
TAC_HB_MME_1: '00'
TAC_LB_SGW_TEST_0: '03'
TAC_HB_SGW_TEST_0: '00'
SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0
healthcheck:
test: /bin/bash -c "pgrep oai_mme"
interval: 10s
timeout: 5s
retries: 5
oai_spgwc:
image: oai-spgwc:production
privileged: true
depends_on: [oai_mme]
container_name: prod-oai-spgwc
networks:
public_net:
ipv4_address: 192.168.61.4
environment:
PID_DIRECTORY: /var/run
SGW_INTERFACE_NAME_FOR_S11: eth0
SGW_IP_FOR_S5_S8_CP: 127.0.0.11/8
PGW_IP_FOR_S5_S8_CP: 127.0.0.12/8
PGW_INTERFACE_NAME_FOR_SX: eth0
DEFAULT_APN: oai.ipv4
DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129
DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4
UE_IP_ADDRESS_POOL: '12.1.1.2 - 12.1.1.254'
PUSH_PROTOCOL_OPTION: 'yes'
healthcheck:
test: /bin/bash -c "pgrep oai_spgwc"
interval: 10s
timeout: 5s
retries: 5
oai_spgwu:
image: oai-spgwu-tiny:production
privileged: true
container_name: prod-oai-spgwu-tiny
depends_on: [oai_spgwc]
networks:
public_net:
ipv4_address: 192.168.61.5
environment:
PID_DIRECTORY: /var/run
INSTANCE: 1
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0
PGW_INTERFACE_NAME_FOR_SGI: eth0
SGW_INTERFACE_NAME_FOR_SX: eth0
SPGWC0_IP_ADDRESS: 192.168.61.4
NETWORK_UE_IP: '12.1.1.0/24'
NETWORK_UE_NAT_OPTION: 'yes'
healthcheck:
test: /bin/bash -c "pgrep oai_spgwu"
interval: 10s
timeout: 5s
retries: 5
flexran_rtc:
image: flexran-rtc:production
privileged: true
container_name: prod-flexran-rtc
networks:
public_net:
ipv4_address: 192.168.61.10
healthcheck:
test: /bin/bash -c "pgrep rt_controller"
interval: 10s
timeout: 5s
retries: 5
trf_gen:
image: trf-gen:production
privileged: true
container_name: prod-trf-gen
networks:
public_net:
ipv4_address: 192.168.61.11
entrypoint: /bin/bash -c "ip route add 12.1.1.0/24 via 192.168.61.5 dev eth0; sleep infinity"
healthcheck:
test: /bin/bash -c "ping -c 2 192.168.61.5"
interval: 10s
timeout: 5s
retries: 5
networks:
private_net:
name: prod-oai-private-net
ipam:
config:
- subnet: 192.168.68.0/26
public_net:
name: prod-oai-public-net
ipam:
config:
- subnet: 192.168.61.0/26
......@@ -114,6 +114,8 @@ check_supported_distribution() {
"rhel7.7") return 0 ;;
"rhel7.8") return 0 ;;
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
"centos7") return 0 ;;
esac
return 1
......
......@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP
......
......@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP
......
......@@ -32,9 +32,14 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP
RUN apt-get install -y python3-pip && \
pip3 install --ignore-installed pyyaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/parameters.yaml
# debug
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15
#RUN ls -ls /oai-ran/targets/bin
......@@ -73,6 +78,7 @@ RUN apt-get update && \
WORKDIR /opt/oai-enb/bin
COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 .
COPY --from=enb-build /oai-ran/docker/scripts/enb_entrypoint.sh entrypoint.sh
WORKDIR /usr/local/lib/
COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
......@@ -104,21 +110,17 @@ RUN ldconfig
# Copy the relevant configuration files for eNB
WORKDIR /opt/oai-enb/etc
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/enb.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rcc.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/cu.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/du.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rru.* ./
COPY --from=enb-build /oai-ran/docker/etc .
WORKDIR /opt/oai-enb
#EXPOSE 2152/udp # S1U, GTP/UDP
# 2152 --> S1U, GTP/UDP
# 36412 --> S1C, SCTP/UDP
# 36422 --> X2C, SCTP/UDP
EXPOSE 2152/udp 36412/udp 36422/udp
#EXPOSE 22100/tcp # ?
#EXPOSE 36412/udp # S1C, SCTP/UDP
#EXPOSE 36422/udp # X2C, SCTP/UDP
#EXPOSE 50000/udp # IF5 / ORI (control)
#EXPOSE 50001/udp # IF5 / ECPRI (data)
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
CMD ["/opt/oai-enb/bin/lte-softmodem.Rel15", "-O", "/opt/oai-enb/etc/enb.conf"]
......@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --gNB --ninja -w USRP
......
......@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --gNB --ninja -w USRP
......
......@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --gNB --ninja -w USRP
......
......@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP
......
......@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP
......
......@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP
......
......@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --nrUE --ninja -w USRP
......
......@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --nrUE --ninja -w USRP
......
......@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --nrUE --ninja -w USRP
......
#!/bin/bash
set -euo pipefail
# Based another env var
if [[ -v USE_FDD_CU ]]; then ln -s /opt/oai-enb/etc/cu.fdd.conf /opt/oai-enb/etc/enb.conf; fi
if [[ -v USE_FDD_DU ]]; then ln -s /opt/oai-enb/etc/du.fdd.conf /opt/oai-enb/etc/enb.conf; fi
if [[ -v USE_FDD_MONO ]]; then ln -s /opt/oai-enb/etc/enb.fdd.conf /opt/oai-enb/etc/enb.conf; fi
if [[ -v USE_TDD_MONO ]]; then ln -s /opt/oai-enb/etc/enb.tdd.conf /opt/oai-enb/etc/enb.conf; fi
if [[ -v USE_FDD_RCC ]]; then ln -s /opt/oai-enb/etc/rcc.if4p5.enb.fdd.conf /opt/oai-enb/etc/enb.conf; fi
if [[ -v USE_FDD_RRU ]]; then ln -s /opt/oai-enb/etc/rru.fdd.conf /opt/oai-enb/etc/enb.conf; fi
if [[ -v USE_TDD_RRU ]]; then ln -s /opt/oai-enb/etc/rru.tdd.conf /opt/oai-enb/etc/enb.conf; fi
CONFIG_FILES=`ls /opt/oai-enb/etc/enb.conf`
for c in ${CONFIG_FILES}; do
# grep variable names (format: ${VAR}) from template to be rendered
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
EXPRESSIONS=""
for v in ${VARS}; do
NEW_VAR=`echo $v | sed -e "s#@##g"`
if [[ "${!NEW_VAR}x" == "x" ]]; then
echo "Error: Environment variable '${NEW_VAR}' is not set." \
"Config file '$(basename $c)' requires all of $VARS."
exit 1
fi
EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
done
EXPRESSIONS="${EXPRESSIONS#';'}"
# render template and inline replace config file
sed -i "${EXPRESSIONS}" ${c}
done
# Later-on, how to add command lines options?
# Load the USRP binaries
# --> later conditional (when doing simulators)
/usr/lib/uhd/utils/uhd_images_downloader.py
exec "$@"
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
---
- paths:
source_dir: "ci-scripts/conf_files/"
dest_dir: docker/etc
- configurations:
- filePrefix: cu
outputfilename: "cu.fdd.conf"
config:
- key: Active_eNBs
env: "@ENB_NAME@"
- key: eNB_name
env: "@ENB_NAME@"
- key: plmn_list
env:
mcc: "@MCC@"
mnc: "@MNC@"
mnc_length: "@MNC_LENGTH@"
- key: tracking_area_code
env: "@TAC@"
- key: local_s_if_name
env: "@F1_IF_NAME@"
- key: remote_s_address
env: "@F1_DU_IP_ADDRESS@"
- key: local_s_address
env: "@F1_CU_IP_ADDRESS@"
- key: eutra_band
env: "@UTRA_BAND_ID@"
- key: downlink_frequency
env: "@DL_FREQUENCY_IN_MHZ@000000"
- key: uplink_frequency_offset
env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
- key: Nid_cell
env: "@NID_CELL@"
- key: N_RB_DL
env: "@NB_PRB@"
- key: ipv4
env: "@MME_S1C_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1_MME
env: "@S1C_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1_MME
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1U
env: "@S1U_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1U
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
- filePrefix: du
outputfilename: "du.fdd.conf"
config:
- key: Active_eNBs
env: "@ENB_NAME@"
- key: eNB_name
env: "@ENB_NAME@"
- key: plmn_list
env:
mcc: "@MCC@"
mnc: "@MNC@"
mnc_length: "@MNC_LENGTH@"
- key: tracking_area_code
env: "@TAC@"
- key: local_n_if_name
env: "@F1_IF_NAME@"
- key: remote_n_address
env: "@F1_DU_IP_ADDRESS@"
- key: local_n_address
env: "@F1_CU_IP_ADDRESS@"
- key: eutra_band
env: "@UTRA_BAND_ID@"
- key: downlink_frequency
env: "@DL_FREQUENCY_IN_MHZ@000000"
- key: uplink_frequency_offset
env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
- key: Nid_cell
env: "@NID_CELL@"
- key: N_RB_DL
env: "@NB_PRB@"
- filePrefix: rru.fdd
outputfilename: "rru.fdd.conf"
config:
- key: local_if_name
env: "@@"
- key: remote_address
env: "@@"
- key: local_address
env: "@@"
- key: bands
env: "@@"
- filePrefix: rru.tdd
outputfilename: "rru.tdd.conf"
config:
- key: local_if_name
env: "@@"
- key: remote_address
env: "@@"
- key: local_address
env: "@@"
- key: bands
env: "@@"
- filePrefix: enb.band7.tm1.25PRB.usrpb210
outputfilename: "enb.fdd.conf"
config:
- key: Active_eNBs
env: "@ENB_NAME@"
- key: eNB_name
env: "@ENB_NAME@"
- key: plmn_list
env:
mcc: "@MCC@"
mnc: "@MNC@"
mnc_length: "@MNC_LENGTH@"
- key: tracking_area_code
env: "@TAC@"
- key: eutra_band
env: "@UTRA_BAND_ID@"
- key: downlink_frequency
env: "@DL_FREQUENCY_IN_MHZ@000000"
- key: uplink_frequency_offset
env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
- key: Nid_cell
env: "@NID_CELL@"
- key: N_RB_DL
env: "@NB_PRB@"
- key: ipv4
env: "@MME_S1C_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1_MME
env: "@S1C_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1_MME
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1U
env: "@S1U_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1U
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
- filePrefix: enb.band40.tm1.25PRB.FairScheduler.usrpb210
outputfilename: "enb.tdd.conf"
config:
- key: Active_eNBs
env: "@ENB_NAME@"
- key: eNB_name
env: "@ENB_NAME@"
- key: plmn_list
env:
mcc: "@MCC@"
mnc: "@MNC@"
mnc_length: "@MNC_LENGTH@"
- key: tracking_area_code
env: "@TAC@"
- key: eutra_band
env: "@UTRA_BAND_ID@"
- key: downlink_frequency
env: "@DL_FREQUENCY_IN_MHZ@000000"
- key: uplink_frequency_offset
env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
- key: Nid_cell
env: "@NID_CELL@"
- key: N_RB_DL
env: "@NB_PRB@"
- key: ipv4
env: "@MME_S1C_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1_MME
env: "@S1C_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1_MME
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1U
env: "@S1U_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1U
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
- filePrefix: "rcc.band7.tm1.nfapi"
outputfilename: "rcc.if4p5.enb.fdd.conf"
config:
- key: Active_eNBs
env: "@ENB_NAME@"
- key: eNB_name
env: "@ENB_NAME@"
- key: plmn_list
env:
mcc: "@MCC@"
mnc: "@MNC@"
mnc_length: "@MNC_LENGTH@"
- key: tracking_area_code
env: "@TAC@"
- key: local_s_if_name
env: "@F1_IF_NAME@"
- key: remote_s_address
env: "@F1_DU_IP_ADDRESS@"
- key: local_s_address
env: "@F1_CU_IP_ADDRESS@"
- key: eutra_band
env: "@UTRA_BAND_ID@"
- key: downlink_frequency
env: "@DL_FREQUENCY_IN_MHZ@000000"
- key: uplink_frequency_offset
env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
- key: Nid_cell
env: "@NID_CELL@"
- key: N_RB_DL
env: "@NB_PRB@"
- key: ipv4
env: "@MME_S1C_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1_MME
env: "@S1C_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1_MME
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_INTERFACE_NAME_FOR_S1U
env: "@S1U_IF_NAME@"
- key: ENB_IPV4_ADDRESS_FOR_S1U
env: "@F1_CU_IP_ADDRESS@"
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#-----------------------------------------------------------
# Import
#-----------------------------------------------------------
import re
import yaml
import os
import sys
def main():
#read yaml input parameters
f = open(f'{sys.argv[1]}',)
data = yaml.full_load(f)
dir = os.listdir(f'{data[0]["paths"]["source_dir"]}')
#identify configs, read and replace corresponding values
for config in data[1]["configurations"]:
filePrefix = config["filePrefix"]
outputfilename = config["outputfilename"]
for inputfile in dir:
if inputfile.find(filePrefix) >=0:
prefix_outputfile = {"cu": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"du": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rru.fdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rru.tdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"enb.band7.tm1.25PRB.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
}
if filePrefix in prefix_outputfile:
outputfile1 = prefix_outputfile[filePrefix]
directory = f'{data[0]["paths"]["dest_dir"]}'
if not os.path.exists(directory):
os.makedirs(directory, exist_ok=True)
with open(f'{data[0]["paths"]["source_dir"]}{inputfile}', mode='r') as inputfile, \
open(outputfile1, mode='w') as outputfile:
for line in inputfile:
count = 0
for key in config["config"]:
if line.find(key["key"]) >= 0:
count += 1
if re.search(r'preference', line):
templine = line
elif re.search(r'plmn_list', line):
templine = re.sub(r'[0-9]+', '""', line)
templine = re.sub(r'\"\"', key["env"]["mcc"], templine, 1)
templine = re.sub(r'\"\"', key["env"]["mnc"], templine, 1)
templine = re.sub(r'\"\"', key["env"]["mnc_length"], templine, 1)
elif re.search('downlink_frequency', line):
templine = re.sub(r'[0-9]+', key["env"], line)
elif re.search('uplink_frequency_offset', line):
templine = re.sub(r'[0-9]+', key["env"], line)
elif re.search(r'"(.*?)"', line):
templine = re.sub(r'(?<=")[^"]*(?=")', key["env"], line)
elif re.search(r'[0-9]', line):
templine = re.sub(r'\d+', key["env"], line)
outputfile.write(templine)
if count == 0:
outputfile.write(line)
if __name__ == "__main__":
main()
......@@ -413,10 +413,16 @@ sctp_handle_new_association_req(
}
/* Subscribe to all events */
memset((void *)&events, 1, sizeof(struct sctp_event_subscribe));
events.sctp_data_io_event = 1;
events.sctp_association_event = 1;
events.sctp_address_event = 1;
events.sctp_send_failure_event = 1;
events.sctp_peer_error_event = 1;
events.sctp_shutdown_event = 1;
events.sctp_partial_delivery_event = 1;
if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &events,
sizeof(struct sctp_event_subscribe)) < 0) {
8) < 0) {
SCTP_ERROR("Setsockopt IPPROTO_SCTP_EVENTS failed: %s\n",
strerror(errno));
close(sd);
......@@ -759,10 +765,16 @@ static int sctp_create_new_listener(
}
}
memset((void *)&event, 1, sizeof(struct sctp_event_subscribe));
event.sctp_data_io_event = 1;
event.sctp_association_event = 1;
event.sctp_address_event = 1;
event.sctp_send_failure_event = 1;
event.sctp_peer_error_event = 1;
event.sctp_shutdown_event = 1;
event.sctp_partial_delivery_event = 1;
if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &event,
sizeof(struct sctp_event_subscribe)) < 0) {
8) < 0) {
SCTP_ERROR("setsockopt: %s:%d\n", strerror(errno), errno);
if (sd != -1) {
close(sd);
......
......@@ -241,10 +241,16 @@ int sctp_connect_to_remote_host(char *local_ip_addr[],
}
/* Subscribe to all events */
memset((void *)&events, 1, sizeof(struct sctp_event_subscribe));
events.sctp_data_io_event = 1;
events.sctp_association_event = 1;
events.sctp_address_event = 1;
events.sctp_send_failure_event = 1;
events.sctp_peer_error_event = 1;
events.sctp_shutdown_event = 1;
events.sctp_partial_delivery_event = 1;
if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &events,
sizeof(struct sctp_event_subscribe)) < 0) {
8) < 0) {
SCTP_ERROR("Setsockopt IPPROTO_SCTP_EVENTS failed: %s\n",
strerror(errno));
return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment