forked from docker/midPoint_container
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bats | ||
|
||
load ../../../common | ||
load ../../../library | ||
|
||
@test "000 Initialize and start midPoint" { | ||
run docker-compose down -v | ||
docker-compose up -d | ||
wait_for_midpoint_start simple_midpoint-server_1 | ||
} | ||
|
||
@test "999 Clean up" { | ||
docker-compose down -v | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
function wait_for_midpoint_start () { | ||
ATTEMPT=0 | ||
MAX_ATTEMPTS=20 | ||
DELAY=10 | ||
|
||
until [[ $ATTEMPT = $MAX_ATTEMPTS ]]; do | ||
ATTEMPT=$((ATTEMPT+1)) | ||
echo "Waiting $DELAY seconds for midPoint to start (attempt $ATTEMPT) ..." | ||
sleep $DELAY | ||
docker ps | ||
( docker logs $1 2>&1 | grep "INFO (com.evolveum.midpoint.web.boot.MidPointSpringApplication): Started MidPointSpringApplication in" ) && return 0 | ||
done | ||
|
||
echo midPoint did not start in $(( $MAX_ATTEMPTS * $DELAY )) seconds | ||
return 1 | ||
} |