allow validation of a remote CryptoBox through a redirecting router
This commit is contained in:
parent
5cf24ebede
commit
42181f47b0
38 changed files with 49 additions and 41 deletions
|
@ -29,12 +29,19 @@ CDWRITER="2,0,0"
|
|||
|
||||
####################### validation ########################
|
||||
|
||||
# directory of the test-cases
|
||||
VALIDATE_TEST_CASES_DIR=$ROOT_DIR/validation/test-cases
|
||||
|
||||
# TODO: take care, that this file exists! (it is created during "upload", "diff" or "merge")
|
||||
# who knows, what this should mean?
|
||||
|
||||
VALIDATE_HOST_ADDRESS=192.168.0.23:80
|
||||
# override these settings if the CryptoBox is not directly available
|
||||
# in this case they should point to a redirecting router
|
||||
VALIDATE_HOST_IP=192.168.0.23
|
||||
VALIDATE_HTTP_PORT=80
|
||||
VALIDATE_HTTPS_PORT=443
|
||||
|
||||
# destination directories for the results
|
||||
VALIDATE_REPORT_DIR=/tmp/cryptobox-validation-$$
|
||||
VALIDATE_REPORT_DIR=$ROOT_DIR/validation/report
|
||||
VALIDATE_SUMMARY_TEMPLATE_DIR=$ROOT_DIR/validation/templates
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
url http://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTP_PORT_/cryptobox
|
||||
data action=init_ask
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/croptyfox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/croptyfox
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23
|
||||
url http://_HOST_IP_:_HTTPS_PORT_
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=init_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=init_ask
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=init_do
|
||||
data password=
|
||||
data password2=
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=init_do
|
||||
data password=hallo
|
||||
data password2=hall
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=init_do
|
||||
data password=hallo
|
||||
data password2=hallo
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=mount_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=mount_ask
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=mount_do
|
||||
data password=hallo
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=umount_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=umount_ask
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=umount_do
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=umount_do
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=config_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=config_ask
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=config_do
|
||||
data language=de
|
||||
data ip=192.168.0.23
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=init_do
|
||||
data password=hallo
|
||||
data password2=hallo
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=mount_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=mount_ask
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=mount_do
|
||||
data password=hallo
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=umount_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=umount_ask
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=umount_do
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=umount_do
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=config_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=config_ask
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=config_do
|
||||
data language=en
|
||||
data ip=192.168.0.23
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=init_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=init_ask
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=init_do
|
||||
data password=hallo
|
||||
data password2=hallo
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=mount_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=mount_ask
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=mount_do
|
||||
data password=
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=mount_do
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=mount_do
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=mount_do
|
||||
data password=hallo
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=mount_do
|
||||
data password=hallo
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=mount_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=mount_ask
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=mount_do
|
||||
data password=hallo
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=umount_ask
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=umount_ask
|
||||
|
|
|
@ -1 +1 @@
|
|||
url https://192.168.0.23/cryptobox?action=umount_do
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox?action=umount_do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=config_do
|
||||
data language=xy
|
||||
data ip=192.168.0.23
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=config_do
|
||||
data language=de
|
||||
data ip=192-168.0.23
|
||||
data ip=192.168.0.23
|
||||
data timeout=30
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=config_do
|
||||
data language=de
|
||||
data ip=192.168.0.23
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
url https://192.168.0.23/cryptobox
|
||||
url http://_HOST_IP_:_HTTPS_PORT_/cryptobox
|
||||
data action=config_do
|
||||
data language=en
|
||||
data ip=10.1.1.1
|
||||
|
|
|
@ -50,7 +50,8 @@ function do_single()
|
|||
# Parameter: "test case dir" "output directory for results"
|
||||
{
|
||||
local TESTNAME=$(basename $1)
|
||||
curl --insecure --silent --output "${2}/${TESTNAME}.html" --config "$1/input.curl"
|
||||
# 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 -
|
||||
# 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"
|
||||
|
@ -109,10 +110,10 @@ import_style()
|
|||
[ -d "VALIDATE_REPORT_DIR/img" ] && rm -r "$VALIDATE_REPORT_DIR/img"
|
||||
mkdir -p "$VALIDATE_REPORT_DIR/img"
|
||||
[ -e "$VALIDATE_REPORT_DIR/cryptobox.css" ] && rm "$VALIDATE_REPORT_DIR/cryptobox.css"
|
||||
wget -q -O "$VALIDATE_REPORT_DIR/cryptobox.css" http://$VALIDATE_HOST_ADDRESS/cryptobox.css
|
||||
wget -q -O "$VALIDATE_REPORT_DIR/cryptobox.css" http://$VALIDATE_HOST_IP:$VALIDATE_HTTP_PORT/cryptobox.css
|
||||
# extract image file names
|
||||
grep "url(img/" "$VALIDATE_REPORT_DIR/cryptobox.css" | sed 's#^.*url(img/\(.*\)).*$#\1#' | while read a
|
||||
do wget -q -O "$VALIDATE_REPORT_DIR/img/$a" "http://$VALIDATE_HOST_ADDRESS/img/$a"
|
||||
do wget -q -O "$VALIDATE_REPORT_DIR/img/$a" "http://$VALIDATE_HOST_IP:$VALIDATE_HTTP_PORT/img/$a"
|
||||
done
|
||||
|
||||
# change the stylesheet link in every html file in REPORT_DIR
|
||||
|
|
Loading…
Reference in a new issue