Skip to content

Commit

Permalink
Test extended by the stop command too + updated images
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <[email protected]>
  • Loading branch information
dmatej committed Feb 24, 2023
1 parent 8034003 commit 271b251
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion library/glassfish
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Maintainers: David Matejcek <[email protected]> (@dmatej),
Ondro Mihalyi <[email protected]> (@ondromih)
GitRepo: https://github.com/OmniFish-EE/docker-library-glassfish.git
GitFetch: refs/heads/main
GitCommit: 12efd43d7633d89cb28edf3a5b0cf3c12ac31c1f
GitCommit: 3e22307467c6f9557077f9eb4d481e3ede8df30f

Tags: 7.0.0, 7.0.0-jdk17, 7.0.0-jdk17-eclipse-temurin
Architectures: amd64
Expand Down
30 changes: 18 additions & 12 deletions test/tests/glassfish/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ serverImage="$1"
containerId="$(docker run -d "$serverImage")"
trap "docker rm -vf $containerId > /dev/null" EXIT

logLine='^\s+Eclipse GlassFish\s+[\.0-9]+'
timeout=60
waitForLogLine() {
timeout="$1";
logLine="$2";
until docker logs $containerId 2>&1 | grep -q -E "$logLine"
do
if [ $timeout -eq 0 ]
then
exit 100;
fi
sleep 1
timeout=$((timeout-1))
done
}

until docker logs $containerId 2>&1 | grep -q -E "$logLine"
do
if [ $timeout -eq 0 ]
then
exit 100;
fi
sleep 1
timeout=$((timeout-1))
done
waitForLogLine 60 '^\s+Eclipse GlassFish\s+[\.0-9]+';
echo "GlassFish started as ${containerId}"

echo "Success!"
docker stop "${containerId}" &
waitForLogLine 30 '^\s+Completed shutdown of GlassFish runtime';
echo "GlassFish stopped OK!"

0 comments on commit 271b251

Please sign in to comment.