Skip to content

Commit

Permalink
Add new test to verify if JAVA_HOME works
Browse files Browse the repository at this point in the history
Signed-off-by: Ke Zhu <[email protected]>
  • Loading branch information
Ke Zhu authored and electrum committed Sep 16, 2020
1 parent 1ec879e commit 2d97150
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docker/container-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function cleanup {
fi
}

function test_container {
function test_presto_starts {
local QUERY_PERIOD=5
local QUERY_RETRIES=30

Expand All @@ -33,3 +33,16 @@ function test_container {
# Return proper exit code.
[[ ${RESULT} == '"success"' ]]
}

function test_javahome {
local CONTAINER_NAME=$1
# Check if JAVA_HOME works
docker run --rm "${CONTAINER_NAME}" /bin/bash -c '$JAVA_HOME/bin/java -version' &> /dev/null

[[ "$?" == "0" ]]
}

function test_container {
local CONTAINER_NAME=$1
test_javahome ${CONTAINER_NAME} && test_presto_starts ${CONTAINER_NAME}
}

0 comments on commit 2d97150

Please sign in to comment.