From 25613b44043c0b917dcb1007997046082babf1d1 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Thu, 12 Feb 2015 15:29:16 -0200 Subject: [PATCH] Add tests for the reverse proxy --- test/bin/curl | 1 + test/reverse_proxy_test.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) create mode 100644 test/reverse_proxy_test.sh diff --git a/test/bin/curl b/test/bin/curl index dd8bf04..d81769d 100755 --- a/test/bin/curl +++ b/test/bin/curl @@ -9,5 +9,6 @@ unset https_proxy --silent \ --noproxy '*' \ --fail \ + --insecure \ --header 'Host: softwarepublico.dev' \ "$@" diff --git a/test/reverse_proxy_test.sh b/test/reverse_proxy_test.sh new file mode 100644 index 0000000..84a36e3 --- /dev/null +++ b/test/reverse_proxy_test.sh @@ -0,0 +1,13 @@ +. $(dirname $0)/test_helper.sh + +test_redirect_http_to_https() { + local redirect="$(./test/bin/curl --head http://$reverseproxy/ | sed -e '/Location:/ !d; s/\r//')" + assertEquals "Location: https://softwarepublico.dev/" "$redirect" +} + +test_reverse_proxy_to_colab() { + local title="$(./test/bin/curl https://$reverseproxy/dashboard | grep '' | sed -e 's/^\s*//')" + assertEquals "<title>Home - Colab" "$title" +} + +. shunit2 -- libgit2 0.21.2