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 {
echo " Original Author: Raphael Defosseux"
echo " Requirements:"
echo " -- uvtool uvtool-libvirt apt-cacher"
echo " -- xenial image already synced"
echo " -- $VM_OSREL image already synced"
echo " Default:"
echo " -- eNB with USRP"
echo ""
......@@ -33,31 +33,8 @@ function build_usage {
echo "------"
echo " oai-ci-vm-tool build [OPTIONS]"
echo ""
echo "Mandatory Options:"
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 ""
command_options_usage
}
function build_on_vm {
......@@ -95,7 +72,7 @@ function build_on_vm {
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################"
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"
uvt-kvm wait $VM_NAME --insecure
......
......@@ -25,7 +25,7 @@ function create_usage {
echo " Original Author: Raphael Defosseux"
echo " Requirements:"
echo " -- uvtool uvtool-libvirt apt-cacher"
echo " -- xenial image already synced"
echo " -- $VM_OSREL image already synced"
echo " Default:"
echo " -- eNB with USRP"
echo ""
......@@ -90,7 +90,7 @@ function create_vm {
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################"
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"
uvt-kvm wait $VM_NAME --insecure
......
......@@ -30,19 +30,7 @@ function destroy_usage {
echo "------"
echo " oai-ci-vm-tool destroy [OPTIONS]"
echo ""
echo "Mandatory Options:"
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 ""
command_options_usage
}
function destroy_vm {
......
......@@ -52,7 +52,7 @@ The main script is including a bunch of sub BASH scripts.
* ci-scripts/reportBuildLocally.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 #
......@@ -62,7 +62,7 @@ It is also **testing if uvtool and apt-cacher are installed.**
It finally provides parameters to the requested functions. Parameter definition is centralized there.
For example:
For example:
for VM instance creation:
......@@ -75,13 +75,122 @@ for OAI variant build:
* build log file to parse: LOG_PATTERN
* 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)
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 {
echo "------"
echo " oai-ci-vm-tool report-build [OPTIONS]"
echo ""
echo "Options:"
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 ""
command_options_usage
}
function trigger_usage {
......
......@@ -28,56 +28,7 @@ function report_test_usage {
echo "------"
echo " oai-ci-vm-tool report-test [OPTIONS]"
echo ""
echo "Options:"
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 ""
command_options_usage
}
function analyzePingFiles {
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ function wait_usage {
echo " Original Author: Raphael Defosseux"
echo " Requirements:"
echo " -- uvtool uvtool-libvirt apt-cacher"
echo " -- xenial image already synced"
echo " -- $VM_OSREL image already synced"
echo " Default:"
echo " -- eNB with USRP"
echo ""
......@@ -33,28 +33,7 @@ function wait_usage {
echo "------"
echo " oai-ci-vm-tool wait [OPTIONS]"
echo ""
echo "Mandatory Options:"
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 ""
command_options_usage
}
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