forked from docker/midPoint_container
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do first attempt at testing midPoint container
- Loading branch information
Showing
5 changed files
with
68 additions
and
5 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,22 @@ | ||
| #!/bin/bash | ||
|
|
||
| trap 'exitcode=$? ; echo "Exiting midpoint/test.sh because of an error ($exitcode) occurred" ; exit $exitcode' ERR | ||
|
|
||
| cd "$(dirname "$0")" | ||
| . ../test/common.sh | ||
|
|
||
| yellow "*** Composing midPoint..." | ||
| docker-compose up --no-start | ||
| green "==> midPoint composed OK" | ||
| echo | ||
| yellow "*** Starting midPoint..." | ||
| docker-compose start | ||
| green "==> midPoint started OK" | ||
| echo | ||
| yellow "*** Waiting for midPoint to start..." | ||
| test/wait-for-start.sh | ||
| green "==> midPoint started" | ||
| echo | ||
| yellow "*** Checking health via HTTP..." | ||
| (set -o pipefail ; curl -k -f https://localhost:8443/midpoint/actuator/health | tr -d '[:space:]' | grep -q "\"status\":\"UP\"") | ||
| green "==> Health is OK" |
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,16 @@ | ||
| #!/bin/bash | ||
|
|
||
| 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 midpoint_midpoint-server_1 2>&1 | grep "INFO (com.evolveum.midpoint.web.boot.MidPointSpringApplication): Started MidPointSpringApplication in" ) && exit 0 | ||
| done | ||
|
|
||
| echo midPoint did not start in $(( $MAX_ATTEMPTS * $DELAY )) seconds | ||
| exit 1 |
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,10 @@ | ||
| #!/bin/bash | ||
|
|
||
| . test/common.sh | ||
|
|
||
| trap 'exitcode=$? ; red "Exiting test.sh because of an error ($exitcode) occurred" ; exit $exitcode' ERR | ||
| echo "**************************************************************************************" | ||
| echo "*** Testing midPoint image ***" | ||
| echo "**************************************************************************************" | ||
| echo | ||
| midpoint/test.sh |
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 | ||
|
|
||
| RED='\033[1;31m' | ||
| YELLOW='\033[1;33m' | ||
| GREEN='\033[1;32m' | ||
| NC='\033[0m' | ||
|
|
||
| function red () { | ||
| echo -e ${RED}$*${NC} | ||
| } | ||
|
|
||
| function yellow () { | ||
| echo -e ${YELLOW}$*${NC} | ||
| } | ||
|
|
||
| function green () { | ||
| echo -e ${GREEN}$*${NC} | ||
| } |