From 80165ac1edcdb8c137a3e5f0152a6ecbcd880368 Mon Sep 17 00:00:00 2001 From: skublik Date: Fri, 28 Sep 2018 13:14:33 +0000 Subject: [PATCH] tests for shibboleth redirection --- demo/shibboleth/tests/main.bats | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/demo/shibboleth/tests/main.bats b/demo/shibboleth/tests/main.bats index 48a4f5a..4d98519 100755 --- a/demo/shibboleth/tests/main.bats +++ b/demo/shibboleth/tests/main.bats @@ -23,6 +23,37 @@ load ../../../library check_health } +@test "040 Check Shibboleth redirection (/midpoint)" { + status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint)" + [ "$status" -eq 302 ] +} + +@test "041 Check Shibboleth redirection (/midpoint/)" { + status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint/)" + [ "$status" -eq 302 ] +} + +@test "042 Check Shibboleth redirection (/midpoint/login)" { + status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint/login)" + [ "$status" -eq 302 ] +} + +@test "043 Check Shibboleth redirection (/midpoint/something)" { + status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint/something)" + [ "$status" -eq 302 ] +} + +@test "044 Check SOAP without Shibboleth redirection (/midpoint/ws/)" { + status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint/ws/)" + [ "$status" -eq 200 ] +} + +@test "045 Check SOAP without Shibboleth redirection (/midpoint/model/)" { + status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint/model/)" + [ "$status" -eq 200 ] +} + + # TODO check that e.g. accessing some URLs results in shibboleth redirection (check login page, some REST calls etc) @test "999 Clean up" {