diff --git a/check.py b/bin/check.py similarity index 100% rename from check.py rename to bin/check.py diff --git a/scenarios/check.sh b/bin/check.sh similarity index 84% rename from scenarios/check.sh rename to bin/check.sh index a66ae727..060b8ed0 100755 --- a/scenarios/check.sh +++ b/bin/check.sh @@ -5,7 +5,7 @@ function graph { if [ -f $1 ]; then - ${BASE_DIR}/graph_flow.pl $1 $2 + ${BIN_DIR}/graph_flow.pl $1 $2 fi } @@ -24,7 +24,7 @@ function check_test fi echo -n "Testing $1 againts $2 -> $3" - ${BASE_DIR}/check.py $1 $2 > $3 + ${BIN_DIR}/check.py $1 $2 > $3 if [[ $? -ne "0" ]]; then echo " not ok" ERR_FLAG=1 @@ -36,22 +36,22 @@ function check_test # $1 domain function create_voip { - ${BASE_DIR}/create_domain.pl $1 - ${BASE_DIR}/create_subscribers.pl -v 1 -s 3 -d $1 -u testuser -c 43 -a 1 -n 1001 -p testuser + ${BIN_DIR}/create_domain.pl $1 + ${BIN_DIR}/create_subscribers.pl -v 1 -s 3 -d $1 -u testuser -c 43 -a 1 -n 1001 -p testuser } # $1 prefs yml file function create_voip_prefs { if [ -f $1 ]; then - ${BASE_DIR}/set_subscribers_preferences.pl $1 + ${BIN_DIR}/set_subscribers_preferences.pl $1 fi } # $1 domain function delete_voip { - ${BASE_DIR}/delete_domain.pl $1 + ${BIN_DIR}/delete_domain.pl $1 } # $1 msg to echo @@ -78,15 +78,15 @@ function run_sipp rm -rf ${LOG_DIR} mkdir -p ${LOG_DIR} - ${BASE_DIR}/restart_log.sh + ${BIN_DIR}/restart_log.sh for res in $(find ${SCEN_CHECK_DIR} -type f -name 'sipp_scenario_responder[0-9][0-9].xml'| sort); do base=$(basename $res .xml) - ${BASE_DIR}/sipp.sh -d ${DOMAIN} -r ${SCEN_CHECK_DIR}/${base}_reg.xml &> /dev/null - ${BASE_DIR}/sipp.sh -d ${DOMAIN} -r ${SCEN_CHECK_DIR}/${base}.xml &> /dev/null & + ${BIN_DIR}/sipp.sh -d ${DOMAIN} -r ${SCEN_CHECK_DIR}/${base}_reg.xml &> /dev/null + ${BIN_DIR}/sipp.sh -d ${DOMAIN} -r ${SCEN_CHECK_DIR}/${base}.xml &> /dev/null & responder_pid="${responder_pid} ${base}:$!" done # let's fire sipp scenario - ${BASE_DIR}/sipp.sh -d ${DOMAIN} $1 + ${BIN_DIR}/sipp.sh -d ${DOMAIN} $1 status=$? for res in ${responder_pid}; do @@ -98,7 +98,7 @@ function run_sipp echo "sipp responder $base pid $pid not finished yet. Waiting 5 secs" sleep 5 fi - ${BASE_DIR}/sipp.sh -d ${DOMAIN} -r ${SCEN_CHECK_DIR}/${base}_unreg.xml &> /dev/null + ${BIN_DIR}/sipp.sh -d ${DOMAIN} -r ${SCEN_CHECK_DIR}/${base}_unreg.xml &> /dev/null done # copy the kamailio log @@ -109,7 +109,7 @@ function run_sipp fi echo "Parsing ${LOG_DIR}/kamailio.log" - ${BASE_DIR}/ulog_parser.pl ${LOG_DIR}/kamailio.log ${LOG_DIR} + ${BIN_DIR}/ulog_parser.pl ${LOG_DIR}/kamailio.log ${LOG_DIR} } while getopts 'CRDTGd:' opt; do @@ -138,6 +138,7 @@ fi NAME_CHECK="$1" BASE_DIR="/usr/local/src/kamailio-config-tests" +BIN_DIR="${BASE_DIR}/bin" LOG_DIR="${BASE_DIR}/log/${NAME_CHECK}" RESULT_DIR="${BASE_DIR}/result/${NAME_CHECK}" KAM_LOG="/var/log/ngcp/kamailio-proxy.log" diff --git a/config_debug.pl b/bin/config_debug.pl similarity index 100% rename from config_debug.pl rename to bin/config_debug.pl diff --git a/create_domain.pl b/bin/create_domain.pl similarity index 100% rename from create_domain.pl rename to bin/create_domain.pl diff --git a/create_subscribers.pl b/bin/create_subscribers.pl similarity index 100% rename from create_subscribers.pl rename to bin/create_subscribers.pl diff --git a/delete_domain.pl b/bin/delete_domain.pl similarity index 100% rename from delete_domain.pl rename to bin/delete_domain.pl diff --git a/generate_tests.sh b/bin/generate_tests.sh similarity index 98% rename from generate_tests.sh rename to bin/generate_tests.sh index b7b83945..f1d2691f 100755 --- a/generate_tests.sh +++ b/bin/generate_tests.sh @@ -1,5 +1,6 @@ #!/bin/bash BASE_DIR="/usr/local/src/kamailio-config-tests" +BIN_DIR="${BASE_DIR}/bin" LOG_DIR="${BASE_DIR}/log" RESULT_DIR="${BASE_DIR}/result" DOMAIN="spce.test" diff --git a/graph_flow.pl b/bin/graph_flow.pl similarity index 100% rename from graph_flow.pl rename to bin/graph_flow.pl diff --git a/restart_log.sh b/bin/restart_log.sh similarity index 79% rename from restart_log.sh rename to bin/restart_log.sh index b4269d81..3da40c9c 100755 --- a/restart_log.sh +++ b/bin/restart_log.sh @@ -1,5 +1,4 @@ #!/bin/sh -#ngcpcfg build /etc/kamailio/proxy/ invoke-rc.d kamailio-proxy stop rm -rf /var/log/ngcp/kamailio-proxy.log invoke-rc.d rsyslog restart diff --git a/set_subscribers_preferences.pl b/bin/set_subscribers_preferences.pl similarity index 100% rename from set_subscribers_preferences.pl rename to bin/set_subscribers_preferences.pl diff --git a/show_flow.pl b/bin/show_flow.pl similarity index 100% rename from show_flow.pl rename to bin/show_flow.pl diff --git a/sipp.sh b/bin/sipp.sh similarity index 100% rename from sipp.sh rename to bin/sipp.sh diff --git a/test_check.py b/bin/test_check.py similarity index 100% rename from test_check.py rename to bin/test_check.py diff --git a/ulog_parser.pl b/bin/ulog_parser.pl similarity index 100% rename from ulog_parser.pl rename to bin/ulog_parser.pl diff --git a/run_tests.sh b/run_tests.sh index aced0805..a691edfa 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,5 +1,6 @@ #!/bin/bash BASE_DIR="/usr/local/src/kamailio-config-tests" +BIN_DIR="${BASE_DIR}/bin" LOG_DIR="${BASE_DIR}/log" RESULT_DIR="${BASE_DIR}/result" PROFILE="CE" @@ -38,7 +39,7 @@ if [ "${PROFILE}" != "CE" ] && [ "${PROFILE}" != "PRO" ]; then fi if [ -z $SKIP ]; then - ${BASE_DIR}/config_debug.pl on ${DOMAIN} + ${BIN_DIR}/config_debug.pl on ${DOMAIN} ngcpcfg apply fi @@ -46,7 +47,7 @@ for i in ${LOG_DIR} ${RESULT_DIR}; do rm -rf $i done -${BASE_DIR}/generate_tests.sh ${PROFILE} +${BIN_DIR}/generate_tests.sh ${PROFILE} if [ $? -ne 0 ]; then echo "Generating tests error" exit 3 @@ -55,7 +56,7 @@ fi for t in $(find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 -type d | sort); do echo "Run: $(basename $t)" if [ -z $TEST ]; then - ${BASE_DIR}/scenarios/check.sh -d ${DOMAIN} $(basename $t) + ${BIN_DIR}/check.sh -d ${DOMAIN} $(basename $t) if [ $? -ne 0 ]; then error_flag=1 fi @@ -63,7 +64,7 @@ for t in $(find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 -type d | done if [ -z $SKIP ]; then - ${BASE_DIR}/config_debug.pl off ${DOMAIN} + ${BIN_DIR}/config_debug.pl off ${DOMAIN} ngcpcfg apply fi