validation: remove refresh-redirects from retrieved pages
validation: 'check_all' is now the default action
This commit is contained in:
parent
11bc71a35f
commit
9c69eb7786
|
@ -21,6 +21,8 @@ function do_single()
|
||||||
local TESTNAME=$(basename $1)
|
local TESTNAME=$(basename $1)
|
||||||
# replace IPs and ports in the curl-file by local settings
|
# 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 -
|
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
|
# there is no status in certain cases - e.g. for error 404
|
||||||
if [ -e "${2}/${TESTNAME}.html" ]
|
if [ -e "${2}/${TESTNAME}.html" ]
|
||||||
then sed "1,/CBOX-STATUS-begin/d; /CBOX-STATUS-end/,\$d" "${2}/${TESTNAME}.html" >"${2}/${TESTNAME}.status"
|
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 ###########################
|
##################### main ###########################
|
||||||
|
|
||||||
ACTION="--help"
|
# do all checks, if nothing is specified
|
||||||
|
ACTION="check_all"
|
||||||
[ $# -gt 0 ] && ACTION=$1
|
[ $# -gt 0 ] && ACTION=$1
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
|
@ -120,6 +123,7 @@ case "$ACTION" in
|
||||||
import_style
|
import_style
|
||||||
;;
|
;;
|
||||||
check_all )
|
check_all )
|
||||||
|
# default action
|
||||||
"$0" list | sort | while read a
|
"$0" list | sort | while read a
|
||||||
do echo -n "Validating $a ..."
|
do echo -n "Validating $a ..."
|
||||||
"$0" check "$a"
|
"$0" check "$a"
|
||||||
|
@ -128,9 +132,9 @@ case "$ACTION" in
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo "Syntax of $(basename $0)"
|
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 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 -e "\t help \t\t - this syntax information"
|
||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue