allow validation of a remote CryptoBox through a redirecting router

master
lars 18 years ago
parent 5cf24ebede
commit 42181f47b0
  1. 9
      etc-defaults.d/cbox-dev.conf
  2. 2
      validation/test-cases/1-init/000-main/input.curl
  3. 2
      validation/test-cases/1-init/003-no_ssl/input.curl
  4. 2
      validation/test-cases/1-init/005-file_not_found_404/input.curl
  5. 2
      validation/test-cases/1-init/007-index_url/input.curl
  6. 2
      validation/test-cases/1-init/010-init_ask/input.curl
  7. 2
      validation/test-cases/1-init/020-init_empty_pw/input.curl
  8. 2
      validation/test-cases/1-init/030-init_different_pw/input.curl
  9. 2
      validation/test-cases/1-init/040-init_wrong_confirmation/input.curl
  10. 2
      validation/test-cases/1-init/050-mount_ask_before_init/input.curl
  11. 2
      validation/test-cases/1-init/060-mount_do_before_init/input.curl
  12. 2
      validation/test-cases/1-init/070-umount_ask_before_init/input.curl
  13. 2
      validation/test-cases/1-init/080-umount_do_before_init/input.curl
  14. 2
      validation/test-cases/1-init/090-config_ask_before_init/input.curl
  15. 2
      validation/test-cases/1-init/100-config_do_before_init/input.curl
  16. 2
      validation/test-cases/1-init/110-init_valid/input.curl
  17. 2
      validation/test-cases/1-init/120-mount_ask_during_init/input.curl
  18. 2
      validation/test-cases/1-init/130-mount_do_during_init/input.curl
  19. 2
      validation/test-cases/1-init/140-umount_ask_during_init/input.curl
  20. 2
      validation/test-cases/1-init/150-umount_do_during_init/input.curl
  21. 2
      validation/test-cases/1-init/160-config_ask_during_init/input.curl
  22. 2
      validation/test-cases/1-init/170-config_do_during_init/input.curl
  23. 2
      validation/test-cases/1-init/180-init_ask_during_init/input.curl
  24. 2
      validation/test-cases/1-init/190-init_do_during_init/input.curl
  25. 2
      validation/test-cases/2-mount/010-mount_ask/input.curl
  26. 2
      validation/test-cases/2-mount/020-mount_empty_pw/input.curl
  27. 2
      validation/test-cases/2-mount/025-mount_no_pw/input.curl
  28. 2
      validation/test-cases/2-mount/030-mount_do_invalid_pw/input.curl
  29. 2
      validation/test-cases/2-mount/040-mount_do_valid/input.curl
  30. 2
      validation/test-cases/2-mount/050-mount_ask_while_mounted/input.curl
  31. 2
      validation/test-cases/2-mount/060-mount_do_while_mounted/input.curl
  32. 2
      validation/test-cases/2-mount/070-umount_ask/input.curl
  33. 2
      validation/test-cases/2-mount/080-umount_do/input.curl
  34. 2
      validation/test-cases/3-config/100-config_invalid_lang/input.curl
  35. 4
      validation/test-cases/3-config/110-config_invalid_ip/input.curl
  36. 2
      validation/test-cases/3-config/120-config_invalid_timeout/input.curl
  37. 2
      validation/test-cases/3-config/500-config_valid/input.curl
  38. 7
      validation/validate.sh

@ -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…
Cancel
Save