Skip to content

Commit

Permalink
Merge pull request #287 from sclorg/add_support_latest_imagestreams
Browse files Browse the repository at this point in the history
Test latest_imagestreams to OpenShift 4 as well.
  • Loading branch information
phracek authored Nov 9, 2023
2 parents 9cd49a4 + 1fe013e commit 3b7c332
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
8 changes: 4 additions & 4 deletions examples/templates/sample-test-app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"kind": "Template",
"apiVersion": "v1",
"apiVersion": "template.openshift.io/v1",
"metadata": {
"name": "sample-test-app",
"annotations": {
Expand Down Expand Up @@ -43,7 +43,7 @@
},
{
"kind": "Route",
"apiVersion": "v1",
"apiVersion": "route.openshift.io/v1",
"metadata": {
"name": "${NAME}",
"annotations": {
Expand All @@ -60,7 +60,7 @@
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"apiVersion": "image.openshift.io/v1",
"metadata": {
"name": "${NAME}",
"annotations": {
Expand All @@ -70,7 +70,7 @@
},
{
"kind": "BuildConfig",
"apiVersion": "v1",
"apiVersion": "build.openshift.io/v1",
"metadata": {
"name": "${NAME}",
"annotations": {
Expand Down
8 changes: 0 additions & 8 deletions test/run-openshift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ set -eo nounset

trap ct_os_cleanup EXIT SIGINT

test_latest_imagestreams() {
info "Testing the latest version in imagestreams"
# Switch to root directory of a container
pushd "${test_dir}/../.." >/dev/null
ct_check_latest_imagestreams
popd >/dev/null
}

ct_os_check_compulsory_vars

ct_os_enable_print_logs
Expand Down
1 change: 1 addition & 0 deletions test/run-openshift-remote-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ test_perl_s2i_sample_app
test_perl_s2i_dancer_app
test_perl_s2i_templates
test_perl_imagestream
test_latest_imagestreams
"

trap ct_os_cleanup EXIT SIGINT
Expand Down
25 changes: 12 additions & 13 deletions test/test-lib-perl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@ source "${THISDIR}/test-lib-openshift.sh"

# Check the imagestream
function test_perl_imagestream() {
case ${OS} in
rhel7|centos7|rhel8|rhel9) ;;
*) echo "Imagestream testing not supported for $OS environment." ; return 0 ;;
esac

local tag="-el7"
if [ "${OS}" == "rhel8" ]; then
tag="-ubi8"
elif [ "${OS}" == "rhel9" ]; then
tag="-ubi9"
fi
# perl version in ./imagestreams/perl-rhel.json is either 5.26 or 5.30
# There is not version like `{5.26,5.30}-mod_fcgid`
if [ "${VERSION}" == "5.26-mod_fcgid" ]; then
Expand All @@ -38,7 +28,7 @@ function test_perl_imagestream() {
"${IMAGE_NAME}" \
perl \
"Everything is OK" \
8080 http 200 "-p SOURCE_REPOSITORY_REF=staging -p VERSION=${VERSION}${tag} -p NAME=perl-testing"
8080 http 200 "-p SOURCE_REPOSITORY_REF=master -p VERSION=${VERSION} -p NAME=perl-testing"
}

function test_perl_s2i_sample_app() {
Expand All @@ -54,11 +44,20 @@ function test_perl_s2i_dancer_app() {
function test_perl_s2i_templates() {
# TODO: this was not working because the referenced example dir was added as part of this commit
ct_os_test_template_app "${IMAGE_NAME}" \
"https://raw.githubusercontent.com/sclorg/s2i-perl-container/master/examples/templates/sample-test-app.json" \
"${THISDIR}/examples/templates/sample-test-app.json" \
perl \
"Everything is OK" \
8080 http 200 \
"-p SOURCE_REPOSITORY_REF=staging -p VERSION=${VERSION} -p NAME=perl-testing"
"-p SOURCE_REPOSITORY_REF=master -p VERSION=${VERSION} -p NAME=perl-testing"
}

function test_latest_imagestreams() {
info "Testing the latest version in imagestreams"
# Switch to root directory of a container
pushd "${THISDIR}/../.." >/dev/null
ct_check_latest_imagestreams
popd >/dev/null
}

# vim: set tabstop=2:shiftwidth=2:expandtab:

0 comments on commit 3b7c332

Please sign in to comment.