MT#7523 allow use of SCENARIOS env var

vseva/7535
Victor Seva 12 years ago
parent 9207990185
commit d75a861967

@ -54,6 +54,12 @@ Usage:
or run all the tests as many times you want with:
#./bin/bench.sh $NUM
If you want to test just a set of scenarios, set the SCENARIOS
environment var.
#bash SCENARIOS="invite invite_callforward" ./run_tests.sh
#bash SCENARIOS="invite invite_callforward" ./get_results.sh
Development:
------------

@ -19,6 +19,27 @@ function usage
echo "BIN_DIR:${BIN_DIR}"
}
function get_scenarios
{
local t
local flag
flag=0
if [ -n "${SCENARIOS}" ]; then
for t in ${SCENARIOS}; do
if [ ! -d "${BASE_DIR}/scenarios/$t" ]; then
echo "$(date) - scenario: $t not found"
flag=1
fi
done
if [ $flag != 0 ]; then
exit 1
fi
else
SCENARIOS=$(find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 \
-type d -exec basename {} \; | grep -v templates | sort)
fi
}
while getopts 'hgGp:TP' opt; do
case $opt in
h) usage; exit 0;;
@ -46,7 +67,9 @@ fi
echo "$(date) - Clean result dir"
rm -rf ${RESULT_DIR}
find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | grep -v templates| sort \
get_scenarios
echo ${SCENARIOS} | tr ' ' '\n' \
| parallel "${BIN_DIR}/check.sh ${GRAPH} -C -R ${OPTS} -d ${DOMAIN} -p ${PROFILE}"
status=$?
echo "$(date) - All done[$status]"

@ -20,9 +20,25 @@ function usage
echo "BIN_DIR:${BIN_DIR}"
}
function list
function get_scenarios
{
find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 -type d -exec basename {} \;| grep -v templates | sort
local t
local flag
flag=0
if [ -n "${SCENARIOS}" ]; then
for t in ${SCENARIOS}; do
if [ ! -d "${BASE_DIR}/scenarios/$t" ]; then
echo "$(date) - scenario: $t not found"
flag=1
fi
done
if [ $flag != 0 ]; then
exit 1
fi
else
SCENARIOS=$(find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 \
-type d -exec basename {} \; | grep -v templates | sort)
fi
}
function cfg_debug_off
@ -44,7 +60,7 @@ function cfg_debug_off
while getopts 'hlcp:' opt; do
case $opt in
h) usage; exit 0;;
l) list; exit 0;;
l) get_scenarios; echo "${SCENARIOS}"; exit 0;;
c) SKIP=1;;
p) PROFILE=$OPTARG;;
esac
@ -85,8 +101,8 @@ if [ -z $SKIP ]; then
wait $!
if [ "$?" != "0" ]; then
echo "error on apply config"
echo "$(date) - Done[1]"
cfg_debug_off
echo "$(date) - Done[1]"
exit 1
fi
fi
@ -98,9 +114,11 @@ VERSION="${PROFILE}_$(cat /etc/ngcp_version | cut -f1 -d' ')_"
${BIN_DIR}/mem_stats.py --private_file=${MLOG_DIR}/${VERSION}initial_pvm.cvs \
--share_file=${MLOG_DIR}/${VERSION}initial_shm.cvs
for t in $(find ${BASE_DIR}/scenarios/ -depth -maxdepth 1 -mindepth 1 -type d | grep -v templates | sort); do
echo "$(date) - Run[${PROFILE}]: $(basename $t) ================================================="
${BIN_DIR}/check.sh -P -T -d ${DOMAIN} -p ${PROFILE} $(basename $t)
get_scenarios
for t in ${SCENARIOS}; do
echo "$(date) - Run[${PROFILE}]: $t ================================================="
${BIN_DIR}/check.sh -P -T -d ${DOMAIN} -p ${PROFILE} $t
if [ $? -ne 0 ]; then
error_flag=1
fi

Loading…
Cancel
Save