diff --git a/bench.sh b/bench.sh index 03ae08c6..1f04135d 100755 --- a/bench.sh +++ b/bench.sh @@ -1,12 +1,12 @@ #!/bin/bash SKIP_CONFIG=false -PROFILE="${PROFILE:-CE}" +PROFILE="${PROFILE:-}" GROUP="${GROUP:-scenarios}" usage() { echo "Usage: bench.sh [-p PROFILE] [-C] [num_runs]" echo "Options:" - echo -e "\\t-p CE|PRO default is CE" + echo -e "\\t-p CE|PRO default is autodetect" echo -e "\\t-C skips configuration of the environment" echo -e "\\t-x set GROUP scenario. Default: scenarios" echo -e "\\t-h this help" @@ -24,14 +24,16 @@ while getopts 'hCp:x:' opt; do done shift $((OPTIND - 1)) -ngcp_type=$(command -v ngcp-type) -if [ -n "${ngcp_type}" ]; then - case $(${ngcp_type}) in - sppro|carrier) PROFILE=PRO;; - ce) PROFILE=CE;; - *) ;; - esac - echo "ngcp-type: profile ${PROFILE}" +if [ -z "${PROFILE}" ] ; then + ngcp_type=$(command -v ngcp-type) + if [ -n "${ngcp_type}" ]; then + case $(${ngcp_type}) in + sppro|carrier) PROFILE=PRO;; + ce) PROFILE=CE;; + *) ;; + esac + echo "ngcp-type: profile ${PROFILE}" + fi fi if [ "${PROFILE}" != "CE" ] && [ "${PROFILE}" != "PRO" ]; then echo "PROFILE ${PROFILE} unknown" diff --git a/get_results.sh b/get_results.sh index 2ad1f1d8..94d20f36 100755 --- a/get_results.sh +++ b/get_results.sh @@ -2,7 +2,7 @@ RUN_DIR="$(dirname "$0")" export BASE_DIR=${BASE_DIR:-$RUN_DIR} BIN_DIR="${BASE_DIR}/bin" -PROFILE="${PROFILE:-CE}" +PROFILE="${PROFILE:-}" DOMAIN="spce.test" GROUP="${GROUP:-scenarios}" RETRANS="" @@ -10,7 +10,7 @@ CDR="" usage() { echo "Usage: get_results.sh [-p PROFILE] [-h] [-g]" - echo -e "\\t-p CE|PRO default is CE" + echo -e "\\t-p CE|PRO default is autodetect" echo -e "\\t-g generate png flow graphs if test fails" echo -e "\\t-G generate png all flow graphs" echo -e "\\t-h this help" @@ -79,14 +79,16 @@ if [[ $# -ne 0 ]]; then exit 1 fi -ngcp_type=$(command -v ngcp-type) -if [ -n "${ngcp_type}" ]; then - case $(${ngcp_type}) in - sppro|carrier) PROFILE=PRO;; - ce) PROFILE=CE;; - *) ;; - esac - echo "ngcp-type: profile ${PROFILE}" +if [ -z "${PROFILE}" ] ; then + ngcp_type=$(command -v ngcp-type) + if [ -n "${ngcp_type}" ]; then + case $(${ngcp_type}) in + sppro|carrier) PROFILE=PRO;; + ce) PROFILE=CE;; + *) ;; + esac + echo "ngcp-type: profile ${PROFILE}" + fi fi if [ "${PROFILE}" != "CE" ] && [ "${PROFILE}" != "PRO" ]; then echo "PROFILE ${PROFILE} unknown" diff --git a/run_tests.sh b/run_tests.sh index f07938c0..d513431a 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -15,7 +15,7 @@ RTP_LOG=${RTP_LOG:-"/var/log/ngcp/rtp.log"} TMP_LOG_DIR="/tmp" KAM_DIR="/tmp/cfgtest" COREDUMP_DIR="/ngcp-data/coredumps" -PROFILE="${PROFILE:-CE}" +PROFILE="${PROFILE:-}" OPTS=(-P -T -M) #SKIP_PARSE=true, SKIP_TESTS=true, SKIP_MOVE_JSON_KAM=true DOMAIN="spce.test" TIMEOUT=${TIMEOUT:-300} @@ -223,7 +223,7 @@ cdr_export() { usage() { echo "Usage: run_test.sh [-p PROFILE] [-C] [-t]" echo "Options:" - echo -e "\\t-p CE|PRO default is CE" + echo -e "\\t-p CE|PRO default is autodetect" echo -e "\\t-l print available SCENARIOS in GROUP" echo -e "\\t-C skips configuration of the environment" echo -e "\\t-K capture messages with tcpdump" @@ -267,16 +267,17 @@ if "${SHOW_SCENARIOS}" ; then exit 0 fi -ngcp_type=$(command -v ngcp-type) -if [ -n "${ngcp_type}" ]; then - case $(${ngcp_type}) in - sppro|carrier) PROFILE=PRO;; - ce) PROFILE=CE;; - *) ;; - esac - echo "ngcp-type: profile ${PROFILE}" +if [ -z "${PROFILE}" ]; then + ngcp_type=$(command -v ngcp-type) + if [ -n "${ngcp_type}" ]; then + case $(${ngcp_type}) in + sppro|carrier) PROFILE=PRO;; + ce) PROFILE=CE;; + *) ;; + esac + echo "ngcp-type: profile ${PROFILE}" + fi fi - if [ "${PROFILE}" != "CE" ] && [ "${PROFILE}" != "PRO" ]; then echo "PROFILE ${PROFILE} unknown" usage