feat(ci): adding automation for 5G NR SA L2 simulator with Proxy
- Adding new templates for nFAPI in gNB and NR-UE images - Better entrypoint for NR-UE (alignment on others) - New Test method: StatsFromGenObject - At deployment, image name, size and date are printed - Initial scenario with 1 NR-UE and just ping operations - Trigger new child sub-pipeline for L2-sim-5G tests Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#-----------------------------------------------------------
|
||||
# Import
|
||||
#-----------------------------------------------------------
|
||||
import glob
|
||||
import re
|
||||
import yaml
|
||||
import os
|
||||
@@ -33,7 +34,8 @@ 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"]}')
|
||||
initial_path = f'{data[0]["paths"]["source_dir"]}'
|
||||
dir = glob.glob(initial_path + '/**/*.conf', recursive=True)
|
||||
|
||||
#identify configs, read and replace corresponding values
|
||||
for config in data[1]["configurations"]:
|
||||
@@ -42,7 +44,10 @@ def main():
|
||||
print('================================================')
|
||||
print('filePrefix = ' + filePrefix)
|
||||
print('outputfilename = ' + outputfilename)
|
||||
found = False
|
||||
for inputfile in dir:
|
||||
if found:
|
||||
continue
|
||||
if inputfile.find(filePrefix) >=0:
|
||||
prefix_outputfile = {"cu.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"du.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
@@ -58,10 +63,13 @@ def main():
|
||||
"gnb.sa.band66.fr1.106PRB.usrpn300.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"proxy_nr-ue.nfapi.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
|
||||
"ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
|
||||
}
|
||||
print('inputfile = ' + inputfile)
|
||||
found = True
|
||||
if filePrefix in prefix_outputfile:
|
||||
outputfile1 = prefix_outputfile[filePrefix]
|
||||
|
||||
@@ -69,7 +77,7 @@ def main():
|
||||
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, \
|
||||
with open(f'{inputfile}', mode='r') as inputfile, \
|
||||
open(outputfile1, mode='w') as outputfile:
|
||||
for line in inputfile:
|
||||
count = 0
|
||||
|
||||
@@ -11,8 +11,9 @@ THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD}
|
||||
if [[ -v USE_NSA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi
|
||||
if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi
|
||||
if [[ -v USE_SA_FDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.fdd.conf $PREFIX/etc/gnb.conf; fi
|
||||
if [[ -v USE_SA_CU ]]; then ln -s $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi
|
||||
if [[ -v USE_SA_CU ]]; then cp $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi
|
||||
if [[ -v USE_SA_TDD_CU ]]; then cp $PREFIX/etc/gnb.sa.du.tdd.conf $PREFIX/etc/gnb.conf; fi
|
||||
if [[ -v USE_SA_NFAPI_VNF ]]; then cp $PREFIX/etc/gnb.sa.nfapi.vnf.conf $PREFIX/etc/gnb.conf; fi
|
||||
# Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself.
|
||||
if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.conf; fi
|
||||
|
||||
|
||||
@@ -202,3 +202,39 @@
|
||||
- key: remote_n_portd
|
||||
env: "@F1_CU_D_PORT@"
|
||||
|
||||
- filePrefix: proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf
|
||||
outputfilename: "gnb.sa.nfapi.vnf.conf"
|
||||
config:
|
||||
- key: Active_gNBs
|
||||
env: "@GNB_NAME@"
|
||||
- key: gNB_name
|
||||
env: "@GNB_NAME@"
|
||||
- key: mcc
|
||||
env: "@MCC@"
|
||||
- key: mnc
|
||||
env: "@MNC@"
|
||||
- key: mnc_length
|
||||
env: "@MNC_LENGTH@"
|
||||
- key: tracking_area_code
|
||||
env: "@TAC@"
|
||||
- key: sst
|
||||
env: "@NSSAI_SST@"
|
||||
- key: ipv4
|
||||
env: "@AMF_IP_ADDRESS@"
|
||||
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
|
||||
env: "@GNB_NGA_IF_NAME@"
|
||||
- key: GNB_IPV4_ADDRESS_FOR_NG_AMF
|
||||
env: "@GNB_NGA_IP_ADDRESS@"
|
||||
- key: GNB_INTERFACE_NAME_FOR_NGU
|
||||
env: "@GNB_NGU_IF_NAME@"
|
||||
- key: GNB_IPV4_ADDRESS_FOR_NGU
|
||||
env: "@GNB_NGU_IP_ADDRESS@"
|
||||
- key: parallel_config
|
||||
env: "@THREAD_PARALLEL_CONFIG@"
|
||||
- key: local_s_if_name
|
||||
env: "@LOCAL_S_IF_NAME@"
|
||||
- key: remote_s_address
|
||||
env: "@REMOTE_S_ADDRESS@"
|
||||
- key: local_s_address
|
||||
env: "@LOCAL_S_ADDRESS@"
|
||||
|
||||
|
||||
@@ -5,12 +5,22 @@ set -euo pipefail
|
||||
PREFIX=/opt/oai-nr-ue
|
||||
|
||||
# Based another env var, pick one template to use
|
||||
#if [[ -v USE_NFAPI ]]; then cp $PREFIX/etc/ue.nfapi.conf $PREFIX/etc/ue.conf; fi
|
||||
if [[ -v USE_NFAPI ]]; then cp $PREFIX/etc/nr-ue.nfapi.conf $PREFIX/etc/nr-ue.conf; fi
|
||||
# Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself.
|
||||
if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/nr-ue.conf; fi
|
||||
# if none, pick the default
|
||||
if [ ! -f $PREFIX/etc/nr-ue.conf ]; then cp $PREFIX/etc/nr-ue-sim.conf $PREFIX/etc/nr-ue.conf; fi
|
||||
|
||||
# Only this template will be manipulated and the USIM one!
|
||||
CONFIG_FILES=`ls $PREFIX/etc/ue.conf $PREFIX/etc/nr-ue-sim.conf || true`
|
||||
# Only this template will be manipulated
|
||||
CONFIG_FILES=`ls $PREFIX/etc/nr-ue.conf || true`
|
||||
|
||||
for c in ${CONFIG_FILES}; do
|
||||
# Sometimes templates have no pattern to be replaced.
|
||||
if ! grep -oP '@[a-zA-Z0-9_]+@' ${c}; then
|
||||
echo "Configuration is already set"
|
||||
break
|
||||
fi
|
||||
|
||||
# grep variable names (format: ${VAR}) from template to be rendered
|
||||
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#/*
|
||||
# * 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: proxy_nr-ue.nfapi.conf
|
||||
outputfilename: "nr-ue.nfapi.conf"
|
||||
config:
|
||||
- key: imsi
|
||||
env: "@FULL_IMSI@"
|
||||
- key: key
|
||||
env: "@FULL_KEY@"
|
||||
- key: opc
|
||||
env: "@OPC@"
|
||||
- key: dnn
|
||||
env: "@DNN@"
|
||||
- key: nssai_sst
|
||||
env: "@NSSAI_SST@"
|
||||
- key: nssai_sd
|
||||
env: "@NSSAI_SD@"
|
||||
- key: remote_n_address
|
||||
env: "@GNB_IP_ADDRESS@"
|
||||
- key: local_n_address
|
||||
env: "@NR_UE_IP_ADDRESS@"
|
||||
- key: local_n_if_name
|
||||
env: "@NR_UE_NFAPI_IF_NAME@"
|
||||
|
||||
Reference in New Issue
Block a user