Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 39996b5

Browse files
committed
Simplify tests
1 parent 3de8994 commit 39996b5

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

common

test/run-openshift-local-cluster

+5-11
Original file line numberDiff line numberDiff line change
@@ -104,25 +104,19 @@ test_mongodb_replication "${IMAGE_NAME}"
104104

105105
# test with the just built image and an integrated template
106106
echo "Running test_mongodb_integration with ${IMAGE_NAME}"
107-
test_mongodb_integration "${IMAGE_NAME}" "${VERSION}" mongodb
107+
test_mongodb_integration "${IMAGE_NAME}"
108108

109109
# test with a released image and an integrated template
110-
# ignore possible failure of this test for centos images
111-
fail_not_released=true
112-
if [ "${OS}" == "rhel7" ] ; then
113-
PUBLIC_IMAGE_NAME=${PUBLIC_IMAGE_NAME:-${REGISTRY:-registry.redhat.io/}rhscl/${BASE_IMAGE_NAME}-${VERSION//./}-rhel7}
114-
else
115-
PUBLIC_IMAGE_NAME=${PUBLIC_IMAGE_NAME:-${REGISTRY:-}centos/${BASE_IMAGE_NAME}-${VERSION//./}-centos7}
116-
fail_not_released=false
117-
fi
110+
PUBLIC_IMAGE_NAME=${PUBLIC_IMAGE_NAME:-$(ct_get_public_image_name "${OS}" "${BASE_IMAGE_NAME}" "${VERSION}")}
118111

119112
# Try pulling the image first to see if it is accessible
120113
if docker pull "${PUBLIC_IMAGE_NAME}"; then
121114
echo "Running test_mongodb_integration with ${PUBLIC_IMAGE_NAME}"
122-
test_mongodb_integration "${PUBLIC_IMAGE_NAME}" "${VERSION}" mongodb
115+
test_mongodb_integration "${PUBLIC_IMAGE_NAME}"
123116
else
124117
echo "Warning: ${PUBLIC_IMAGE_NAME} could not be downloaded via 'docker'"
125-
! $fail_not_released || false "ERROR: Failed to pull image"
118+
# ignore possible failure of this test for centos images
119+
[ "${OS}" == "rhel7" ] && false "ERROR: Failed to pull image"
126120
fi
127121

128122
# Check the imagestream

test/run-openshift-remote-cluster

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export CT_SKIP_UPLOAD_IMAGE=true
2525
export CT_NAMESPACE=openshift
2626

2727
# Check the template
28-
test_mongodb_integration "${IMAGE_NAME}" ${VERSION} mongodb
28+
test_mongodb_integration "${IMAGE_NAME}"
2929

3030
# Check the imagestream
3131
test_mongodb_imagestream

test/test-lib-mongodb.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ source ${THISDIR}/test-lib-openshift.sh
1313

1414
function test_mongodb_integration() {
1515
local image_name=$1
16-
local VERSION=$2
17-
local service_name=$3
18-
local image_tagged="${service_name}:${VERSION}"
16+
local service_name=mongodb
1917
ct_os_template_exists mongodb-ephemeral && t=mongodb-ephemeral || t=mongodb-persistent
2018
ct_os_test_template_app_func "${image_name}" \
2119
"${t}" \

0 commit comments

Comments
 (0)