Commit c6d43476 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/enhance_CI_extEPC' into develop_integration_2019_w25

parents 8f68d596 983f7597
...@@ -25,7 +25,7 @@ function build_usage { ...@@ -25,7 +25,7 @@ function build_usage {
echo " Original Author: Raphael Defosseux" echo " Original Author: Raphael Defosseux"
echo " Requirements:" echo " Requirements:"
echo " -- uvtool uvtool-libvirt apt-cacher" echo " -- uvtool uvtool-libvirt apt-cacher"
echo " -- xenial image already synced" echo " -- $VM_OSREL image already synced"
echo " Default:" echo " Default:"
echo " -- eNB with USRP" echo " -- eNB with USRP"
echo "" echo ""
...@@ -33,31 +33,8 @@ function build_usage { ...@@ -33,31 +33,8 @@ function build_usage {
echo "------" echo "------"
echo " oai-ci-vm-tool build [OPTIONS]" echo " oai-ci-vm-tool build [OPTIONS]"
echo "" echo ""
echo "Mandatory Options:" command_options_usage
echo "--------"
echo " --job-name #### OR -jn ####"
echo " Specify the name of the Jenkins job."
echo ""
echo " --build-id #### OR -id ####"
echo " Specify the build ID of the Jenkins job."
echo ""
echo " --workspace #### OR -ws ####"
echo " Specify the workspace."
echo ""
echo "Options:"
echo "--------"
variant_usage
echo " Specify the variant to build."
echo ""
echo " --keep-vm-alive OR -k"
echo " Keep the VM alive after the build."
echo ""
echo " --daemon OR -D"
echo " Run as daemon"
echo ""
echo " --help OR -h"
echo " Print this help message."
echo ""
} }
function build_on_vm { function build_on_vm {
...@@ -95,7 +72,7 @@ function build_on_vm { ...@@ -95,7 +72,7 @@ function build_on_vm {
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################" echo "############################################################"
acquire_vm_create_lock acquire_vm_create_lock
uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml
echo "Waiting for VM to be started" echo "Waiting for VM to be started"
uvt-kvm wait $VM_NAME --insecure uvt-kvm wait $VM_NAME --insecure
......
...@@ -25,7 +25,7 @@ function create_usage { ...@@ -25,7 +25,7 @@ function create_usage {
echo " Original Author: Raphael Defosseux" echo " Original Author: Raphael Defosseux"
echo " Requirements:" echo " Requirements:"
echo " -- uvtool uvtool-libvirt apt-cacher" echo " -- uvtool uvtool-libvirt apt-cacher"
echo " -- xenial image already synced" echo " -- $VM_OSREL image already synced"
echo " Default:" echo " Default:"
echo " -- eNB with USRP" echo " -- eNB with USRP"
echo "" echo ""
...@@ -90,7 +90,7 @@ function create_vm { ...@@ -90,7 +90,7 @@ function create_vm {
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################" echo "############################################################"
acquire_vm_create_lock acquire_vm_create_lock
uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml
echo "Waiting for VM to be started" echo "Waiting for VM to be started"
uvt-kvm wait $VM_NAME --insecure uvt-kvm wait $VM_NAME --insecure
......
...@@ -30,19 +30,7 @@ function destroy_usage { ...@@ -30,19 +30,7 @@ function destroy_usage {
echo "------" echo "------"
echo " oai-ci-vm-tool destroy [OPTIONS]" echo " oai-ci-vm-tool destroy [OPTIONS]"
echo "" echo ""
echo "Mandatory Options:" command_options_usage
echo "--------"
echo " --job-name #### OR -jn ####"
echo " Specify the name of the Jenkins job."
echo ""
echo " --build-id #### OR -id ####"
echo " Specify the build ID of the Jenkins job."
echo ""
echo "Options:"
echo "--------"
echo " --help OR -h"
echo " Print this help message."
echo ""
} }
function destroy_vm { function destroy_vm {
......
...@@ -52,7 +52,7 @@ The main script is including a bunch of sub BASH scripts. ...@@ -52,7 +52,7 @@ The main script is including a bunch of sub BASH scripts.
* ci-scripts/reportBuildLocally.sh * ci-scripts/reportBuildLocally.sh
* ci-scripts/reportTestLocally.sh * ci-scripts/reportTestLocally.sh
**NOTE: ci-scripts/runTestOnVM.sh is getting big and will certainly be split to facilate maintenance. Start functions will be also factorized.** **NOTE: ci-scripts/runTestOnVM.sh is getting big and will certainly be split to facilitate maintenance. Start functions will be also factorized.**
# 3. Main script features # # 3. Main script features #
...@@ -75,13 +75,122 @@ for OAI variant build: ...@@ -75,13 +75,122 @@ for OAI variant build:
* build log file to parse: LOG_PATTERN * build log file to parse: LOG_PATTERN
* the number of log files to parse: NB_PATTERN_FILES * the number of log files to parse: NB_PATTERN_FILES
These last 2 variables are very important if you change the build options or if you modify the build system and add more targets to build (especially true for physical simulator). You can get the list of variant specific variables specifying the variant argument when asking for help:
``` bash
./ci-scripts/oai-ci-vm-tool help variant
--variant flexran-rtc OR -v10 ( build and test non-OSA )
VM_NAME=ci-flexran-rtc ARCHIVES_LOC=flexran
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=1 BUILD_OPTIONS="cmake . && make -j2"
LOG_PATTERN=.Rel14.txt
--variant enb-usrp OR -v1 ( build and test )
VM_NAME=ci-enb-usrp ARCHIVES_LOC=enb_usrp
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS="--eNB -w USRP --mu"
LOG_PATTERN=.Rel14.txt
--variant l1-sim OR -v20 ( test )
VM_NAME=ci-l1-sim ARCHIVES_LOC=l1_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS=""
LOG_PATTERN=.Rel14.txt
--variant rf-sim OR -v21 ( test )
VM_NAME=ci-rf-sim ARCHIVES_LOC=rf_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS=""
LOG_PATTERN=.Rel14.txt
--variant l2-sim OR -v22 ( test )
VM_NAME=ci-l2-sim ARCHIVES_LOC=l2_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS=""
LOG_PATTERN=.Rel14.txt
--variant basic-sim OR -v2 ( build and test )
VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim
VM_MEMORY=8192 VM_CPU=4
NB_PATTERN_FILES=13 BUILD_OPTIONS="--eNB --UE"
LOG_PATTERN=.Rel14.txt
--variant phy-sim OR -v3 ( build and test )
VM_NAME=ci-phy-sim ARCHIVES_LOC=phy_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=3 BUILD_OPTIONS="--phy_simulators"
LOG_PATTERN=.Rel14.txt
--variant cppcheck OR -v4 ( build and test )
VM_NAME=ci-cppcheck ARCHIVES_LOC=cppcheck
VM_MEMORY=4096 VM_CPU=4
NB_PATTERN_FILES=1 BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -j4"
LOG_PATTERN=cppcheck.xml
--variant enb-ethernet OR -v7 ( build and test )
VM_NAME=ci-enb-ethernet ARCHIVES_LOC=enb_eth
VM_MEMORY=4096 VM_CPU=4
NB_PATTERN_FILES=8 BUILD_OPTIONS="--eNB"
LOG_PATTERN=.Rel14.txt
--variant ue-ethernet OR -v8 ( build and test )
VM_NAME=ci-ue-ethernet ARCHIVES_LOC=ue_eth
VM_MEMORY=4096 VM_CPU=4
NB_PATTERN_FILES=12 BUILD_OPTIONS="--UE"
LOG_PATTERN=.Rel14.txt
There are many more variables. ```
To define a new variant you just need to define a function which name conforms to `function variant__v<n>__<variant_name>` where n and variant_name will respectively define the short and long options for your variant. The function only needs to define the variant dependent variables. For many variables, default values are set in the `check_set_variant` function. When a variant doesn't define the BUILD_OPTIONS variable it cannot be used for the `build` `wait` and `create` commands.
The main scripts also allows the definition of non variant-dependant variable via the `--setvar_<variable name> <variable value>` options.
You can get the list of these variables by using `help setvar`:
```BASH
./ci-scripts/oai-ci-vm-tool help setvar
--setvar_<varname> <value> where varname is one of:
VM_OSREL : OS release to use in virtual machines
RUN_EXPERIMENTAL : Enforce execution of variants with EXPERIMENTAL variable set to "true"
```
To add a new non-variant dependant variable you need:
* Add an item to the `AUTHORIZED_VAR` array
* In the `setvar_usage`function, add your help string in the HELP_VAR["<your variable name>"] variable.
* Write the bash code for your variable.
Example of non variant dependent usage:
``` bash
./ci-scripts/oai-ci-vm-tool test -v21 -ws /usr/local/oai/enhance_CI_extEPC/openairinterface5g -id 1 -jn testci
Currently testci-b1-rf-sim Testing is not implemented / enabled
Comment out these lines in ./ci-scripts/oai-ci-vm-tool if you want to run it
or use option --setvar_RUN_EXPERIMENTAL=true to test it
./ci-scripts/oai-ci-vm-tool test -v21 -ws /usr/local/oai/enhance_CI_extEPC/openairinterface5g -id 1 -jn testci --setvar_RUN_EXPERIMENTAL true
Setting RUN_EXPERIMENTAL to true...
############################################################
OAI CI VM script
############################################################
ENB_VM_NAME = testci-b1-enb-ethernet
ENB_VM_CMD_FILE = testci-b1-enb-ethernet_cmds.txt
UE_VM_NAME = testci-b1-ue-ethernet
UE_VM_CMD_FILE = testci-b1-ue-ethernet_cmds.txt
JENKINS_WKSP = /usr/local/oai/enhance_CI_extEPC/openairinterface5g
ARCHIVES_LOC = /usr/local/oai/enhance_CI_extEPC/openairinterface5g/archives/rf_sim/test
############################################################
Waiting for ENB VM to be started
...........................
```
In the same way, you can set the variable `VM_OSREL` to run the test in virtual machines of the specified OS release:
``` bash
./ci-scripts/oai-ci-vm-tool test -v21 -ws /usr/local/oai/enhance_CI_extEPC/openairinterface5g -id 1 -jn testci --setvar_VM_OSREL bionic
```
--- ---
Next step: [how to create one or several VM instances](./vm_based_simulator_create.md) Next step: [how to create one or several VM instances](./vm_based_simulator_create.md)
You can also go back to the [CI dev main page](./ci_dev_home.md) You can also go back to the [CI dev main page](./ci_dev_home.md)
This diff is collapsed.
...@@ -28,56 +28,8 @@ function report_build_usage { ...@@ -28,56 +28,8 @@ function report_build_usage {
echo "------" echo "------"
echo " oai-ci-vm-tool report-build [OPTIONS]" echo " oai-ci-vm-tool report-build [OPTIONS]"
echo "" echo ""
echo "Options:" command_options_usage
echo "--------"
echo ""
echo " --help OR -h"
echo " Print this help message."
echo ""
echo "Job Options:"
echo "------------"
echo ""
echo " --git-url #### OR -gu ####"
echo " Specify the URL of the GIT Repository."
echo ""
echo " --job-name #### OR -jn ####"
echo " Specify the name of the Jenkins job."
echo ""
echo " --build-id #### OR -id ####"
echo " Specify the build ID of the Jenkins job."
echo ""
echo " --workspace #### OR -ws ####"
echo " Specify the workspace."
echo ""
echo " --trigger merge-request OR -mr"
echo " --trigger push OR -pu"
echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
echo ""
echo "Merge-Request Options:"
echo "----------------------"
echo ""
echo " --src-branch #### OR -sb ####"
echo " Specify the source branch of the merge request."
echo ""
echo " --src-commit #### OR -sc ####"
echo " Specify the source commit ID (SHA-1) of the merge request."
echo ""
echo " --target-branch #### OR -tb ####"
echo " Specify the target branch of the merge request (usually develop)."
echo ""
echo " --target-commit #### OR -tc ####"
echo " Specify the target commit ID (SHA-1) of the merge request."
echo ""
echo "Push Options:"
echo "----------------------"
echo ""
echo " --branch #### OR -br ####"
echo " Specify the branch of the push event."
echo ""
echo " --commit #### OR -co ####"
echo " Specify the commit ID (SHA-1) of the push event."
echo ""
echo ""
} }
function trigger_usage { function trigger_usage {
......
...@@ -28,56 +28,7 @@ function report_test_usage { ...@@ -28,56 +28,7 @@ function report_test_usage {
echo "------" echo "------"
echo " oai-ci-vm-tool report-test [OPTIONS]" echo " oai-ci-vm-tool report-test [OPTIONS]"
echo "" echo ""
echo "Options:" command_options_usage
echo "--------"
echo ""
echo " --help OR -h"
echo " Print this help message."
echo ""
echo "Job Options:"
echo "------------"
echo ""
echo " --git-url #### OR -gu ####"
echo " Specify the URL of the GIT Repository."
echo ""
echo " --job-name #### OR -jn ####"
echo " Specify the name of the Jenkins job."
echo ""
echo " --build-id #### OR -id ####"
echo " Specify the build ID of the Jenkins job."
echo ""
echo " --workspace #### OR -ws ####"
echo " Specify the workspace."
echo ""
echo " --trigger merge-request OR -mr"
echo " --trigger push OR -pu"
echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
echo ""
echo "Merge-Request Options:"
echo "----------------------"
echo ""
echo " --src-branch #### OR -sb ####"
echo " Specify the source branch of the merge request."
echo ""
echo " --src-commit #### OR -sc ####"
echo " Specify the source commit ID (SHA-1) of the merge request."
echo ""
echo " --target-branch #### OR -tb ####"
echo " Specify the target branch of the merge request (usually develop)."
echo ""
echo " --target-commit #### OR -tc ####"
echo " Specify the target commit ID (SHA-1) of the merge request."
echo ""
echo "Push Options:"
echo "----------------------"
echo ""
echo " --branch #### OR -br ####"
echo " Specify the branch of the push event."
echo ""
echo " --commit #### OR -co ####"
echo " Specify the commit ID (SHA-1) of the push event."
echo ""
echo ""
} }
function analyzePingFiles { function analyzePingFiles {
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
# * contact@openairinterface.org # * contact@openairinterface.org
# */ # */
function run_test_usage { function test_usage {
echo "OAI CI VM script" echo "OAI CI VM script"
echo " Original Author: Raphael Defosseux" echo " Original Author: Raphael Defosseux"
echo " Requirements:" echo " Requirements:"
echo " -- uvtool uvtool-libvirt apt-cacher" echo " -- uvtool uvtool-libvirt apt-cacher"
echo " -- xenial image already synced" echo " -- $VM_OSREL image already synced"
echo " Default:" echo " Default:"
echo " -- eNB with USRP" echo " -- eNB with USRP"
echo "" echo ""
...@@ -33,26 +33,7 @@ function run_test_usage { ...@@ -33,26 +33,7 @@ function run_test_usage {
echo "------" echo "------"
echo " oai-ci-vm-tool test [OPTIONS]" echo " oai-ci-vm-tool test [OPTIONS]"
echo "" echo ""
echo "Options:" command_options_usage
echo "--------"
echo " --job-name #### OR -jn ####"
echo " Specify the name of the Jenkins job."
echo ""
echo " --build-id #### OR -id ####"
echo " Specify the build ID of the Jenkins job."
echo ""
echo " --workspace #### OR -ws ####"
echo " Specify the workspace."
echo ""
variant_usage
echo " Specify the variant to build."
echo ""
echo " --keep-vm-alive OR -k"
echo " Keep the VM alive after the build."
echo ""
echo " --help OR -h"
echo " Print this help message."
echo ""
} }
function start_basic_sim_enb { function start_basic_sim_enb {
...@@ -126,7 +107,7 @@ function start_basic_sim_ue { ...@@ -126,7 +107,7 @@ function start_basic_sim_ue {
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" > $1 echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" > $1
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1
echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build" >> $1
echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options level,nocolor --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1 echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options nocolor,level --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1
echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1 echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1
echo "cat ./my-lte-uesoftmodem-run.sh" >> $1 echo "cat ./my-lte-uesoftmodem-run.sh" >> $1
echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1 echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1
...@@ -483,7 +464,7 @@ function install_epc_on_vm { ...@@ -483,7 +464,7 @@ function install_epc_on_vm {
echo "Creating test EPC VM ($LOC_EPC_VM_NAME) on Ubuntu Cloud Image base" echo "Creating test EPC VM ($LOC_EPC_VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################" echo "############################################################"
acquire_vm_create_lock acquire_vm_create_lock
uvt-kvm create $LOC_EPC_VM_NAME release=xenial --unsafe-caching uvt-kvm create $LOC_EPC_VM_NAME release=$VM_OSREL --unsafe-caching
echo "Waiting for VM to be started" echo "Waiting for VM to be started"
uvt-kvm wait $LOC_EPC_VM_NAME --insecure uvt-kvm wait $LOC_EPC_VM_NAME --insecure
release_vm_create_lock release_vm_create_lock
...@@ -629,14 +610,19 @@ function retrieve_real_epc_ip_addr { ...@@ -629,14 +610,19 @@ function retrieve_real_epc_ip_addr {
local LOC_EPC_VM_CMDS=$2 local LOC_EPC_VM_CMDS=$2
local LOC_EPC_VM_IP_ADDR=$3 local LOC_EPC_VM_IP_ADDR=$3
if [[ "$EPC_IPADDR" == "" ]]
then
if [ $LTEBOX -eq 1 ] if [ $LTEBOX -eq 1 ]
then then
# in our configuration file, we are using pool 5 # in our configuration file, we are using pool 5
echo "ifconfig tun5 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $LOC_EPC_VM_CMDS echo "ifconfig tun5 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $LOC_EPC_VM_CMDS
REAL_EPC_IP_ADDR=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS` REAL_EPC_IP_ADDR=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS`
echo "EPC IP Address is : $REAL_EPC_IP_ADDR"
rm $LOC_EPC_VM_CMDS rm $LOC_EPC_VM_CMDS
fi fi
else
REAL_EPC_IP_ADDR=$EPC_TUN_IPADDR
fi
echo "EPC IP Address is : $REAL_EPC_IP_ADDR"
} }
function terminate_epc { function terminate_epc {
...@@ -1093,7 +1079,7 @@ function run_test_on_vm { ...@@ -1093,7 +1079,7 @@ function run_test_on_vm {
echo "############################################################" echo "############################################################"
echo "OAI CI VM script" echo "OAI CI VM script"
echo "############################################################" echo "############################################################"
if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) || (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]] if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) ]] || [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]]
then then
ENB_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#enb-ethernet#" -e "s#rf-sim#enb-ethernet#"` ENB_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#enb-ethernet#" -e "s#rf-sim#enb-ethernet#"`
ENB_VM_CMDS=${ENB_VM_NAME}_cmds.txt ENB_VM_CMDS=${ENB_VM_NAME}_cmds.txt
...@@ -1110,7 +1096,7 @@ function run_test_on_vm { ...@@ -1110,7 +1096,7 @@ function run_test_on_vm {
echo "JENKINS_WKSP = $JENKINS_WKSP" echo "JENKINS_WKSP = $JENKINS_WKSP"
echo "ARCHIVES_LOC = $ARCHIVES_LOC" echo "ARCHIVES_LOC = $ARCHIVES_LOC"
if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) || (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]] if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* )) ]] || [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]]
then then
echo "############################################################" echo "############################################################"
echo "Waiting for ENB VM to be started" echo "Waiting for ENB VM to be started"
...@@ -1261,17 +1247,28 @@ function run_test_on_vm { ...@@ -1261,17 +1247,28 @@ function run_test_on_vm {
EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"` EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"`
EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt
LTEBOX=0 LTEBOX=0
if [[ "$EPC_IPADDR" == "" ]]
then
# Creating a VM for EPC and installing SW
install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS
EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME`
# Starting EPC # Starting EPC
start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
else
echo "We will use EPC on $EPC_IPADDR"
EPC_VM_IP_ADDR=$EPC_IPADDR
fi
# Retrieve EPC real IP address # Retrieve EPC real IP address
retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
TRANS_MODES=("fdd" "tdd")
BW_CASES=(05 10 20) #TRANS_MODES=("fdd" "tdd")
#BW_CASES=(05 10 20)
TRANS_MODES=("fdd")
BW_CASES=(05)
for TMODE in ${TRANS_MODES[@]} for TMODE in ${TRANS_MODES[@]}
do do
...@@ -1305,6 +1302,9 @@ function run_test_on_vm { ...@@ -1305,6 +1302,9 @@ function run_test_on_vm {
fi fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1 get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1
full_terminate
continue
echo "############################################################" echo "############################################################"
echo "Pinging the UE" echo "Pinging the UE"
echo "############################################################" echo "############################################################"
...@@ -1446,7 +1446,10 @@ function run_test_on_vm { ...@@ -1446,7 +1446,10 @@ function run_test_on_vm {
echo "Terminate EPC" echo "Terminate EPC"
echo "############################################################" echo "############################################################"
if [[ "$EPC_IPADDR" == "" ]]
then
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
fi
full_basic_sim_destroy full_basic_sim_destroy
...@@ -1474,33 +1477,43 @@ function run_test_on_vm { ...@@ -1474,33 +1477,43 @@ function run_test_on_vm {
rm -Rf $ARCHIVES_LOC rm -Rf $ARCHIVES_LOC
fi fi
mkdir --parents $ARCHIVES_LOC mkdir --parents $ARCHIVES_LOC
if [[ "$EPC_IPADDR" == "" ]]
then
# Creating a VM for EPC and installing SW # Creating a VM for EPC and installing SW
EPC_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#epc#"` EPC_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#epc#"`
EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt
LTEBOX=0 LTEBOX=0
install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS
EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME`
fi
# withS1 configuration is not working # withS1 configuration is not working
#EPC_CONFIGS=("wS1" "noS1") #EPC_CONFIGS=("wS1" "noS1")
#TRANS_MODES=("fdd" "tdd") #TRANS_MODES=("fdd" "tdd")
#BW_CASES=(05 10 20) #BW_CASES=(05 10 20)
EPC_CONFIGS=("noS1") EPC_CONFIGS=("noS1" "wS1")
TRANS_MODES=("fdd") TRANS_MODES=("fdd")
BW_CASES=(05) BW_CASES=(05)
for CN_CONFIG in ${EPC_CONFIGS[@]} for CN_CONFIG in ${EPC_CONFIGS[@]}
do do
if [[ $CN_CONFIG =~ .*wS1.* ]] if [[ $CN_CONFIG =~ .*wS1.* ]]
then
if [[ "$EPC_IPADDR" == "" ]]
then then
echo "############################################################" echo "############################################################"
echo "Start EPC for the wS1 configuration" echo "Start EPC for the wS1 configuration"
echo "############################################################" echo "############################################################"
start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
# Retrieve EPC real IP address # Retrieve EPC real IP address
retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
S1_NOS1_CFG=1 S1_NOS1_CFG=1
else
echo "############################################################"
echo "Using external EPC " $EPC_IPADDR
echo "############################################################"
$EPC_VM_IP_ADDR=$EPC_IPADDR
S1_NOS1_CFG=1
LTEBOX=0
fi
else else
echo "############################################################" echo "############################################################"
echo "Terminate EPC" echo "Terminate EPC"
...@@ -1508,7 +1521,7 @@ function run_test_on_vm { ...@@ -1508,7 +1521,7 @@ function run_test_on_vm {
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "############################################################" echo "############################################################"
echo "Running now in a no-S1 configuration" echo "Running now in a no-S1 "
echo "############################################################" echo "############################################################"
S1_NOS1_CFG=0 S1_NOS1_CFG=0
fi fi
...@@ -1532,7 +1545,7 @@ function run_test_on_vm { ...@@ -1532,7 +1545,7 @@ function run_test_on_vm {
echo "${CN_CONFIG} : Starting the eNB in ${TMODE}-${BW}MHz mode" echo "${CN_CONFIG} : Starting the eNB in ${TMODE}-${BW}MHz mode"
echo "############################################################" echo "############################################################"
CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_enb.log CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_enb.log
start_rf_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG start_rf_sim_enb $ENB_VM_CMDS "$ENB_VM_IP_ADDR" "$EPC_VM_IP_ADDR" $CURRENT_ENB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG
echo "############################################################" echo "############################################################"
echo "${CN_CONFIG} : Starting the UE" echo "${CN_CONFIG} : Starting the UE"
......
...@@ -25,7 +25,7 @@ function wait_usage { ...@@ -25,7 +25,7 @@ function wait_usage {
echo " Original Author: Raphael Defosseux" echo " Original Author: Raphael Defosseux"
echo " Requirements:" echo " Requirements:"
echo " -- uvtool uvtool-libvirt apt-cacher" echo " -- uvtool uvtool-libvirt apt-cacher"
echo " -- xenial image already synced" echo " -- $VM_OSREL image already synced"
echo " Default:" echo " Default:"
echo " -- eNB with USRP" echo " -- eNB with USRP"
echo "" echo ""
...@@ -33,28 +33,7 @@ function wait_usage { ...@@ -33,28 +33,7 @@ function wait_usage {
echo "------" echo "------"
echo " oai-ci-vm-tool wait [OPTIONS]" echo " oai-ci-vm-tool wait [OPTIONS]"
echo "" echo ""
echo "Mandatory Options:" command_options_usage
echo "--------"
echo " --job-name #### OR -jn ####"
echo " Specify the name of the Jenkins job."
echo ""
echo " --build-id #### OR -id ####"
echo " Specify the build ID of the Jenkins job."
echo ""
echo " --workspace #### OR -ws ####"
echo " Specify the workspace."
echo ""
variant_usage
echo " Specify the variant to build."
echo ""
echo "Options:"
echo "--------"
echo " --keep-vm-alive OR -k"
echo " Keep the VM alive after the build."
echo ""
echo " --help OR -h"
echo " Print this help message."
echo ""
} }
function wait_on_vm_build { function wait_on_vm_build {
......
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