Skip to content

Commit 8de7e53

Browse files
authored
Merge pull request #188 from phracek/test_in_ocp4
Support testing s2i-perl-container in OpenShift 4
2 parents 68b0b56 + 8e5a278 commit 8de7e53

7 files changed

+19
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/test-lib-remote-openshift.sh
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/test-lib-remote-openshift.sh
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../common/test-lib-remote-openshift.sh

test/run-openshift-remote-cluster

+12-8
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,38 @@ THISDIR=$(dirname ${BASH_SOURCE[0]})
1111
source "${THISDIR}/test-lib.sh"
1212
source "${THISDIR}/test-lib-openshift.sh"
1313
source "${THISDIR}/test-lib-perl.sh"
14+
source "${THISDIR}/test-lib-remote-openshift.sh"
1415

1516
set -eo nounset
1617

1718
trap ct_os_cleanup EXIT SIGINT
1819

20+
ct_os_set_ocp4
21+
1922
ct_os_check_compulsory_vars
2023

2124
oc status || false "It looks like oc is not properly logged in."
2225

23-
export CT_SKIP_NEW_PROJECT=true
24-
export CT_SKIP_UPLOAD_IMAGE=true
25-
export CT_NAMESPACE=openshift
26+
# For testing on OpenShift 4 we use internal registry
27+
export CT_EXTERNAL_REGISTRY=true
2628

2729
test -n "${IMAGE_NAME-}" || false 'make sure $IMAGE_NAME is defined'
2830
test -n "${VERSION-}" || false 'make sure $VERSION is defined'
2931

3032
# TODO: We should ideally use a local directory instead of ${VERSION}/test/sample-test-app,
3133
# so we can test changes in that example app that are done as part of the PR
32-
ct_os_test_s2i_app ${IMAGE_NAME} "https://github.com/sclorg/s2i-perl-container.git" "${THISDIR}/sample-test-app" "Everything is OK"
33-
34+
echo "Testing sample-test-app from s2i-perl-container git repository"
35+
ct_os_test_s2i_app ${IMAGE_NAME} "https://github.com/sclorg/s2i-perl-container.git" "${VERSION}/test/sample-test-app" "Everything is OK"
36+
echo "Testing Dancer application"
3437
ct_os_test_s2i_app ${IMAGE_NAME} "https://github.com/sclorg/dancer-ex.git" . 'Welcome to your Dancer application on OpenShift'
35-
3638
# TODO: this was not working because the referenced example dir was added as part of this commit
39+
echo "Testing template application"
3740
ct_os_test_template_app "${IMAGE_NAME}" \
38-
"${THISDIR}/sample-test-app.json" \
41+
"https://raw.githubusercontent.com/sclorg/s2i-perl-container/master/examples/templates/sample-test-app.json" \
3942
perl \
4043
"Everything is OK" \
41-
8080 http 200 "-p SOURCE_REPOSITORY_REF=staging -p VERSION=${VERSION} -p NAME=perl-testing"
44+
8080 http 200 \
45+
"-p SOURCE_REPOSITORY_REF=staging -p VERSION=${VERSION} -p NAME=perl-testing"
4246

4347
# Check the imagestream
4448
test_perl_imagestream

test/test-lib-perl.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ function test_perl_imagestream() {
1717
rhel7|centos7) ;;
1818
*) echo "Imagestream testing not supported for $OS environment." ; return 0 ;;
1919
esac
20-
20+
21+
echo "Testing perl imagestream application"
2122
ct_os_test_image_stream_quickstart "${THISDIR}/imagestreams/perl-${OS%[0-9]*}.json" \
2223
"${THISDIR}/sample-test-app.json" \
2324
"${IMAGE_NAME}" \

test/test-lib-remote-openshift.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../common/test-lib-remote-openshift.sh

0 commit comments

Comments
 (0)