Commit 79ac2f1f authored by Raphael Defosseux's avatar Raphael Defosseux

feat(ci): Q&D adding of 5G RF sim on container/docker-compose

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent a6b0730a
This diff is collapsed.
...@@ -372,6 +372,41 @@ def GetParametersFromXML(action): ...@@ -372,6 +372,41 @@ def GetParametersFromXML(action):
if (string_field is not None): if (string_field is not None):
CONTAINERS.yamlPath[CONTAINERS.eNB_instance] = string_field CONTAINERS.yamlPath[CONTAINERS.eNB_instance] = string_field
elif action == 'DeployGenObject' or action == 'UndeployGenObject':
string_field=test.findtext('yaml_path')
if (string_field is not None):
CONTAINERS.yamlPath[0] = string_field
string_field=test.findtext('services')
if (string_field is not None):
CONTAINERS.services[0] = string_field
string_field=test.findtext('nb_healthy')
if (string_field is not None):
CONTAINERS.nb_healthy[0] = int(string_field)
elif action == 'PingFromContainer':
string_field = test.findtext('container_name')
if (string_field is not None):
CONTAINERS.pingContName = string_field
string_field = test.findtext('options')
if (string_field is not None):
CONTAINERS.pingOptions = string_field
string_field = test.findtext('loss_threshold')
if (string_field is not None):
CONTAINERS.pingLossThreshold = string_field
elif action == 'IperfFromContainer':
string_field = test.findtext('server_container_name')
if (string_field is not None):
CONTAINERS.svrContName = string_field
string_field = test.findtext('server_options')
if (string_field is not None):
CONTAINERS.svrOptions = string_field
string_field = test.findtext('client_container_name')
if (string_field is not None):
CONTAINERS.cliContName = string_field
string_field = test.findtext('client_options')
if (string_field is not None):
CONTAINERS.cliOptions = string_field
else: # ie action == 'Run_PhySim': else: # ie action == 'Run_PhySim':
ldpc.runargs = test.findtext('physim_run_args') ldpc.runargs = test.findtext('physim_run_args')
...@@ -479,6 +514,8 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE): ...@@ -479,6 +514,8 @@ if re.match('^TerminateeNB$', mode, re.IGNORECASE):
if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '': if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if RAN.eNBIPAddress == 'none':
sys.exit(0)
RAN.eNB_instance=0 RAN.eNB_instance=0
RAN.eNB_serverId[0]='0' RAN.eNB_serverId[0]='0'
RAN.eNBSourceCodePath='/tmp/' RAN.eNBSourceCodePath='/tmp/'
...@@ -514,11 +551,15 @@ elif re.match('^LogCollectBuild$', mode, re.IGNORECASE): ...@@ -514,11 +551,15 @@ elif re.match('^LogCollectBuild$', mode, re.IGNORECASE):
if (RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '') and (CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == ''): if (RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '') and (CiTestObj.UEIPAddress == '' or CiTestObj.UEUserName == '' or CiTestObj.UEPassword == '' or CiTestObj.UESourceCodePath == ''):
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if RAN.eNBIPAddress == 'none':
sys.exit(0)
CiTestObj.LogCollectBuild(RAN) CiTestObj.LogCollectBuild(RAN)
elif re.match('^LogCollecteNB$', mode, re.IGNORECASE): elif re.match('^LogCollecteNB$', mode, re.IGNORECASE):
if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '': if RAN.eNBIPAddress == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter') sys.exit('Insufficient Parameter')
if RAN.eNBIPAddress == 'none':
sys.exit(0)
RAN.LogCollecteNB() RAN.LogCollecteNB()
elif re.match('^LogCollectHSS$', mode, re.IGNORECASE): elif re.match('^LogCollectHSS$', mode, re.IGNORECASE):
if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '': if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '':
...@@ -802,7 +843,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -802,7 +843,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Build_PhySim': elif action == 'Build_PhySim':
HTML=ldpc.Build_PhySim(HTML,CONST) HTML=ldpc.Build_PhySim(HTML,CONST)
if ldpc.exitStatus==1: if ldpc.exitStatus==1:
RAN.prematureExit = False RAN.prematureExit = True
elif action == 'Run_PhySim': elif action == 'Run_PhySim':
HTML=ldpc.Run_PhySim(HTML,CONST,id) HTML=ldpc.Run_PhySim(HTML,CONST,id)
elif action == 'Build_Image': elif action == 'Build_Image':
...@@ -815,9 +856,25 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -815,9 +856,25 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
SCA.CppCheckAnalysis(HTML) SCA.CppCheckAnalysis(HTML)
elif action == 'Deploy_Run_PhySim': elif action == 'Deploy_Run_PhySim':
PHYSIM.Deploy_PhySim(HTML, RAN) PHYSIM.Deploy_PhySim(HTML, RAN)
elif action == 'DeployGenObject':
CONTAINERS.DeployGenObject(HTML)
if CONTAINERS.exitStatus==1:
RAN.prematureExit = True
elif action == 'UndeployGenObject':
CONTAINERS.UndeployGenObject(HTML)
if CONTAINERS.exitStatus==1:
RAN.prematureExit = True
elif action == 'PingFromContainer':
CONTAINERS.PingFromContainer(HTML)
if CONTAINERS.exitStatus==1:
RAN.prematureExit = True
elif action == 'IperfFromContainer':
CONTAINERS.IperfFromContainer(HTML)
if CONTAINERS.exitStatus==1:
RAN.prematureExit = True
else: else:
sys.exit('Invalid class (action) from xml') sys.exit('Invalid class (action) from xml')
if not RAN.prematureExit: if RAN.prematureExit:
if CiTestObj.testCase_id == CiTestObj.testMinStableId: if CiTestObj.testCase_id == CiTestObj.testMinStableId:
logging.debug('Scenario has reached minimal stability point') logging.debug('Scenario has reached minimal stability point')
CiTestObj.testStabilityPointReached = True CiTestObj.testStabilityPointReached = True
......
...@@ -41,3 +41,7 @@ ...@@ -41,3 +41,7 @@
- Undeploy_Object - Undeploy_Object
- Cppcheck_Analysis - Cppcheck_Analysis
- Deploy_Run_PhySim - Deploy_Run_PhySim
- DeployGenObject
- UndeployGenObject
- PingFromContainer
- IperfFromContainer
<!--
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>rfsim-5gnr</htmlTabRef>
<htmlTabName>Testing 5G NR RF sim in containers</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
000001
000002
000003
020001
020002
030001
030002
100001
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G CoreNetwork</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path>
<services>mysql oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn</services>
<nb_healthy>6</nb_healthy>
</testCase>
<testCase id="000002">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G gNB RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path>
<services>oai-gnb</services>
<nb_healthy>7</nb_healthy>
</testCase>
<testCase id="000003">
<class>DeployGenObject</class>
<desc>Deploy OAI 5G NR-UE RF sim SA</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path>
<services>oai-nr-ue</services>
<nb_healthy>8</nb_healthy>
</testCase>
<testCase id="020001">
<class>PingFromContainer</class>
<desc>Ping ext-dn from NR-UE</desc>
<container_name>rfsim5g-oai-nr-ue</container_name>
<options>-I oaitun_ue1 -c 20 192.168.72.135</options>
<loss_threshold>5</loss_threshold>
</testCase>
<testCase id="020002">
<class>PingFromContainer</class>
<desc>Ping NR-UE from ext-dn</desc>
<container_name>rfsim5g-oai-ext-dn</container_name>
<options>-c 20 12.1.1.2</options>
<loss_threshold>5</loss_threshold>
</testCase>
<testCase id="030001">
<class>IperfFromContainer</class>
<desc>Iperf UDP Downlink</desc>
<server_container_name>rfsim5g-oai-nr-ue</server_container_name>
<client_container_name>rfsim5g-oai-ext-dn</client_container_name>
<server_options>-B 12.1.1.2 -u -i 1 -s</server_options>
<client_options>-c 12.1.1.2 -u -i 1 -t 30 -b 400K</client_options>
</testCase>
<testCase id="030002">
<class>IperfFromContainer</class>
<desc>Iperf UDP Uplink</desc>
<server_container_name>rfsim5g-oai-ext-dn</server_container_name>
<client_container_name>rfsim5g-oai-nr-ue</client_container_name>
<server_options>-u -i 1 -s</server_options>
<client_options>-B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 20K</client_options>
</testCase>
<testCase id="100001">
<class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path>
</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>rfsim-5gnr-down</htmlTabRef>
<htmlTabName>CleanUp 5G RF</htmlTabName>
<htmlTabIcon>trash</htmlTabIcon>
<TestCaseRequestedList>
100002
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="100002">
<class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path>
</testCase>
</testCaseList>
...@@ -206,7 +206,7 @@ services: ...@@ -206,7 +206,7 @@ services:
privileged: true privileged: true
container_name: rfsim5g-oai-ext-dn container_name: rfsim5g-oai-ext-dn
entrypoint: /bin/bash -c \ entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf iputils-ping;"\ "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity" "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
depends_on: depends_on:
......
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