-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KOGITO-705] - Refactor data-index image in the same way kogito-jobs-…
…service image is structured Signed-off-by: Filippe Spolti <fspolti@redhat.com>
- Loading branch information
Showing
16 changed files
with
206 additions
and
223 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
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,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "${SCRIPT_DEBUG}" = "true" ] ; then | ||
set -x | ||
SHOW_JVM_SETTINGS="-XshowSettings:properties" | ||
echo "Script debugging is enabled, allowing bash commands and their arguments to be printed as they are executed" | ||
echo "JVM settings debug is enabled." | ||
fi | ||
|
||
|
||
# Configuration scripts | ||
# Any configuration script that needs to run on image startup must be added here. | ||
CONFIGURE_SCRIPTS=( | ||
${KOGITO_HOME}/launch/kogito-infinispan-properties.sh | ||
) | ||
source ${KOGITO_HOME}/launch/configure.sh | ||
############################################# | ||
|
||
exec java ${SHOW_JVM_SETTINGS} ${JAVA_OPTIONS} ${INFINISPAN_PROPERTIES}-Djava.library.path=$KOGITO_HOME/lib \ | ||
-Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 \ | ||
-jar $KOGITO_HOME/bin/kogito-data-index-runner.jar |
This file was deleted.
Oops, something went wrong.
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
101 changes: 101 additions & 0 deletions
101
s2i/modules/kogito-data-index/tests/bats/kogito-data-index.bats
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,101 @@ | ||
#!/usr/bin/env bats | ||
|
||
export KOGITO_HOME=/tmp/kogito | ||
export HOME=$KOGITO_HOME | ||
mkdir -p ${KOGITO_HOME}/launch | ||
cp $BATS_TEST_DIRNAME/../../../kogito-infinispan-properties/added/kogito-infinispan-properties.sh ${KOGITO_HOME}/launch/ | ||
|
||
load ${KOGITO_HOME}/launch/kogito-infinispan-properties.sh | ||
|
||
teardown() { | ||
rm -rf ${KOGITO_HOME} | ||
} | ||
|
||
function clear_vars() { | ||
unset INFINISPAN_USEAUTH | ||
unset INFINISPAN_USERNAME | ||
unset INFINISPAN_PASSWORD | ||
unset INFINISPAN_AUTHREALM | ||
unset INFINISPAN_SASLMECHANISM | ||
} | ||
|
||
@test "check if infinispan properties is blank" { | ||
clear_vars | ||
local expected="" | ||
configure_infinispan_props | ||
echo "Result is ${INFINISPAN_PROPERTIES} and expected is ${expected}" >&2 | ||
[ "${expected}" = "${INFINISPAN_PROPERTIES}" ] | ||
} | ||
|
||
|
||
@test "check if infinispan auth is false" { | ||
clear_vars | ||
export INFINISPAN_USEAUTH="false" | ||
local expected=" -Dquarkus.infinispan-client.use-auth=false" | ||
configure_infinispan_props | ||
echo "Result is ${INFINISPAN_PROPERTIES} and expected is ${expected}" >&2 | ||
[ "${expected}" = "${INFINISPAN_PROPERTIES}" ] | ||
} | ||
|
||
@test "check if infinispan has auth props" { | ||
clear_vars | ||
export INFINISPAN_USERNAME="developer" | ||
export INFINISPAN_USEAUTH="true" | ||
export INFINISPAN_PASSWORD="developer" | ||
export INFINISPAN_AUTHREALM="default" | ||
export INFINISPAN_SASLMECHANISM="PLAIN" | ||
|
||
local expected=" -Dquarkus.infinispan-client.auth-username=developer -Dquarkus.infinispan-client.auth-password=developer -Dquarkus.infinispan-client.use-auth=true -Dquarkus.infinispan-client.auth-realm=default -Dquarkus.infinispan-client.sasl-mechanism=PLAIN" | ||
configure_infinispan_props | ||
|
||
echo "Result is ${INFINISPAN_PROPERTIES} and expected is ${expected}" >&2 | ||
[ "${expected}" = "${INFINISPAN_PROPERTIES}" ] | ||
} | ||
|
||
@test "setting username, useauth is true" { | ||
clear_vars | ||
export INFINISPAN_USERNAME="developer" | ||
export INFINISPAN_USEAUTH="false" | ||
local expected=" -Dquarkus.infinispan-client.auth-username=developer -Dquarkus.infinispan-client.use-auth=true" | ||
|
||
configure_infinispan_props | ||
|
||
echo "Result is ${INFINISPAN_PROPERTIES} and expected is ${expected}" >&2 | ||
[ "${expected}" = "${INFINISPAN_PROPERTIES}" ] | ||
} | ||
|
||
@test "when use auth is set to nonsense and no credentials" { | ||
clear_vars | ||
export INFINISPAN_USEAUTH="dsadsadasdsa" | ||
local expected=" -Dquarkus.infinispan-client.use-auth=false" | ||
|
||
configure_infinispan_props | ||
|
||
echo "Result is ${INFINISPAN_PROPERTIES} and expected is ${expected}" >&2 | ||
[ "${expected}" = "${INFINISPAN_PROPERTIES}" ] | ||
} | ||
|
||
@test "when use auth is set to nonsense and has credentials" { | ||
clear_vars | ||
export INFINISPAN_USEAUTH="dsadsadasdsa" | ||
export INFINISPAN_USERNAME="developer" | ||
local expected=" -Dquarkus.infinispan-client.auth-username=developer -Dquarkus.infinispan-client.use-auth=true" | ||
|
||
configure_infinispan_props | ||
|
||
echo "Result is ${INFINISPAN_PROPERTIES} and expected is ${expected}" >&2 | ||
[ "${expected}" = "${INFINISPAN_PROPERTIES}" ] | ||
} | ||
|
||
@test "when use auth is set to true and no credentials" { | ||
clear_vars | ||
export INFINISPAN_USEAUTH="true" | ||
|
||
run configure_infinispan_props | ||
|
||
expected="[ERROR] Flag INFINISPAN_USEAUTH set to true, but no username or password informed. Please use INFINISPAN_USERNAME and INFINISPAN_PASSWORD variables to set the right credentials." | ||
echo "Result is ${output} and expected is ${expected}" | ||
echo "Expected status is 1, outcome status is ${status}" | ||
[ "$status" -eq 1 ] | ||
[ "${output}" = "${expected}" ] | ||
} |
94 changes: 0 additions & 94 deletions
94
s2i/modules/kogito-data-index/tests/bats/kogito-dataindex-start.bats
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.