Skip to content

Commit

Permalink
Use proper RHEL7 image and test both templates
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Dec 4, 2023
1 parent e367dce commit 48897c4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/mariadb-ephemeral-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"spec": {
"strategy": {
"type": "RollingUpdate"
"type": "Recreate"
},
"replicas": 1,
"selector": {
Expand Down
2 changes: 1 addition & 1 deletion examples/mariadb-persistent-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
},
"spec": {
"strategy": {
"type": "RollingUpdate"
"type": "Recreate"
},
"replicas": 1,
"selector": {
Expand Down
2 changes: 1 addition & 1 deletion test/run-openshift-remote-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source "${THISDIR}/test-lib-remote-openshift.sh"
TEST_LIST="\
test_mariadb_integration
test_mariadb_imagestream
test_mariadb_templates
test_mariadb_template
run_latest_imagestreams
"

Expand Down
17 changes: 13 additions & 4 deletions test/test-lib-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,16 @@ function test_mariadb_integration() {
TEMPLATES="mariadb-ephemeral-template.json
mariadb-persistent-template.json"
SHORT_VERSION="${VERSION//.}"
if [ "${OS}" == "rhel7" ]; then
namespace_image="rhscl/mariadb-${SHORT_VERSION}-rhel7"
else
namespace_image="${OS}/mariadb-${SHORT_VERSION}"
fi
for template in $TEMPLATES; do
ct_os_test_template_app_func "${IMAGE_NAME}" \
"${THISDIR}/${template}" \
"${service_name}" \
"ct_os_check_cmd_internal 'registry.redhat.io/${OS}/mariadb-${SHORT_VERSION}:latest' '${service_name}-testing' \"echo 'SELECT 42 as testval\g' | mysql --connect-timeout=15 -h <IP> testdb -utestu -ptestp\" '^42' 120" \
"ct_os_check_cmd_internal 'registry.redhat.io/${namespace_image}' '${service_name}-testing' \"echo 'SELECT 42 as testval\g' | mysql --connect-timeout=15 -h <IP> testdb -utestu -ptestp\" '^42' 120" \
"-p MARIADB_VERSION=${VERSION} \
-p DATABASE_SERVICE_NAME="${service_name}-testing" \
-p MYSQL_USER=testu \
Expand All @@ -138,14 +143,18 @@ function test_mariadb_imagestream() {
elif [ "${OS}" == "rhel9" ]; then
tag="-el9"
fi
ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/examples/mariadb-ephemeral-template.json" mariadb "-p MARIADB_VERSION=${VERSION}${tag}"
TEMPLATES="mariadb-ephemeral-template.json
mariadb-persistent-template.json"
for template in $TEMPLATES; do
ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/examples/${template}" mariadb "-p MARIADB_VERSION=${VERSION}${tag}"
done
}

function test_mariadb_templates() {
function test_mariadb_template() {
TEMPLATES="mariadb-ephemeral-template.json
mariadb-persistent-template.json"
for template in $TEMPLATES; do
ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/${template}" mariadb
ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS%[0-9]*}.json" "${THISDIR}/examples/${template}" mariadb
done
}

Expand Down

0 comments on commit 48897c4

Please sign in to comment.