diff --git a/Jenkinsfile b/Jenkinsfile index c270952..1dfc42b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,6 +55,8 @@ pipeline { sh 'bin/test.sh 2>&1 | tee debug ; test ${PIPESTATUS[0]} -eq 0' sh 'echo Docker containers before compositions tests ; docker ps -a' // temporary + sh 'xmllint &>> debug' // temporary + 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/complex ; bats tests ) 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0' diff --git a/demo/complex/tests/main.bats b/demo/complex/tests/main.bats index 3009bd5..b519b12 100755 --- a/demo/complex/tests/main.bats +++ b/demo/complex/tests/main.bats @@ -5,11 +5,13 @@ load ../../../library @test "000 Cleanup before running the tests" { # skip + cd ../shibboleth ; docker-compose down -v ; true run docker-compose down -v } @test "010 Initialize and start the composition" { # skip + docker ps -a docker-compose up -d wait_for_midpoint_start complex_midpoint-server_1 # TODO wait for shibboleth, grouper-ui, (also something other?) diff --git a/demo/shibboleth/tests/main.bats b/demo/shibboleth/tests/main.bats index 778b35f..48a4f5a 100755 --- a/demo/shibboleth/tests/main.bats +++ b/demo/shibboleth/tests/main.bats @@ -16,7 +16,7 @@ load ../../../library @test "020 Initialize and start Shibboleth" { docker-compose up -d # TODO implement wait_for_shibboleth_start - sleep 20 + sleep 60 } @test "030 Check health" { @@ -27,5 +27,5 @@ load ../../../library @test "999 Clean up" { cd ../simple ; docker-compose down -v ; true - run docker-compose down -v + docker-compose down -v } diff --git a/library.bash b/library.bash index 3fa16cd..59c5fa3 100644 --- a/library.bash +++ b/library.bash @@ -117,7 +117,7 @@ function test_resource () { local TMPFILE_ERR=$(mktemp /tmp/test.resource.err.XXXXXX) curl -k --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST "https://localhost:8443/midpoint/ws/rest/resources/$OID/test" >$TMPFILE || (rm $TMPFILE $TMPFILE_ERR ; return 1) - if [[ $(xpath -q -e "*/status/text()" < $TMPFILE) == "success" ]]; then + if [[ $(xmllint --xpath "*/status/text()" $TMPFILE) == "success" ]]; then echo "Resource $OID test succeeded" rm $TMPFILE return 0 @@ -128,3 +128,7 @@ function test_resource () { return 1 fi } + +function get_xpath () { + echo ok +}