From 54f02b6e9f20c0e240724b7a8af83a43c3c64152 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Wed, 3 Oct 2018 18:35:59 +0200 Subject: [PATCH] Add some demo/shibboleth tests (related to internal authentication) --- demo/shibboleth/tests/main.bats | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/demo/shibboleth/tests/main.bats b/demo/shibboleth/tests/main.bats index 3bc6fa1..8244ad0 100755 --- a/demo/shibboleth/tests/main.bats +++ b/demo/shibboleth/tests/main.bats @@ -9,7 +9,7 @@ load ../../../library } @test "010 Initialize and start containers" { - env docker-compose up -d + docker-compose up -d } @test "012 Wait for Shibboleth to start up" { @@ -50,6 +50,31 @@ load ../../../library [ "$status" -eq 200 ] } +@test "100 Check internally-authenticated REST call: get 'administrator'" { + check_health + get_and_check_object users 00000000-0000-0000-0000-000000000002 administrator +} + +@test "200 Shut down" { + docker-compose down +} + +@test "210 Start with internal authentication" { + env AUTHENTICATION=internal docker-compose up -d +} + +@test "210 Wait for midPoint to start up" { + wait_for_midpoint_start shibboleth_midpoint_server_1 +} + +@test "220 Check health" { + check_health +} + +@test "230 Check internal login redirection" { + curl -k --write-out %{redirect_url} --silent --output /dev/null https://localhost:8443/midpoint/self/dashboard | grep 'https:\/\/localhost:8443\/midpoint\/login' +} + @test "999 Clean up" { docker-compose down -v }