Skip to content

Commit 271b251

Browse files
committed
Test extended by the stop command too + updated images
Signed-off-by: David Matějček <[email protected]>
1 parent 8034003 commit 271b251

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

library/glassfish

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Maintainers: David Matejcek <[email protected]> (@dmatej),
33
Ondro Mihalyi <[email protected]> (@ondromih)
44
GitRepo: https://github.com/OmniFish-EE/docker-library-glassfish.git
55
GitFetch: refs/heads/main
6-
GitCommit: 12efd43d7633d89cb28edf3a5b0cf3c12ac31c1f
6+
GitCommit: 3e22307467c6f9557077f9eb4d481e3ede8df30f
77

88
Tags: 7.0.0, 7.0.0-jdk17, 7.0.0-jdk17-eclipse-temurin
99
Architectures: amd64

test/tests/glassfish/run.sh

+18-12
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@ serverImage="$1"
55
containerId="$(docker run -d "$serverImage")"
66
trap "docker rm -vf $containerId > /dev/null" EXIT
77

8-
logLine='^\s+Eclipse GlassFish\s+[\.0-9]+'
9-
timeout=60
8+
waitForLogLine() {
9+
timeout="$1";
10+
logLine="$2";
11+
until docker logs $containerId 2>&1 | grep -q -E "$logLine"
12+
do
13+
if [ $timeout -eq 0 ]
14+
then
15+
exit 100;
16+
fi
17+
sleep 1
18+
timeout=$((timeout-1))
19+
done
20+
}
1021

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

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

0 commit comments

Comments
 (0)