Commit ac4937bc authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'feature-34-test_framework' into develop

parents 9122ed72 76000307
...@@ -341,7 +341,7 @@ until [ -z "$1" ] ...@@ -341,7 +341,7 @@ until [ -z "$1" ]
xml_conf="$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml" xml_conf="$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml"
test_case_list=`xmlstarlet sel -T -t -m /xml/testCaseList/testCase -s A:N:- "@id" -v "@id" -n $xml_conf` test_case_list=`xmlstarlet sel -T -t -m /testCaseList/testCase -s A:N:- "@id" -v "@id" -n $xml_conf`
echo "test_case_list = $test_case_list" echo "test_case_list = $test_case_list"
...@@ -372,20 +372,20 @@ for search_expr in "${test_case_array[@]}" ...@@ -372,20 +372,20 @@ for search_expr in "${test_case_array[@]}"
fi fi
name=$search_expr name=$search_expr
class=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/class" $xml_conf` class=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/class" $xml_conf`
desc=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/desc" $xml_conf` desc=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/desc" $xml_conf`
pre_compile_prog=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/pre_compile_prog" $xml_conf` pre_compile_prog=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/pre_compile_prog" $xml_conf`
compile_prog=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/compile_prog" $xml_conf` compile_prog=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog" $xml_conf`
compile_prog_args=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/compile_prog_args" $xml_conf` compile_prog_args=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog_args" $xml_conf`
pre_exec=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/pre_exec" $xml_conf` pre_exec=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/pre_exec" $xml_conf`
pre_exec_args=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/pre_exec_args" $xml_conf` pre_exec_args=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/pre_exec_args" $xml_conf`
main_exec=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/main_exec" $xml_conf` main_exec=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/main_exec" $xml_conf`
main_exec_args=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/main_exec_args" $xml_conf` main_exec_args=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/main_exec_args" $xml_conf`
search_expr_true=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/search_expr_true" $xml_conf` search_expr_true=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/search_expr_true" $xml_conf`
search_expr_false=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/search_expr_false" $xml_conf` search_expr_false=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/search_expr_false" $xml_conf`
nruns=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/nruns" $xml_conf` nruns=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/nruns" $xml_conf`
compile_prog_out=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/compile_prog_out" $xml_conf` compile_prog_out=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog_out" $xml_conf`
tags=`xmlstarlet sel -t -v "/xml/testCaseList/testCase[@id='$search_expr']/tags" $xml_conf` tags=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/tags" $xml_conf`
echo "class = $class" echo "class = $class"
echo "name = $name" echo "name = $name"
...@@ -442,79 +442,3 @@ exit ...@@ -442,79 +442,3 @@ exit
#$1 -> name of test case
#$2 -> name of compilation program
#$3 -> arguments for compilation program
#$4 -> name of pre-executable to install kernel modules, etc
#$5 -> arguments of pre-executable
#$6 -> name of executable
#$7 -> arguments for running the program
#$8 -> search expression ARRAY which needs to be found
#$9 -> search expression which should NOT be found (for ex. segmentation fault)
#$10 -> number of runs
#$11 -> pre compile program
#oaisim tests
search_array=("Received RRCConnectionReconfigurationComplete from UE 0")
test_compile_and_run 010200 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("Received RRCConnectionReconfigurationComplete from UE 0")
test_compile_and_run 010201 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -a -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2")
test_compile_and_run 010202 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2")
test_compile_and_run 010203 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -a -n100" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
#PHY unitary simulations for secuirity tests
search_array=("finished with 0 errors")
test_compile_and_run 010300 "test_aes128_cmac_encrypt" "" "" "" "test_aes128_cmac_encrypt" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010301 "test_aes128_ctr_decrypt" "" "" "" "test_aes128_ctr_decrypt" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010302 "test_aes128_ctr_encrypt" "" "" "" "test_aes128_ctr_encrypt" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010303 "test_secu_kenb" "" "" "" "test_secu_kenb" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010304 "test_secu_knas" "" "" "" "test_secu_knas" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010305 "test_secu_knas_encrypt_eea1" "" "" "" "test_secu_knas_encrypt_eea1" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010306 "test_secu_knas_encrypt_eea2" "" "" "" "test_secu_knas_encrypt_eea2" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010307 "test_secu_knas_encrypt_eia1" "" "" "" "test_secu_knas_encrypt_eia1" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
search_array=("finished with 0 errors")
test_compile_and_run 010308 "test_secu_knas_encrypt_eia2" "" "" "" "test_secu_knas_encrypt_eia2" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fataln" 3
search_array=("finished with 0 errors")
test_compile_and_run 010309 "test_kdf" "" "" "" "test_kdf" " --verbose" "search_array[@]" "segmentation fault|assertion|exiting|fatal" 3
#test_compile_and_run 0200 "oaisim_nos1" "" "$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1" "" "oaisim_nos1" " -O /home/calisson/rohit/oai_snav/taets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -b1 -u1 -a " "RRC_CONN" 3
#run_test 0200 "$dbin/oaisim.r8 -a -A AWGN -n 100" false grep -q '(Segmentation.fault)|(Exiting)|(FATAL)'
#run_test 0201 "$dbin/oaisim.r8 -a -A AWGN -n 100" false fgrep -q '[E]'
# write the test results into a file
xUnit_write "$results_file"
echo "Test Results are written to $results_file"
<xml> <testCaseList>
<MachineList>mozart stevens calisson 192.168.12.62 amerique</MachineList>
<MachineList>mozart stevens calisson nano amerique</MachineList>
<NFSResultsShare>/mnt/sradio/TEST_RESULTS</NFSResultsShare> <NFSResultsShare>/mnt/sradio/TEST_RESULTS</NFSResultsShare>
<GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo> <GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo>
<GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo> <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo>
<GitBranch>develop</GitBranch> <GitOAI5GRepoBranch>feature-34-test_framework</GitOAI5GRepoBranch>
<GitOpenair-cnRepoBranch>develop</GitOpenair-cnRepoBranch>
<testCaseList_lte-softmodem> <CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* ltebox* </CleanUpOldProgs>
<testCase id="015100" >
<class>lte-softmodem</class>
<eNB>calisson</eNB>
<UE>stevens</UE>
<EPC>nano</EPC>
<cleanupScript>killall oaisim; killall lte-softmodem; killall lte-softmodem-nos1; killall mme_gw; killall run_epc; killall run_hss</cleanupScript>
<eNB_working_dir>/tmp</eNB_working_dir>
<eNB_pre_compile_prog></eNB_pre_compile_prog>
<eNB_pre_compile_prog_args></eNB_pre_compile_prog_args>
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai </eNB_compile_prog>
<eNB_compile_prog_args>--eNB -w USRP</eNB_compile_prog_args>
<eNB_pre_exec>iperf </eNB_pre_exec>
<eNB_pre_exec_args></eNB_pre_exec_args>
<eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
<eNB_main_exec_args></eNB_main_exec_args>
<eNB_search_expr_true></eNB_search_expr_true>
<eNB_search_expr_false></eNB_search_expr_false>
<UE_working_dir>/tmp</UE_working_dir>
<UE_pre_compile_prog></UE_pre_compile_prog>
<UE_pre_compile_prog_args></UE_pre_compile_prog_args>
<UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
<UE_compile_prog_args>--eNB -w USRP</UE_compile_prog_args>
<UE_pre_exec>iperf </UE_pre_exec>
<UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</UE_main_exec>
<UE_main_exec_args></UE_main_exec_args>
<UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false>
<UE_working_dir>/tmp</UE_working_dir>
<UE_pre_compile_prog></UE_pre_compile_prog>
<UE_pre_compile_prog_args></UE_pre_compile_prog_args>
<UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
<UE_compile_prog_args>--eNB -w USRP</UE_compile_prog_args>
<UE_pre_exec>iperf </UE_pre_exec>
<UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</UE_main_exec>
<UE_main_exec_args></UE_main_exec_args>
<UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false>
<EPC_working_dir>/tmp</EPC_working_dir>
<EPC_pre_compile_prog></EPC_pre_compile_prog>
<EPC_pre_compile_prog_args></EPC_pre_compile_prog_args>
<EPC_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</EPC_compile_prog>
<EPC_compile_prog_args>--eNB -w USRP</EPC_compile_prog_args>
<EPC_pre_exec>iperf </EPC_pre_exec>
<EPC_pre_exec_args></EPC_pre_exec_args>
<EPC_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</EPC_main_exec>
<EPC_main_exec_args></EPC_main_exec_args>
<EPC_search_expr_true></EPC_search_expr_true>
<EPC_search_expr_false></EPC_search_expr_false>
<TimeOut_ssh>60</TimeOut_ssh>
<TimeOut_cmd>300</TimeOut_cmd>
<nruns>2</nruns>
</testCase>
</testCaseList_lte-softmodem>
<testCaseList>
<testCase id="010101" > <testCase id="010101" >
<class>compilation</class> <class>compilation</class>
<desc>Build oaisim.Rel8</desc> <desc>Build oaisim.Rel8</desc>
...@@ -806,10 +745,69 @@ ...@@ -806,10 +745,69 @@
<nruns>1</nruns> <nruns>1</nruns>
</testCase> </testCase>
<testCase id="015500" >
<class>lte-softmodem</class>
<desc></desc>
<eNB>calisson</eNB>
<UE>stevens</UE>
<EPC>nano</EPC>
<cleanupScript>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* ltebox*</cleanupScript>
<TimeOut_cmd>300</TimeOut_cmd>
</testCaseList> <eNB_working_dir>/tmp</eNB_working_dir>
<eNB_config_file>$OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code 1
$OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code 208
$OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code 95</eNB_config_file>
<eNB_pre_compile_prog></eNB_pre_compile_prog>
<eNB_pre_compile_prog_args></eNB_pre_compile_prog_args>
<eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai </eNB_compile_prog>
<eNB_compile_prog_args>--eNB -w USRP</eNB_compile_prog_args>
<eNB_pre_exec>iperf </eNB_pre_exec>
<eNB_pre_exec_args></eNB_pre_exec_args>
<eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
<eNB_main_exec_args></eNB_main_exec_args>
<eNB_search_expr_true></eNB_search_expr_true>
<eNB_search_expr_false></eNB_search_expr_false>
<UE_working_dir>/tmp</UE_working_dir>
<UE_pre_compile_prog></UE_pre_compile_prog>
<UE_pre_compile_prog_args></UE_pre_compile_prog_args>
<UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
<UE_compile_prog_args>--eNB -w USRP</UE_compile_prog_args>
<UE_pre_exec>iperf </UE_pre_exec>
<UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</UE_main_exec>
<UE_main_exec_args></UE_main_exec_args>
<UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false>
</xml> <UE_working_dir>/tmp</UE_working_dir>
<UE_pre_compile_prog></UE_pre_compile_prog>
<UE_pre_compile_prog_args></UE_pre_compile_prog_args>
<UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
<UE_compile_prog_args>--eNB -w USRP</UE_compile_prog_args>
<UE_pre_exec>iperf </UE_pre_exec>
<UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</UE_main_exec>
<UE_main_exec_args></UE_main_exec_args>
<UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false>
<EPC_working_dir>/tmp</EPC_working_dir>
<EPC_pre_compile_prog></EPC_pre_compile_prog>
<EPC_pre_compile_prog_args></EPC_pre_compile_prog_args>
<EPC_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</EPC_compile_prog>
<EPC_compile_prog_args>--eNB -w USRP</EPC_compile_prog_args>
<EPC_pre_exec>iperf </EPC_pre_exec>
<EPC_pre_exec_args></EPC_pre_exec_args>
<EPC_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</EPC_main_exec>
<EPC_main_exec_args></EPC_main_exec_args>
<EPC_search_expr_true></EPC_search_expr_true>
<EPC_search_expr_false></EPC_search_expr_false>
<nruns>2</nruns>
</testCase>
</testCaseList>
......
#!/bin/bash
#$1 programs to be killed and checked
var=`ps -A |grep -E -i $1`
echo $var
if [ -n \"$var\" ]; then echo 'Match found'; else echo 'Match not found' ;fi
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