substitute constants in predicted validation result files
This commit is contained in:
parent
2cec33cd2c
commit
f395dedb4f
|
@ -51,13 +51,13 @@ 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
|
||||||
sed "s/_HOST_IP_/$VALIDATE_HOST_IP/g; s/_HTTP_PORT_/$VALIDATE_HTTP_PORT/g; s/_HTTPS_PORT_/$VALIDATE_HTTPS_PORT/g" "$1/input.curl" | curl --insecure --silent --output "${2}/${TESTNAME}.html" --config -
|
cat "$1/input.curl" | substitute_constants | curl --insecure --silent --output "${2}/${TESTNAME}.html" --config -
|
||||||
# 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"
|
||||||
# the diff option "-B" is required, because the status output of
|
# the diff option "-B" is required, because the status output of
|
||||||
# the cryptobox.pl script contains some blank lines
|
# the cryptobox.pl script contains some blank lines
|
||||||
diff -NB "${2}/${TESTNAME}.status" "$1/output" >"${2}/${TESTNAME}.diff" || true
|
cat "$1/output" | substitute_constants | diff -NB "${2}/${TESTNAME}.status" - >"${2}/${TESTNAME}.diff" || true
|
||||||
rm "${2}/${TESTNAME}.status"
|
rm "${2}/${TESTNAME}.status"
|
||||||
fi
|
fi
|
||||||
cp "$1/description" "${2}/${TESTNAME}.desc"
|
cp "$1/description" "${2}/${TESTNAME}.desc"
|
||||||
|
@ -78,7 +78,7 @@ function do_series()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
create_summary()
|
function create_summary()
|
||||||
# parameter: directory of results
|
# parameter: directory of results
|
||||||
{
|
{
|
||||||
cat "$VALIDATE_SUMMARY_TEMPLATE_DIR/header"
|
cat "$VALIDATE_SUMMARY_TEMPLATE_DIR/header"
|
||||||
|
@ -103,7 +103,7 @@ create_summary()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
import_style()
|
function import_style()
|
||||||
# get the stylesheet file and images
|
# get the stylesheet file and images
|
||||||
# change the stylesheet link
|
# change the stylesheet link
|
||||||
{
|
{
|
||||||
|
@ -123,6 +123,13 @@ import_style()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function substitute_constants()
|
||||||
|
{
|
||||||
|
sed "s/_HOST_IP_/$VALIDATE_HOST_IP/g; s/_HTTP_PORT_/$VALIDATE_HTTP_PORT/g; s/_HTTPS_PORT_/$VALIDATE_HTTPS_PORT/g"
|
||||||
|
}
|
||||||
|
|
||||||
|
##################### main ###########################
|
||||||
|
|
||||||
ACTION="--help"
|
ACTION="--help"
|
||||||
[ $# -gt 0 ] && ACTION=$1
|
[ $# -gt 0 ] && ACTION=$1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue