Skip to content
Permalink
Browse files

Fix demo/complex tests (hopefully)

1. xpath -> xmllint
2. added some docker containers cleanup
  • Loading branch information
mederly committed Sep 28, 2018
1 parent 5f10031 commit ec257f5f8ad0b88cb8bc833f6cdd221d5e9365f1
Showing with 11 additions and 3 deletions.
  1. +2 −0 Jenkinsfile
  2. +2 −0 demo/complex/tests/main.bats
  3. +2 −2 demo/shibboleth/tests/main.bats
  4. +5 −1 library.bash
@@ -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'
@@ -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?)
@@ -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
}
@@ -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
}

0 comments on commit ec257f5

Please sign in to comment.
You can’t perform that action at this time.