From 4dd717c7cd75c8ba70b58d99b4b195092222d1d9 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Wed, 3 Oct 2018 22:02:25 +0200 Subject: [PATCH] Add demo/postgresql tests --- Jenkinsfile | 1 + demo/postgresql/tests/main.bats | 34 +++++++++++++++++++++++++++++++++ tests/main.bats | 7 ++++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 demo/postgresql/tests/main.bats diff --git a/Jenkinsfile b/Jenkinsfile index 7831838..23b655b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,6 +57,7 @@ pipeline { sh '(cd demo/simple ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0' sh '(cd demo/shibboleth ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0' + sh '(cd demo/postgresql ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0' // temporarily disabled //sh '(cd demo/complex ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0' diff --git a/demo/postgresql/tests/main.bats b/demo/postgresql/tests/main.bats new file mode 100755 index 0000000..5d82e6e --- /dev/null +++ b/demo/postgresql/tests/main.bats @@ -0,0 +1,34 @@ +#!/usr/bin/env bats + +load ../../../common +load ../../../library + +@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 postgresql_midpoint_server_1 +} + +@test "010 Check health" { + check_health +} + +@test "100 Get 'administrator'" { + check_health + get_and_check_object users 00000000-0000-0000-0000-000000000002 administrator +} + +@test "110 And and get 'test110'" { + check_health + echo "test110" >/tmp/test110.xml + add_object users /tmp/test110.xml + rm /tmp/test110.xml + search_and_check_object users test110 +} + +@test "999 Clean up" { + docker-compose down -v +} diff --git a/tests/main.bats b/tests/main.bats index 8b10b47..36dc6c1 100755 --- a/tests/main.bats +++ b/tests/main.bats @@ -25,7 +25,12 @@ load ../common cd demo/shibboleth ; docker-compose down -v ; true } -@test "120 Cleanup before further tests - demo/complex" { +@test "120 Cleanup before further tests - demo/postgresql" { + docker ps -a + cd demo/postgresql ; docker-compose down -v ; true +} + +@test "130 Cleanup before further tests - demo/complex" { docker ps -a cd demo/complex ; docker-compose down -v ; true }