Commit 4b7dda33 authored by Rohit Gupta's avatar Rohit Gupta
Browse files

Merge branch 'feature-34-test_framework' into develop

parents 23bb81d2 1c0a59ff
......@@ -88,7 +88,22 @@ Obj.# Case# Test# Description
01 51 06 mbmssim (TBD)
01 55 lte-softmodem tests
01 55 lte-softmodem tests with ALU EPC w/ Bandrich COTS UE
01 55 00 FDD 5MHz UL Throughput for 60 sec
01 55 00 FDD 10MHz UL Throughput for 60 sec
01 55 00 FDD 20MHz UL Throughput for 60 sec
01 55 00 FDD 5MHz DL Throughput for 60 sec
01 55 00 FDD 10MHz DL Throughput for 60 sec
01 55 00 FDD 20MHz DL Throughput for 60 sec
01 56 lte-softmodem tests with OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 57 lte-softmodem tests with OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 58 lte-softmodem-noS1 tests
02 Functional test case
......
......@@ -7,12 +7,15 @@ else
exit 1
fi
trap handle_ctrl_c INT
source $OPENAIR_DIR/cmake_targets/tools/test_helper
#SUDO="sudo -E "
tdir=$OPENAIR_DIR/cmake_targets/autotests
rm -fr $tdir/bin $tdir/log
mkdir -p $tdir/bin $tdir/log
rm -fr $tdir/bin
mkdir -p $tdir/bin
results_file="$tdir/log/results_autotests.xml"
updated=$(svn st -q $OPENAIR_DIR)
......@@ -36,7 +39,7 @@ cd $tdir
#\param $12 -> class of the test case (compilation, execution)
#\param $13 -> output of compilation program that needs to be found for test case to pass
#\param $14 -> tags to help identify the test case for readability in output xml file
test_compile() {
function test_compile() {
xUnit_start
test_case_name=$1
......@@ -130,8 +133,9 @@ test_compile() {
#\param $12 -> class of the test case (compilation, execution)
#\param $13 -> output of compilation program that needs to be found for test case to pass
#\param $14 -> tags to help identify the test case for readability in output xml file
#\param $15 => password for the user to run certain commands as sudo
test_compile_and_run() {
function test_compile_and_run() {
xUnit_start
test_case_name=$1
log_dir=$tdir/log
......@@ -149,16 +153,13 @@ test_compile_and_run() {
class=${12}
compile_prog_out=${13}
tags=${14}
mypassword=${15}
build_dir=$tdir/$1/build
exec_file=$build_dir/$6
#Temporary log file where execution log is stored.
temp_exec_log=$log_dir/temp_log.txt
#echo "log_dir = $log_dir"
#echo "log_file = $log_file"
#echo "exec_file = $exec_file"
......@@ -217,7 +218,8 @@ test_compile_and_run() {
echo "<EXECUTION LOG Run = $run_index >" >> $log_file 2>&1
if [ -n "$pre_exec_file" ]; then
{ eval "source $pre_exec_file $pre_exec_args"; } >> $log_file 2>&1
{ eval " echo '$mypassword' |sudo -S -E $pre_exec_file $pre_exec_args " ; }>> $log_file 2>&1
fi
echo "Executing $exec_file $main_exec_args_array_index "
echo "Executing $exec_file $main_exec_args_array_index " >> $log_file
......@@ -275,34 +277,14 @@ test_compile_and_run() {
let "tags_array_index++"
done # End of for loop (nindex)
fi
rm -fr $build_dir
}
dbin=$OPENAIR_DIR/cmake_targets/autotests/bin
dlog=$OPENAIR_DIR/cmake_targets/autotests/log
run_test() {
case=case$1; shift
cmd=$1; shift
expected=$3; shift
echo "expected = $expected"
exit
$cmd > $dlog/$case.txt 2>&1
if [ $expected = "true" ] ; then
if $* $dlog/$case.txt; then
echo_success "test $case, command: $cmd ok"
else
echo_error "test $case, command: $cmd Failed"
fi
else
if $* $dlog/$case.txt; then
echo_error "test $case, command: $cmd Failed"
else
echo_success "test $case, command: $cmd ok"
fi
fi
}
print_help() {
function print_help() {
echo_info '
This program runs automated test case system for OpenAirInterface
You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14
......@@ -314,11 +296,13 @@ Options
'
}
main () {
function main () {
RUN_GROUP=0
test_case_group=""
test_case_group_array=()
test_case_array=()
echo_info "Note that the user should be sudoer for executing certain commands, for example loading kernel modules"
read -s -p "Enter Password: " mypassword
until [ -z "$1" ]
do
......@@ -421,9 +405,9 @@ for search_expr in "${test_case_array[@]}"
if [ "$class" == "compilation" ]; then
test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
elif [ "$class" == "execution" ]; then
test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword"
else
echo "Unexpected class of test case...Exiting...."
echo "Unexpected class of test case...Skipping the test case $name ...."
fi
done
......
This diff is collapsed.
<testCaseList>
<MachineList>mozart stevens calisson nano amerique</MachineList>
<MachineList>amerique stevens calisson nano</MachineList>
<NFSResultsShare>/mnt/sradio/TEST_RESULTS</NFSResultsShare>
<GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo>
<GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo>
<GitOAI5GRepoBranch>feature-34-test_framework</GitOAI5GRepoBranch>
<GitOpenair-cnRepoBranch>develop</GitOpenair-cnRepoBranch>
<CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* ltebox* </CleanUpOldProgs>
<GitOpenair-cnRepoBranch>feature-17-test_framework</GitOpenair-cnRepoBranch>
<CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* hss hss_sim configure_cots_bandrich_ue* wvdial* </CleanUpOldProgs>
<CleanUpAluLteBox>/opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox>
<testCase id="010101" >
<class>compilation</class>
......@@ -25,7 +26,7 @@
<testCase id="010102" >
<class>compilation</class>
<desc>Build oaisim.Rel8 + network device driver(nasmesh_fix)</desc>
<desc>Build oaisim.Rel8 + network device driver(nasmesh_fix)</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>oaisim_nos1</compile_prog>
<compile_prog_args></compile_prog_args>
......@@ -750,62 +751,231 @@
<desc></desc>
<eNB>calisson</eNB>
<UE>stevens</UE>
<EPC>nano</EPC>
<EPC>amerique</EPC>
<cleanupScript>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* ltebox*</cleanupScript>
<TimeOut_cmd>300</TimeOut_cmd>
<TimeOut_cmd>60</TimeOut_cmd>
<eNB_working_dir>/tmp</eNB_working_dir>
<eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"</eNB_config_file>
<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></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> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args>
<eNB_traffic_exec>iperf -s</eNB_traffic_exec>
<eNB_traffic_exec_args></eNB_traffic_exec_args>
<eNB_search_expr_true></eNB_search_expr_true>
<eNB_search_expr_false></eNB_search_expr_false>
<eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
<UE_working_dir>/tmp</UE_working_dir>
<UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"4\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"5\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"6\"</UE_config_file>
<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></UE_pre_exec>
<UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
<UE_main_exec_args></UE_main_exec_args>
<UE_traffic_exec>ping 192.172.0.1</UE_traffic_exec>
<UE_traffic_exec_args></UE_traffic_exec_args>
<UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false>
<UE_terminate_missing_procs>True</UE_terminate_missing_procs>
<EPC_working_dir>/tmp</EPC_working_dir>
<EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\"
BUILD/EPC/epc.local.enb.conf.in MNC \"92\"
BUILD/EPC/epc.local.enb.conf.in TAC \"1\"
BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
<EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
<EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
<HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
<HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
<EPC_pre_exec></EPC_pre_exec>
<EPC_pre_exec_args></EPC_pre_exec_args>
<EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
<EPC_main_exec_args></EPC_main_exec_args>
<HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
<HSS_main_exec_args></HSS_main_exec_args>
<EPC_traffic_exec>iperf -s</EPC_traffic_exec>
<EPC_traffic_exec_args></EPC_traffic_exec_args>
<EPC_search_expr_true></EPC_search_expr_true>
<EPC_search_expr_false></EPC_search_expr_false>
<EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
<nruns>3</nruns>
</testCase>
<testCase id="015600" >
<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>60</TimeOut_cmd>
<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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"</eNB_config_file>
<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></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_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf </eNB_main_exec_args>
<eNB_traffic_exec>iperf -s</eNB_traffic_exec>
<eNB_traffic_exec_args></eNB_traffic_exec_args>
<eNB_search_expr_true></eNB_search_expr_true>
<eNB_search_expr_false></eNB_search_expr_false>
<eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
<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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\"</UE_config_file>
<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></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>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
<UE_main_exec_args></UE_main_exec_args>
<UE_traffic_exec>ping 192.172.0.1</UE_traffic_exec>
<UE_traffic_exec_args></UE_traffic_exec_args>
<UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false>
<UE_terminate_missing_procs>True</UE_terminate_missing_procs>
<EPC_working_dir>/tmp</EPC_working_dir>
<EPC_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\"
BUILD/EPC/epc.local.enb.conf.in MNC \"92\"
BUILD/EPC/epc.local.enb.conf.in TAC \"1\"
BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
BUILD/EPC/epc.conf.in MCC \"208\"
BUILD/EPC/epc.conf.in MNC \"92\"
BUILD/EPC/epc.conf.in TAC \"1\"
BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\"
BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"
BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"</EPC_config_file>
<EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
<EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
<HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
<HSS_compile_prog_args> -c </HSS_compile_prog_args>
<EPC_pre_exec></EPC_pre_exec>
<EPC_pre_exec_args></EPC_pre_exec_args>
<EPC_main_exec>/SCRIPTS/run_epc -g </EPC_main_exec>
<EPC_main_exec_args></EPC_main_exec_args>
<HSS_main_exec>/SCRIPTS/run_hss -g </HSS_main_exec>
<HSS_main_exec_args></HSS_main_exec_args>
<EPC_traffic_exec>iperf -s</EPC_traffic_exec>
<EPC_traffic_exec_args></EPC_traffic_exec_args>
<EPC_search_expr_true></EPC_search_expr_true>
<EPC_search_expr_false></EPC_search_expr_false>
<EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
<nruns>2</nruns>
</testCase>
<testCase id="015700" >
<class>lte-softmodem</class>
<desc></desc>
<eNB>calisson</eNB>
<UE>stevens</UE>
<EPC>calisson</EPC>
<cleanupScript>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* ltebox*</cleanupScript>
<TimeOut_cmd>60</TimeOut_cmd>
<eNB_working_dir>/tmp</eNB_working_dir>
<eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf N_RB_DL 50
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mobile_network_code \"92\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf N_RB_DL 50
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"</eNB_config_file>
<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></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> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf </eNB_main_exec_args>
<eNB_traffic_exec></eNB_traffic_exec>
<eNB_traffic_exec_args></eNB_traffic_exec_args>
<eNB_search_expr_true></eNB_search_expr_true>
<eNB_search_expr_false></eNB_search_expr_false>
<eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
<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_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf tracking_area_code \"1\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_country_code \"208\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf mobile_network_code \"92\"</UE_config_file>
<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></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>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
<UE_main_exec_args></UE_main_exec_args>
<UE_traffic_exec>ping 192.172.0.1</UE_traffic_exec>
<UE_traffic_exec_args></UE_traffic_exec_args>
<UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false>
<UE_terminate_missing_procs>True</UE_terminate_missing_procs>
<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_config_file>BUILD/EPC/epc.local.enb.conf.in MCC \"208\"
BUILD/EPC/epc.local.enb.conf.in MNC \"92\"
BUILD/EPC/epc.local.enb.conf.in TAC \"1\"
BUILD/EPC/epc.local.enb.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
BUILD/EPC/epc.local.enb.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
BUILD/EPC/epc.conf.in MCC \"208\"
BUILD/EPC/epc.conf.in MNC \"92\"
BUILD/EPC/epc.conf.in TAC \"1\"
BUILD/EPC/epc.conf.in PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
BUILD/EPC/epc.conf.in MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\"
BUILD/EPC/epc.conf.in SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"
BUILD/EPC/epc.conf.in PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"</EPC_config_file>
<EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
<EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
<HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
<HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
<EPC_pre_exec></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>SCRIPTS/run_epc -l </EPC_main_exec>
<EPC_main_exec_args></EPC_main_exec_args>
<HSS_main_exec>SCRIPTS/run_hss </HSS_main_exec>
<HSS_main_exec_args></HSS_main_exec_args>
<EPC_traffic_exec>iperf -s</EPC_traffic_exec>
<EPC_traffic_exec_args></EPC_traffic_exec_args>
<EPC_search_expr_true></EPC_search_expr_true>
<EPC_search_expr_false></EPC_search_expr_false>
<EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
<nruns>2</nruns>
</testCase>
</testCase>
</testCaseList>
......
#!/usr/bin/python
import time
import serial
import os
from pyroute2 import IPRoute
import sys
import re
import threading
import signal
import traceback
import os
# configure the serial connections (the parameters differs on the device you are connecting to)
#First we find an open port to work with
serial_port=''
ser=serial.Serial()
def find_open_port():
global serial_port, ser
max_ports=100
if os.path.exists(serial_port) == True:
return serial_port
for port in range(2,100):
serial_port = '/dev/ttyUSB'+str(port)
if os.path.exists(serial_port) == True:
print 'New Serial Port : ' + serial_port
break
ser = serial.Serial(port=serial_port)
return
find_open_port()
print 'Using Serial port : ' + serial_port
#serial_port = '/dev/ttyUSB2'
bandrich_ppd_config = '$OPENAIR_DIR/cmake_targets/autotests/tools/wdial.bandrich.conf'
exit_flag=0
def signal_handler(signal, frame):
print('You pressed Ctrl+C!')
print('Resetting the UE to detached state')
timeout=10
exit_flag=1
send_command('AT+CGATT=0' , 'OK' , timeout)
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
#ser.open()
#ser.isOpen()
class pppThread (threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
def run(self):
print "Starting " + self.name
#Here we keep running pppd thread in indefinite loop as this script terminates sometimes
#while 1:
while 1:
time.sleep(5) #Hard coded, do not reduce this number!
print "Starting wvdial now..."
print 'exit_flag = ' + str(exit_flag)
send_command('AT+CGATT=1','OK', 300)
os.system('wvdial -C ' + bandrich_ppd_config + '' )
if exit_flag == 1:
print "Exit flag set to true. Exiting pppThread now"
print "Terminating wvdial now..."
def send_command (cmd, response, timeout):
count=0
sleep_duration = 1
print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n'
global serial_port, ser
while count <= timeout:
try:
#Sometimes the port does not exist coz of reset in modem.
#In that case, we need to search for this port again
if os.path.exists(serial_port) == False:
find_open_port()
ser.write (cmd + '\r\n')
out = ''
time.sleep(sleep_duration)
count = count + sleep_duration
while ser.inWaiting() > 0:
out += ser.read(1)
print 'out = <' + out + '> response = <' + response + '> \n'
if re.search(response, out):
break
except Exception, e:
error = ' cmd : ' + cmd + ' response : ' + response
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
def start_ue () :
#print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
timeout=60 #timeout in seconds
send_command('AT', 'OK' , timeout)
send_command('AT+CGATT=0' , 'OK' , timeout)
send_command('AT+CGATT=1','OK', 300)
#os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
thread_ppp = pppThread(1, "ppp_thread", 1)
thread_ppp.start()
iface='ppp0'
while 1:
time.sleep ( 2)
#Now we check if ppp0 interface is up and running
try:
if exit_flag == 1:
break
ip = IPRoute()
idx = ip.link_lookup(ifname=iface)[0]
os.system ('route add 192.172.0.1 ppp0')
break
except Exception, e:
error = ' Interface ' + iface + 'does not exist...'
error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e)
error = error + traceback.format_exc()
print error
thread_ppp.join()
def stop_ue():
timeout=60
os.system('killall wvdial')
send_command('AT', 'OK' , timeout)
send_command('AT+CGATT=0' , 'OK' , timeout)
for arg in sys.argv[1:]:
if arg == '--start-ue' :
start_ue()
elif arg == '--stop-ue' :
stop_ue()
else :
print " Script called with wrong arguments, arg = " + arg
sys.exit()
#!/usr/bin/python
import sys
import re
#Arg 1 name of file
#Arg 2 keyword
#arg 3 replacement text
#Note that these should be seperated by spaces
if len(sys.argv) != 4:
print "search_repl.py: Wrong number of arguments. This program needs 3 arguments"
sys.exit()
filename = sys.argv[1]
keyword = sys.argv[2]
replacement_text = sys.argv[3]
file = open(filename, 'r')
string = file.read()
file.close()
if keyword == 'mme_ip_address':
#string = (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M)
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '