TT#81700 store failed scenarios in file

* add -f option to define SCENARIOS

Change-Id: If8ddaccb30b93a0b651f4a87cc7637187bb55038
mr10.0
Victor Seva 5 years ago
parent bc665bdbe9
commit d7840212fb

@ -19,21 +19,28 @@ usage() {
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 -e "\\t-f scenarios file"
echo "BASE_DIR:${BASE_DIR}"
echo "BIN_DIR:${BIN_DIR}"
}
get_scenarios() {
while read -r t; do
SCEN+=( "${t}" )
done < <("${BIN_DIR}/get_scenarios.sh" -p "${PROFILE}" -x "${GROUP}")
if [ -n "${SCEN_FILE}" ]; then
while read -r t; do
SCEN+=( "${t}" )
done < "${SCEN_FILE}"
else
while read -r t; do
SCEN+=( "${t}" )
done < <("${BIN_DIR}/get_scenarios.sh" -p "${PROFILE}" -x "${GROUP}")
fi
if [[ ${#SCEN[@]} == 0 ]]; then
echo "$(date) no scenarios found"
exit 1
fi
}
while getopts 'hgGp:TPrR:cx:' opt; do
while getopts 'hf:gGp:TPrR:cx:' opt; do
case $opt in
h) usage; exit 0;;
G) GRAPH="-G";;
@ -45,6 +52,7 @@ while getopts 'hgGp:TPrR:cx:' opt; do
c) CDR="-c";;
p) PROFILE=${OPTARG};;
x) GROUP=${OPTARG};;
f) SCEN_FILE=${OPTARG};;
*) usage; exit 1;;
esac
done
@ -83,5 +91,5 @@ tap_cmd=()
for t in "${SCEN[@]}" ; do
tap_cmd+=( "result/${GROUP}/${t}/"*tap )
done
prove -f -Q "${tap_cmd[@]}"
prove -f -Q "${tap_cmd[@]}" |grep 'Failed:'|awk -F/ '{print $3}'|uniq > "result/${GROUP}/result_failed.txt"
exit ${status}

@ -31,9 +31,15 @@ error_flag=0
SCEN=()
get_scenarios() {
while read -r t; do
SCEN+=( "${t}" )
done < <("${BIN_DIR}/get_scenarios.sh" -p "${PROFILE}" -x "${GROUP}")
if [ -n "${SCEN_FILE}" ]; then
while read -r t; do
SCEN+=( "${t}" )
done < "${SCEN_FILE}"
else
while read -r t; do
SCEN+=( "${t}" )
done < <("${BIN_DIR}/get_scenarios.sh" -p "${PROFILE}" -x "${GROUP}")
fi
if [[ ${#SCEN[@]} == 0 ]]; then
echo "$(date) no scenarios found"
exit 1
@ -236,13 +242,14 @@ usage() {
echo -e "\\t\\tfull: provision all scenarios in one step"
echo -e "\\t\\tstep: provision scenario one by one before execution"
echo -e "\\t\\tnone: skip any provision"
echo -e "\\t-f scenarios file"
echo -e "\\t-h this help"
echo "BASE_DIR:${BASE_DIR}"
echo "BIN_DIR:${BIN_DIR}"
}
while getopts 'hlCcP:p:kKx:rm' opt; do
while getopts 'f:hlCcP:p:kKx:rm' opt; do
case $opt in
h) usage; exit 0;;
l) SHOW_SCENARIOS=true;;
@ -255,6 +262,7 @@ while getopts 'hlCcP:p:kKx:rm' opt; do
r) FIX_RETRANS=true;;
c) CDR=true;;
m) MEMDBG=true;;
f) SCEN_FILE=${OPTARG};;
*) usage; exit 1;;
esac
done
@ -353,6 +361,7 @@ fi
# find SERVER_IP
get_config
failed=()
for t in "${SCEN[@]}"; do
echo "$(date) - ================================================================================="
echo "$(date) - Run [${GROUP}/${PROFILE}]: ${t}"
@ -376,6 +385,7 @@ for t in "${SCEN[@]}"; do
if ! "${BIN_DIR}/check.sh" "${OPTS[@]}" -p "${PROFILE}" -s "${GROUP}" "${t}" ; then
echo "ERROR: ${t}"
failed+=( "${t}" )
error_flag=1
fi
@ -399,6 +409,15 @@ for t in "${SCEN[@]}"; do
fi
done
rm -f "${LOG_DIR}/run_failed.txt"
for t in ${failed[*]}; do
echo "$t" >> "${LOG_DIR}/run_failed.txt"
done
if [ -f "${LOG_DIR}/run_failed.txt" ]; then
echo "$(date) - Failed scenarios:"
cat "${LOG_DIR}/run_failed.txt"
fi
if [[ "${PROV_TYPE}" == "full" ]] ; then
echo "$(date) - Delete provided scenarios"
SCENARIOS="${SCEN[*]}" "${BIN_DIR}/provide_scenarios.sh" \

Loading…
Cancel
Save