TT#81700 bin/check.sh: add option to control RETRANS_SIZE

* support checking up to RETRANS_SIZE steps of messages

Change-Id: I7d2b500d1fdfe85a3f35af9c7fa5f098297864db
mr9.0.1
Victor Seva 6 years ago
parent 0ac84aa35b
commit c5362fa829

@ -33,6 +33,7 @@ JSON_KAM=true
SKIP_MOVE_JSON_KAM=false
CDR=false
ERR_FLAG=0
RETRANS_SIZE=2
# $1 kamailio msg parsed to yml
# $2 destination png filename
@ -132,6 +133,23 @@ check_retrans_prev() {
return 1
}
# $1 unit test yml
# $2 kamailio msg parsed to yml
# $3 destination tap filename
# $4 number of messages to check before and after
check_retrans_block() {
for i in $(seq "${4:-2}") ; do
if check_retrans_next "$1" "$2" "$3" "$i" ; then
echo " ok"
return 0
elif check_retrans_prev "$1" "$2" "$3" "$i" ; then
echo " ok"
return 0
fi
done
return 1
}
# $1 unit test yml
# $2 kamailio msg parsed to yml
# $3 destination tap filename
@ -165,19 +183,7 @@ check_test() {
echo " NOT ok"
if "${FIX_RETRANS}" ; then
if check_retrans_next "$1" ${kam_type} "$3" 1 ; then
echo " ok"
return 0
elif check_retrans_prev "$1" ${kam_type} "$3" 1 ; then
echo " ok"
return 0
elif check_retrans_next "$1" ${kam_type} "$3" 2 ; then
echo " ok"
return 0
elif check_retrans_prev "$1" ${kam_type} "$3" 2 ; then
echo " ok"
return 0
fi
check_retrans_block "$1" "${kam_type}" "$3" "${RETRANS_SIZE}" && return 0
fi
ERR_FLAG=1
@ -710,7 +716,7 @@ usage() {
echo -e "\\tcheck_name. Scenario name to check. This is the name of the directory on GROUP dir."
}
while getopts 'hCd:p:Rs:DTPGgrcJKMm' opt; do
while getopts 'hCd:p:Rs:DTPGgrcJKMmw:' opt; do
case $opt in
h) usage; exit 0;;
C) SKIP=true;;
@ -729,6 +735,7 @@ while getopts 'hCd:p:Rs:DTPGgrcJKMm' opt; do
M) SKIP_MOVE_JSON_KAM=true;;
m) MEMDBG=true;;
c) CDR=true;;
w) RETRANS_SIZE=${OPTARG};;
*) usage; exit 1;;
esac
done

@ -17,6 +17,7 @@ usage() {
echo -e "\\t-P parse only will disable test"
echo -e "\\t-T test only will disable parse"
echo -e "\\t-r fix retransmission issues"
echo -e "\\t-R choose how many messages before and after to check"
echo -e "\\t-c enable cdr validation"
echo -e "\\t-x set GROUP scenario. Default: scenarios"
echo "BASE_DIR:${BASE_DIR}"
@ -57,7 +58,7 @@ get_scenarios() {
fi
}
while getopts 'hgGp:TPrcx:' opt; do
while getopts 'hgGp:TPrR:cx:' opt; do
case $opt in
h) usage; exit 0;;
G) GRAPH="-G";;
@ -65,6 +66,7 @@ while getopts 'hgGp:TPrcx:' opt; do
P) OPTS="-T";;
T) OPTS="-P";;
r) RETRANS="-r";;
R) RETRANS="-r -w ${OPTARG}";;
c) CDR="-c";;
p) PROFILE=${OPTARG};;
x) GROUP=${OPTARG};;

Loading…
Cancel
Save