From 493423a9116f30795efb26a4a32067a90562a504 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Wed, 14 Jul 2021 11:30:39 +0200 Subject: [PATCH] TT#116101 align sipp checks filename to sipp scenario files * sipp_scenario00.xml => sipp_scenario00.msg sipp_scenario_responder00.xml => sipp_scenario_responder00.msg so sipp_scenario00_test.yml.tt2 and sipp_scenario_reponder00_test.yml.tt2 makes more sense Change-Id: Iab9db5122774dbc32101195e639ab6fef9b23236 --- bin/check.sh | 26 ++++---------- bin/check_sipp.sh | 35 ++++++------------- ...t.yml.tt2 => sipp_scenario00_test.yml.tt2} | 0 ...=> sipp_scenario_responder00_test.yml.tt2} | 0 4 files changed, 18 insertions(+), 43 deletions(-) rename scenarios/invite/{sip_messages00_test.yml.tt2 => sipp_scenario00_test.yml.tt2} (100%) rename scenarios/invite/{sip_messages_responder00_test.yml.tt2 => sipp_scenario_responder00_test.yml.tt2} (100%) diff --git a/bin/check.sh b/bin/check.sh index 413b24a2..0c691201 100755 --- a/bin/check.sh +++ b/bin/check.sh @@ -542,18 +542,6 @@ run_sipp() { fi } -test_sip_filepath() { - local msg_name - msg_name=${1/_test.yml/.msg} - msg_name=${msg_name/sip_messages/sipp_scenario} - sip_msg="${LOG_DIR}/$(basename "${msg_name}")" - if ! [ -f "${sip_msg}" ]; then - echo "$(date) - WARNING: no sipp log file found! filename=<${sip_msg}>. Skipping." - return 1 - fi - return 0 -} - test_filepath() { local msg_name @@ -867,13 +855,13 @@ if [[ ${CHECK_TYPE} != none ]] ; then if [[ ${CHECK_TYPE} != cfgt ]] ; then echo "$(date) - ~~~~~" - for t in "${SCEN_CHECK_DIR}"/sip_messages*[0-9][0-9]_test.yml; do - if test_sip_filepath "${t}"; then - echo -n "$(date) - SIP: Check test $(basename "${t}") on ${sip_msg}" - dest=$(basename "${sip_msg}") - dest=${RESULT_DIR}/${dest/.msg/.tap} - check_sip_test "${t}" "$sip_msg" "${dest}" - fi + for t in "${SCEN_CHECK_DIR}"/sipp_scenario*_test.yml; do + msg_name=${t/_test.yml/.msg} + sip_msg="${LOG_DIR}/$(basename "${msg_name}")" + echo -n "$(date) - SIP: Check test $(basename "${t}") on ${sip_msg}" + dest=$(basename "${sip_msg}") + dest=${RESULT_DIR}/${dest/.msg/.tap} + check_sip_test "${t}" "$sip_msg" "${dest}" done echo "$(date) - ~~~~~" fi diff --git a/bin/check_sipp.sh b/bin/check_sipp.sh index 1c007171..1e718574 100755 --- a/bin/check_sipp.sh +++ b/bin/check_sipp.sh @@ -18,6 +18,7 @@ # On Debian systems, the complete text of the GNU General # Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". # +set -e ERR_FLAG=0 # $1 destination tap file @@ -31,19 +32,6 @@ EOF echo "$(date) - $(basename "$2") NOT ok" } -test_sip_filepath() { - local msg_name - msg_name=${1/_test.yml/.msg} - msg_name=${msg_name/sip_messages/sipp_scenario} - - msg="${LOG_DIR}/$(basename "${msg_name}")" - if [ -f "${msg}" ]; then - return 0 - fi - echo "$(date) - WARNING: no sipp log file found! filename=<${msg}>. Skipping." - return 1 -} - # $1 sip message test yml # $2 sipp msg parsed to .msg log file # $3 destination tap filename @@ -142,22 +130,21 @@ echo "$(date) - Check [${GROUP}/${PROFILE}]: ${NAME_CHECK}" mkdir -p "${RESULT_DIR}" echo "$(date) - Cleaning tests files" -find "${SCEN_CHECK_DIR}" -type f -name '*test.yml' -exec rm {} \; +find "${SCEN_CHECK_DIR}" -type f -name 'sipp_scenario*test.yml' -exec rm {} \; echo "$(date) - Generating tests files" "${BIN_DIR}/generate_tests.sh" \ - -f 'sip_messages*test.yml.tt2' \ + -f 'sipp_scenario*test.yml.tt2' \ -d "${SCEN_CHECK_DIR}" "${LOG_DIR}/scenario_ids.yml" "${PROFILE}" test_ok=() - -for t in "${SCEN_CHECK_DIR}"/sip_messages*[0-9][0-9]_test.yml; do - if test_sip_filepath "${t}"; then - echo -n "$(date) - SIP: Check test $(basename "${t}") on ${msg}" - dest=$(basename "${msg}") - dest=${RESULT_DIR}/${dest/.msg/.tap} - check_sip_test "${t}" "$msg" "${dest}" - fi -done +while read -r t; do + msg_name=${t/_test.yml/.msg} + msg="${LOG_DIR}/$(basename "${msg_name}")" + echo -n "$(date) - SIP: Check test $(basename "${t}") on ${msg}" + dest=$(basename "${msg}") + dest=${RESULT_DIR}/${dest/.msg/.tap} + check_sip_test "${t}" "$msg" "${dest}" +done < <(find "${SCEN_CHECK_DIR}" -maxdepth 1 -name 'sipp_scenario*_test.yml'|sort) echo "$(date) - =================================================================================" diff --git a/scenarios/invite/sip_messages00_test.yml.tt2 b/scenarios/invite/sipp_scenario00_test.yml.tt2 similarity index 100% rename from scenarios/invite/sip_messages00_test.yml.tt2 rename to scenarios/invite/sipp_scenario00_test.yml.tt2 diff --git a/scenarios/invite/sip_messages_responder00_test.yml.tt2 b/scenarios/invite/sipp_scenario_responder00_test.yml.tt2 similarity index 100% rename from scenarios/invite/sip_messages_responder00_test.yml.tt2 rename to scenarios/invite/sipp_scenario_responder00_test.yml.tt2