Commit 25613b44043c0b917dcb1007997046082babf1d1

Authored by Antonio Terceiro
1 parent 37a51f8c

Add tests for the reverse proxy

Showing 2 changed files with 14 additions and 0 deletions   Show diff stats
test/bin/curl
... ... @@ -9,5 +9,6 @@ unset https_proxy
9 9 --silent \
10 10 --noproxy '*' \
11 11 --fail \
  12 + --insecure \
12 13 --header 'Host: softwarepublico.dev' \
13 14 "$@"
... ...
test/reverse_proxy_test.sh 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +. $(dirname $0)/test_helper.sh
  2 +
  3 +test_redirect_http_to_https() {
  4 + local redirect="$(./test/bin/curl --head http://$reverseproxy/ | sed -e '/Location:/ !d; s/\r//')"
  5 + assertEquals "Location: https://softwarepublico.dev/" "$redirect"
  6 +}
  7 +
  8 +test_reverse_proxy_to_colab() {
  9 + local title="$(./test/bin/curl https://$reverseproxy/dashboard | grep '<title>' | sed -e 's/^\s*//')"
  10 + assertEquals "<title>Home - Colab</title>" "$title"
  11 +}
  12 +
  13 +. shunit2
... ...