|
|
|
@ -28,11 +28,14 @@ function do_single()
|
|
|
|
|
{
|
|
|
|
|
local TESTNAME=$(basename $1)
|
|
|
|
|
curl --insecure --silent --output "${2}/${TESTNAME}.html" --config "$1/input.curl"
|
|
|
|
|
[ -e "${2}/${TESTNAME}.html" ] && sed "1,/CBOX-STATUS-begin/d; /CBOX-STATUS-end/,\$d" "${2}/${TESTNAME}.html" >"${2}/${TESTNAME}.status"
|
|
|
|
|
# the diff option "-B" is required, because the status output of
|
|
|
|
|
# the cryptobox.pl script contains some blank lines
|
|
|
|
|
diff -NB "${2}/${TESTNAME}.status" "$1/output" >"${2}/${TESTNAME}.diff" || true
|
|
|
|
|
rm "${2}/${TESTNAME}.status"
|
|
|
|
|
# there is no status in certain cases - e.g. for error 404
|
|
|
|
|
if [ -e "${2}/${TESTNAME}.html" ]
|
|
|
|
|
then sed "1,/CBOX-STATUS-begin/d; /CBOX-STATUS-end/,\$d" "${2}/${TESTNAME}.html" >"${2}/${TESTNAME}.status"
|
|
|
|
|
# the diff option "-B" is required, because the status output of
|
|
|
|
|
# the cryptobox.pl script contains some blank lines
|
|
|
|
|
diff -NB "${2}/${TESTNAME}.status" "$1/output" >"${2}/${TESTNAME}.diff" || true
|
|
|
|
|
rm "${2}/${TESTNAME}.status"
|
|
|
|
|
fi
|
|
|
|
|
cp "$1/description" "${2}/${TESTNAME}.desc"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -47,7 +50,7 @@ function do_series()
|
|
|
|
|
done
|
|
|
|
|
create_summary "$REPORT_DIR/$1" >"$REPORT_DIR/$1/summary.html"
|
|
|
|
|
tar czf "$REPORT_DIR/${1}-results.tar.gz" -C "$REPORT_DIR" "$1"
|
|
|
|
|
echo "$REPORT_DIR/${1}-results.tar.gz"
|
|
|
|
|
#echo "$REPORT_DIR/${1}-results.tar.gz"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -65,12 +68,12 @@ create_summary()
|
|
|
|
|
sed 's#$#<br/>#' "$DIFF_FILE"
|
|
|
|
|
else cat "$SUMMARY_TEMPLATE_DIR/result-ok"
|
|
|
|
|
echo "no differences found"
|
|
|
|
|
# remove empty diff
|
|
|
|
|
[ -e "$DIFF_FILE" ] && rm "$DIFF_FILE"
|
|
|
|
|
fi
|
|
|
|
|
cat "$SUMMARY_TEMPLATE_DIR/single_footer"
|
|
|
|
|
# remove description file
|
|
|
|
|
rm "$a"
|
|
|
|
|
# remove if empty
|
|
|
|
|
[ -e "$DIFF_FILE" -a ! -s "$DIFF_FILE" ] && rm "$DIFF_FILE"
|
|
|
|
|
done
|
|
|
|
|
cat "$SUMMARY_TEMPLATE_DIR/footer"
|
|
|
|
|
}
|
|
|
|
@ -91,10 +94,21 @@ case "$ACTION" in
|
|
|
|
|
[ ! -d "$CASE_DIR" ] && error_die 2 "the test case was not found ($CASE_DIR)!"
|
|
|
|
|
do_series "$2"
|
|
|
|
|
;;
|
|
|
|
|
check_all )
|
|
|
|
|
"$0" list | sort | while read a
|
|
|
|
|
do echo -n "Validating $a ..."
|
|
|
|
|
"$0" check "$a"
|
|
|
|
|
echo
|
|
|
|
|
echo -n "Waiting 20 seconds ..."
|
|
|
|
|
sleep 20
|
|
|
|
|
echo
|
|
|
|
|
done
|
|
|
|
|
;;
|
|
|
|
|
* )
|
|
|
|
|
echo "Syntax of $(basename $0)"
|
|
|
|
|
echo -e "\t list \t\t - show a list of available test cases"
|
|
|
|
|
echo -e "\t check NAME \t - execute a test case - if successful the filename of the report is printed"
|
|
|
|
|
echo -e "\t check NAME \t - execute a test case"
|
|
|
|
|
echo -e "\t check_all \t - execute all test cases"
|
|
|
|
|
echo -e "\t help \t\t - this syntax information"
|
|
|
|
|
echo
|
|
|
|
|
;;
|
|
|
|
|