TT#104401 check.sh: clean known errors on sipp 3.6

Since 3.6.0 sipp is throwing a warning that doesn't
change behavior but we detect an error file as failed
sipp execution for responders

So let's clean the known error from error files and
remove the empty ones after

See details at https://github.com/SIPp/sipp/issues/497

* bin/sipp.sh: add -e option to define error file
* bin/check.sh: use -e option with the proper filename
  so there's no need to move the files later

Change-Id: I5ce4b73d858d928f4bc9ec89bfe8658fad48b6e6
mr9.4
Victor Seva 5 years ago
parent bcced8edae
commit 675b838e5b
No known key found for this signature in database
GPG Key ID: B1589889727198E0

@ -66,16 +66,26 @@ EOF
echo "$(date) - $(basename "$2") NOT ok"
}
# since 3.6.0 there's a warning
# showing up and generates the error file
# See https://github.com/SIPp/sipp/issues/497
clean_sipp_error() {
while read -r sipp_error ; do
sed -i '/The following events occurred:/d' "${sipp_error}"
sed -i '/Failed to delete FD from epoll/d' "${sipp_error}"
[ -s "${sipp_error}" ] || rm -v "${sipp_error}"
done < <(find "${LOG_DIR}/" -type f -name '*errors.log')
}
detect_sipp_error_files() {
local find_cmd
case ${SIPP_VERSION} in
v3\.[0-5]\.*)
find_cmd=$(find "${SCEN_CHECK_DIR}/" -type f -name 'sipp_scenario*errors.log' 2>/dev/null|wc -l)
;;
*)
find_cmd=$(find "${BASE_DIR}/" -maxdepth 1 -type f -name 'sipp_scenario*errors.log' 2>/dev/null|wc -l)
;;
v3\.[0-5]\.*) ;;
*) clean_sipp_error;;
esac
find_cmd=$(find "${LOG_DIR}/" -type f -name '*errors.log' 2>/dev/null|wc -l)
if [ "${find_cmd}" -ne 0 ]; then
echo "$(date) - Detected sipp error files"
return 0
@ -85,19 +95,6 @@ detect_sipp_error_files() {
fi
}
move_sipp_error_files() {
case ${SIPP_VERSION} in
v3\.[0-5]\.*)
find "${SCEN_CHECK_DIR}/" -type f -name 'sipp_scenario*errors.log' \
-exec mv {} "${LOG_DIR}" \;
;;
*)
find "${BASE_DIR}/" -maxdepth 1 -type f -name 'sipp_scenario*errors.log' \
-exec mv {} "${LOG_DIR}" \;
;;
esac
}
function str_check_error() {
local err_type=()
@ -433,7 +430,6 @@ error_helper() {
echo "$(date) - Deleting domain:${DOMAIN}"
delete_voip "${DOMAIN}"
fi
move_sipp_error_files
stop_capture
check_rtp
exit "$2"
@ -633,10 +629,12 @@ run_sipp() {
if [ -f "${SCEN_CHECK_DIR}/${base}_reg.xml" ]; then
echo "$(date) - Register ${base} ${ip}:${PORT}-${MPORT}"
"${BIN_DIR}/sipp.sh" -T "$transport" -i "${ip}" -p "${PORT}" \
-e "${LOG_DIR}/${base}_reg_errors.log" \
-r "${SCEN_CHECK_DIR}/${base}_reg.xml"
fi
pid=$("${BIN_DIR}/sipp.sh" -b -T "$transport" -i "${ip}" -p "${PORT}" \
-l "${LOG_DIR}/${base}.msg" \
-e "${LOG_DIR}/${base}_errors.log" \
-m "${MPORT}" -r "${SCEN_CHECK_DIR}/${base}.xml")
echo "$(date) - Running ${base}[${pid}] ${ip}:${PORT}-${MPORT}"
responder_pid="${responder_pid} ${base}:${pid}"
@ -659,7 +657,7 @@ run_sipp() {
PORT=$(check_port )
MPORT=$(check_mport )
echo "$(date) - Running ${base} $ip:51602-45003"
if ! "${BIN_DIR}/sipp.sh" -l "${LOG_DIR}/${base}.msg" -T "${transport}" -i "${ip}" -p 51602 -m 45003 "${send}" ; then
if ! "${BIN_DIR}/sipp.sh" -e "${LOG_DIR}/${base}_errors.log" -l "${LOG_DIR}/${base}.msg" -T "${transport}" -i "${ip}" -p 51602 -m 45003 "${send}" ; then
echo "$(date) - ${base} error"
status=1
fi
@ -691,7 +689,6 @@ run_sipp() {
copy_logs
# if any scenario has a log... error
if detect_sipp_error_files; then
move_sipp_error_files
status=1
fi

@ -29,11 +29,12 @@ usage() {
echo -e "\\t-r: responder"
echo -e "\\t-b: run sipp in background (responder)"
echo -e "\\t-l: log_message_file"
echo -e "\\t-e: err_file"
echo "Arguments:"
echo -e "\\t sipp_scenario.xml file"
}
while getopts 'hrp:m:t:i:T:bl:' opt; do
while getopts 'hrp:m:t:i:T:bl:e:' opt; do
case $opt in
h) usage; exit 0;;
r) RESP=1;;
@ -44,6 +45,7 @@ while getopts 'hrp:m:t:i:T:bl:' opt; do
T) TRANSPORT=${OPTARG,,};;
b) BACK="-bg";;
l) LOG_FILE=${OPTARG};;
e) ERR_FILE=${OPTARG};;
*) usage; exit 0;;
esac
done
@ -68,6 +70,12 @@ if [ -n "${LOG_FILE}" ]; then
MSG_LOG="-trace_msg -message_file ${LOG_FILE}"
fi
if [ -n "${ERR_FILE}" ]; then
ERR_LOG="-trace_err -error_file ${ERR_FILE}"
else
ERR_LOG="-trace_err"
fi
if [ "${TRANSPORT}" == "tcp" ]; then
TRANSPORT_ARG="-t t1"
else
@ -82,11 +90,11 @@ if [ -z "${RESP}" ]; then
PORT=${PORT:-"50602"}
TIMEOUT=${TIMEOUT:-"15"}
sipp -max_socket $MAX ${TRANSPORT_ARG} ${MSG_LOG} \
sipp -max_socket $MAX ${TRANSPORT_ARG} ${MSG_LOG} ${ERR_LOG} \
-inf "${BASE_DIR}/callee.csv" -inf "${BASE_DIR}/caller.csv" \
-sf "$1" -i "$IP" -p "$PORT" \
-nr -nd -m 1 ${MPORT_ARG} \
-timeout "${TIMEOUT}" -timeout_error -trace_err \
-timeout "${TIMEOUT}" -timeout_error \
"$IP_SERVER" &> /dev/null
status=$?
else
@ -97,19 +105,19 @@ else
TIMEOUT=${TIMEOUT:-"25"}
if [ -z "${BACK}" ]; then
sipp -max_socket $MAX ${TRANSPORT_ARG} ${MSG_LOG} \
sipp -max_socket $MAX ${TRANSPORT_ARG} ${MSG_LOG} ${ERR_LOG} \
-inf "${BASE_DIR}/callee.csv" -inf "${BASE_DIR}/caller.csv" \
-sf "$1" -i "$IP" -p "$PORT" \
-nr -nd -m 1 ${MPORT_ARG} \
-timeout "${TIMEOUT}" -timeout_error -trace_err \
-timeout "${TIMEOUT}" -timeout_error \
"$IP_SERVER" &> /dev/null
status=$?
else
tmp=$(sipp $BACK -max_socket $MAX ${TRANSPORT_ARG} ${MSG_LOG} \
tmp=$(sipp $BACK -max_socket $MAX ${TRANSPORT_ARG} ${MSG_LOG} ${ERR_LOG} \
-inf "${BASE_DIR}/callee.csv" -inf "${BASE_DIR}/caller.csv" \
-sf "$1" -i "$IP" -p "$PORT" \
-nr -nd -m 1 ${MPORT_ARG} \
-timeout "${TIMEOUT}" -timeout_error -trace_err \
-timeout "${TIMEOUT}" -timeout_error \
"$IP_SERVER")
# shellcheck disable=SC2046
echo "$tmp" | cut -d= -f2 | sed -e 's_\[__' -e 's_\]__'

Loading…
Cancel
Save