From 0a126d922696c8b5cbb1b7a2c79ad62f3ad2aeb2 Mon Sep 17 00:00:00 2001 From: skublik Date: Fri, 28 Sep 2018 15:12:00 +0000 Subject: [PATCH 1/2] removing mistakes in shibboleth tests --- demo/shibboleth/tests/main.bats | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/demo/shibboleth/tests/main.bats b/demo/shibboleth/tests/main.bats index 4d98519..c81a96c 100755 --- a/demo/shibboleth/tests/main.bats +++ b/demo/shibboleth/tests/main.bats @@ -9,7 +9,7 @@ load ../../../library } @test "010 Initialize and start midPoint" { - cd ../simple ; docker-compose up -d + cd ../simple ; env AUTHENTICATION=shibboleth docker-compose up -d wait_for_midpoint_start simple_midpoint-server_1 } @@ -24,23 +24,19 @@ load ../../../library } @test "040 Check Shibboleth redirection (/midpoint)" { - status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint)" - [ "$status" -eq 302 ] + curl -k --write-out %{redirect_url} --silent --output /dev/null https://localhost:8443/midpoint | grep 'https:\/\/localhost:4443\/idp\/profile\/SAML2\/Redirect' } @test "041 Check Shibboleth redirection (/midpoint/)" { - status="$(curl -k --write-out %{http_code} --silent --output /dev/null https://localhost:8443/midpoint/)" - [ "$status" -eq 302 ] + curl -k --write-out %{redirect_url} --silent --output /dev/null https://localhost:8443/midpoint/ | grep 'https:\/\/localhost:4443\/idp\/profile\/SAML2\/Redirect' } @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 ] + curl -k --write-out %{redirect_url} --silent --output /dev/null https://localhost:8443/midpoint/login | grep 'https:\/\/localhost:4443\/idp\/profile\/SAML2\/Redirect' } @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 ] + curl -k --write-out %{redirect_url} --silent --output /dev/null https://localhost:8443/midpoint/something | grep 'https:\/\/localhost:4443\/idp\/profile\/SAML2\/Redirect' } @test "044 Check SOAP without Shibboleth redirection (/midpoint/ws/)" { From d19dfc400d8805e619311b18e3c095a4e69b5876 Mon Sep 17 00:00:00 2001 From: skublik Date: Fri, 28 Sep 2018 15:13:48 +0000 Subject: [PATCH 2/2] removing TODO --- demo/shibboleth/tests/main.bats | 3 --- 1 file changed, 3 deletions(-) diff --git a/demo/shibboleth/tests/main.bats b/demo/shibboleth/tests/main.bats index c81a96c..9c044c6 100755 --- a/demo/shibboleth/tests/main.bats +++ b/demo/shibboleth/tests/main.bats @@ -49,9 +49,6 @@ load ../../../library [ "$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" { cd ../simple ; docker-compose down -v ; true docker-compose down -v