From 27acbc616e18ee8ceed05259220f89376e362499 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 28 Sep 2018 10:47:57 +0200 Subject: [PATCH] Add basic Shibboleth tests --- Jenkinsfile | 1 + demo/shibboleth/README.md | 3 +++ demo/shibboleth/tests/main.bats | 31 +++++++++++++++++++++++++++++++ demo/simple/tests/main.bats | 5 ++++- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 demo/shibboleth/README.md create mode 100755 demo/shibboleth/tests/main.bats diff --git a/Jenkinsfile b/Jenkinsfile index 9d177f9..e854504 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,6 +53,7 @@ pipeline { try { sh 'bin/test.sh 2>&1 | tee debug' sh '(cd demo/simple ; bats tests ) 2>&1 | tee -a debug' + sh '(cd demo/shibboleth ; bats tests ) 2>&1 | tee -a debug' // sh 'echo Test output ; cat debug' } catch (error) { def error_details = readFile('./debug') diff --git a/demo/shibboleth/README.md b/demo/shibboleth/README.md new file mode 100644 index 0000000..79a1bb8 --- /dev/null +++ b/demo/shibboleth/README.md @@ -0,0 +1,3 @@ +This container composition is to be used outside other midPoint compositions like `demo/simple` or `demo/postgresql-full`. + +Just start it along with the other midPoint composition. They should work together seamlessly. diff --git a/demo/shibboleth/tests/main.bats b/demo/shibboleth/tests/main.bats new file mode 100755 index 0000000..778b35f --- /dev/null +++ b/demo/shibboleth/tests/main.bats @@ -0,0 +1,31 @@ +#!/usr/bin/env bats + +load ../../../common +load ../../../library + +@test "000 Cleanup before running the tests" { + cd ../simple ; docker-compose down -v ; true + run docker-compose down -v +} + +@test "010 Initialize and start midPoint" { + cd ../simple ; docker-compose up -d + wait_for_midpoint_start simple_midpoint-server_1 +} + +@test "020 Initialize and start Shibboleth" { + docker-compose up -d + # TODO implement wait_for_shibboleth_start + sleep 20 +} + +@test "030 Check health" { + check_health +} + +# 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 + run docker-compose down -v +} diff --git a/demo/simple/tests/main.bats b/demo/simple/tests/main.bats index 530c53e..9b07272 100755 --- a/demo/simple/tests/main.bats +++ b/demo/simple/tests/main.bats @@ -3,8 +3,11 @@ load ../../../common load ../../../library -@test "000 Initialize and start midPoint" { +@test "000 Cleanup before running the tests" { run docker-compose down -v +} + +@test "010 Initialize and start midPoint" { docker-compose up -d wait_for_midpoint_start simple_midpoint-server_1 }