Skip to content

Commit

Permalink
[bitnami/java] Load entrypoint.sh for tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Gomez <[email protected]>
  • Loading branch information
dgomezleon committed Nov 25, 2024
1 parent fd47877 commit 5aeff26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .vib/java/goss/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
# SPDX-License-Identifier: APACHE-2.0

command:
# Load the entrypoint to unset an environment variable not supported by Java 1.8
# Java 1.8 does not support --version, with -version printing to stderr
# We need to parse the printed version differently depending on the version:
# - Major versions are often shown as "x" instead of "x.0.0"
# - In Java 1.8, the printed version is 1.8.0_x, but $APP_VERSION is formated as 1.8.x
# - Versions are usually printed as x.y.z+b, but $APP_VERSION is formated as x.y.z-r
# - In Java 1.8, the version may also be printed as x.y.z-b0r or x.y.z-br
check-app-version:
exec: java -version 2>&1 | sed -E -e "s/\+/-/g" -e "s/0_//g" -e "s/-b0?/-/g" | grep "$(echo $APP_VERSION | sed -E 's|([0-9]+)\..*|\1|g')"
exec: /opt/bitnami/scripts/java/entrypoint.sh java -version 2>&1 | sed -E -e "s/\+/-/g" -e "s/0_//g" -e "s/-b0?/-/g" | grep "$(echo $APP_VERSION | sed -E 's|([0-9]+)\..*|\1|g')"
exit-status: 0
check-run-jar:
exec: java -jar ./java/goss/testfiles/HelloTest.jar
exec: /opt/bitnami/scripts/java/entrypoint.sh java -jar ./java/goss/testfiles/HelloTest.jar
stdout:
- "Hello VIB"
exit-status: 0

0 comments on commit 5aeff26

Please sign in to comment.