|
|
|
@ -21,6 +21,8 @@ function do_single()
|
|
|
|
|
local TESTNAME=$(basename $1)
|
|
|
|
|
# replace IPs and ports in the curl-file by local settings
|
|
|
|
|
cat "$1/input.curl" | substitute_constants | curl --insecure --silent --output "${2}/${TESTNAME}.html" --config -
|
|
|
|
|
# remove possible refresh-redirect
|
|
|
|
|
sed -i 's/<meta http-equiv="refresh"[^>]*>//g' "${2}/${TESTNAME}.html"
|
|
|
|
|
# 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"
|
|
|
|
@ -103,7 +105,8 @@ function substitute_constants()
|
|
|
|
|
|
|
|
|
|
##################### main ###########################
|
|
|
|
|
|
|
|
|
|
ACTION="--help"
|
|
|
|
|
# do all checks, if nothing is specified
|
|
|
|
|
ACTION="check_all"
|
|
|
|
|
[ $# -gt 0 ] && ACTION=$1
|
|
|
|
|
|
|
|
|
|
case "$ACTION" in
|
|
|
|
@ -120,6 +123,7 @@ case "$ACTION" in
|
|
|
|
|
import_style
|
|
|
|
|
;;
|
|
|
|
|
check_all )
|
|
|
|
|
# default action
|
|
|
|
|
"$0" list | sort | while read a
|
|
|
|
|
do echo -n "Validating $a ..."
|
|
|
|
|
"$0" check "$a"
|
|
|
|
@ -128,9 +132,9 @@ case "$ACTION" in
|
|
|
|
|
;;
|
|
|
|
|
* )
|
|
|
|
|
echo "Syntax of $(basename $0)"
|
|
|
|
|
echo -e "\t list \t\t - show a list of available test cases"
|
|
|
|
|
echo -e "\t check_all \t - execute all test cases [default]"
|
|
|
|
|
echo -e "\t check NAME \t - execute a test case"
|
|
|
|
|
echo -e "\t check_all \t - execute all test cases"
|
|
|
|
|
echo -e "\t list \t\t - show a list of available test cases"
|
|
|
|
|
echo -e "\t help \t\t - this syntax information"
|
|
|
|
|
echo
|
|
|
|
|
;;
|
|
|
|
|