Skip to content

Commit 5ff3ea5

Browse files
committed
Do not test imagestreams yet for RHEL10. They are not prepared yet.
Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent 86d1c15 commit 5ff3ea5

9 files changed

+47
-18
lines changed

test/run-openshift-remote-cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ct_os_check_login || exit $OC_ERR
3232

3333
ct_os_tag_image_for_cvp "perl"
3434

35-
set -u
35+
set -ux
3636

3737
# For testing on OpenShift 4 we use internal registry
3838
export CT_OCP4_TEST=true

test/test-lib-perl.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ function test_perl_imagestream() {
1919
if [ "${VERSION}" == "5.26-mod_fcgid" ]; then
2020
VERSION="5.26"
2121
fi
22+
if [ "${OS}" == "rhel10" ]; then
23+
echo "Skip testing imagestreams on RHEL10 till they are not available."
24+
return
25+
fi
2226
echo "Testing perl imagestream application"
2327
ct_os_test_image_stream_quickstart "${THISDIR}/imagestreams/perl-${OS%[0-9]*}.json" \
2428
"${THISDIR}/sample-test-app.json" \

test/test_dancer_ex_standalone.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,30 @@
1515
IMAGE_NAME = os.getenv("IMAGE_NAME")
1616
OS = os.getenv("TARGET")
1717

18+
if VERSION == "5.30-mod_fcgid":
19+
VERSION = "5.30"
20+
21+
if VERSION == "5.26-mod_fcgid":
22+
VERSION = "5.26"
1823

1924
# Replacement with 'test_python_s2i_app_ex'
2025
class TestPerlDancerExTemplate:
2126

2227
def setup_method(self):
23-
self.oc_api = OpenShiftAPI(pod_name_prefix="perl-testing", version=VERSION, shared_cluster=True)
28+
self.oc_api = OpenShiftAPI(pod_name_prefix="perl-testing", version=VERSION)
2429

2530
def teardown_method(self):
2631
self.oc_api.delete_project()
2732

2833
def test_dancer_ex_template_inside_cluster(self):
29-
service_name = "perl-testing"
34+
new_version = VERSION.replace(".", "")
35+
service_name = f"perl-{new_version}-testing"
3036
assert self.oc_api.deploy_s2i_app(
3137
image_name=IMAGE_NAME, app="https://github.com/sclorg/dancer-ex.git",
3238
context=".",
3339
service_name=service_name
3440
)
35-
assert self.oc_api.template_deployed(name_in_template=service_name, timeout=480)
41+
assert self.oc_api.is_s2i_pod_running(pod_name_prefix=service_name, cycle_count=480)
3642
assert self.oc_api.check_response_inside_cluster(
3743
name_in_template=service_name, expected_output="Welcome to your Dancer application on OpenShift"
3844
)

test/test_dancer_ex_templates.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,21 @@
3030
MYSQL_TAG = MYSQL_TAGS.get(OS, None)
3131
IMAGE_TAG = f"mysql:8.0{MYSQL_TAG}"
3232
MYSQL_VERSION = f"8.0{MYSQL_TAG}"
33-
33+
TEMPLATE_VERSION = VERSION.replace(".", "")
3434

3535
class TestDeployDancerExTemplateWithoutMySQL:
3636

3737
def setup_method(self):
38-
self.oc_api = OpenShiftAPI(pod_name_prefix="perl-testing", version=VERSION)
39-
self.oc_api.import_is("imagestreams/perl-rhel.json", "", skip_check=True)
38+
self.oc_api = OpenShiftAPI(pod_name_prefix=f"perl-{TEMPLATE_VERSION}-testing", version=VERSION)
4039

4140
def teardown_method(self):
4241
self.oc_api.delete_project()
4342

4443
def test_perl_template_inside_cluster(self):
45-
service_name = "perl-testing"
44+
if OS == "rhel10":
45+
pytest.skip("Do NOT test on RHEL10 yet.")
46+
self.oc_api.import_is("imagestreams/perl-rhel.json", "", skip_check=True)
47+
service_name = f"perl-{TEMPLATE_VERSION}-testing"
4648
template_url = self.oc_api.get_raw_url_for_json(
4749
container="dancer-ex", dir="openshift/templates", filename="dancer.json", branch="master"
4850
)
@@ -56,7 +58,7 @@ def test_perl_template_inside_cluster(self):
5658
"SOURCE_REPOSITORY_REF=master"
5759
]
5860
)
59-
assert self.oc_api.template_deployed(name_in_template=service_name, timeout=480)
61+
assert self.oc_api.is_template_deployed(name_in_template=service_name, timeout=480)
6062
assert self.oc_api.check_response_inside_cluster(
6163
name_in_template=service_name, expected_output="Welcome to your Dancer application on OpenShift"
6264
)
@@ -65,15 +67,18 @@ def test_perl_template_inside_cluster(self):
6567
class TestDeployDancerExTemplateWithMySQL:
6668

6769
def setup_method(self):
68-
self.oc_api = OpenShiftAPI(pod_name_prefix="perl-testing", version=VERSION)
70+
71+
self.oc_api = OpenShiftAPI(pod_name_prefix=f"perl-{TEMPLATE_VERSION}-testing", version=VERSION)
6972
self.oc_api.import_is("imagestreams/perl-rhel.json", "", skip_check=True)
7073
assert self.oc_api.upload_image(DEPLOYED_MYSQL_IMAGE, f"{IMAGE_TAG}")
7174

7275
def teardown_method(self):
7376
self.oc_api.delete_project()
7477

7578
def test_perl_template_inside_cluster(self):
76-
service_name = "perl-testing"
79+
if OS == "rhel10":
80+
pytest.skip("Do NOT test on RHEL10 yet.")
81+
service_name = f"perl-{TEMPLATE_VERSION}-testing"
7782
template_url = self.oc_api.get_raw_url_for_json(
7883
container="dancer-ex", dir="openshift/templates", filename="dancer-mysql-persistent.json", branch="master"
7984
)
@@ -89,7 +94,7 @@ def test_perl_template_inside_cluster(self):
8994

9095
]
9196
)
92-
assert self.oc_api.template_deployed(name_in_template=service_name, timeout=480)
97+
assert self.oc_api.is_template_deployed(name_in_template=service_name, timeout=480)
9398
assert self.oc_api.check_response_inside_cluster(
9499
name_in_template=service_name, expected_output="Welcome to your Dancer application on OpenShift"
95100
)

test/test_deploy_templates.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
import sys
33

4+
import pytest
5+
46
from container_ci_suite.openshift import OpenShiftAPI
57
from container_ci_suite.utils import check_variables
68

@@ -30,6 +32,8 @@ def teardown_method(self):
3032
self.oc_api.delete_project()
3133

3234
def test_perl_template_inside_cluster(self):
35+
if OS == "rhel10":
36+
pytest.skip("Do NOT test on RHEL10 yet.")
3337
service_name = "perl-testing"
3438
assert self.oc_api.deploy_template_with_image(
3539
image_name=IMAGE_NAME,
@@ -41,7 +45,7 @@ def test_perl_template_inside_cluster(self):
4145
f"NAME={service_name}"
4246
]
4347
)
44-
assert self.oc_api.template_deployed(name_in_template=service_name, timeout=480)
48+
assert self.oc_api.is_template_deployed(name_in_template=service_name, timeout=480)
4549
assert self.oc_api.check_response_inside_cluster(
4650
name_in_template=service_name, expected_output="Everything is OK"
4751
)

test/test_helm_dancer_app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TestHelmPerlDancerAppTemplate:
3737
def setup_method(self):
3838
package_name = "redhat-perl-dancer-application"
3939
path = test_dir
40-
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, shared_cluster=True)
40+
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)
4141
self.hc_api.clone_helm_chart_repo(
4242
repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts",
4343
subdir="charts/redhat"
@@ -49,6 +49,8 @@ def teardown_method(self):
4949
def test_dancer_application_curl_output(self):
5050
if self.hc_api.oc_api.shared_cluster:
5151
pytest.skip("Do NOT test on shared cluster")
52+
if OS == "rhel10":
53+
pytest.skip("Do NOT test on RHEL10 yet.")
5254
self.hc_api.package_name = "redhat-perl-imagestreams"
5355
assert self.hc_api.helm_package()
5456
assert self.hc_api.helm_installation()
@@ -67,6 +69,8 @@ def test_dancer_application_curl_output(self):
6769
)
6870

6971
def test_dancer_application_helm_test(self):
72+
if OS == "rhel10":
73+
pytest.skip("Do NOT test on RHEL10 yet.")
7074
self.hc_api.package_name = "redhat-perl-imagestreams"
7175
assert self.hc_api.helm_package()
7276
assert self.hc_api.helm_installation()

test/test_helm_dancer_mysql_template.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TestHelmPerlDancerMysqlAppTemplate:
3636
def setup_method(self):
3737
package_name = "redhat-perl-dancer-application"
3838
path = test_dir
39-
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, shared_cluster=True)
39+
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)
4040
self.hc_api.clone_helm_chart_repo(
4141
repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts",
4242
subdir="charts/redhat"
@@ -48,6 +48,8 @@ def teardown_method(self):
4848
def test_dancer_application(self):
4949
if self.hc_api.oc_api.shared_cluster:
5050
pytest.skip("Do NOT test on shared cluster")
51+
if OS == "rhel10":
52+
pytest.skip("Do NOT test on RHEL10 yet.")
5153
self.hc_api.package_name = "redhat-perl-imagestreams"
5254
assert self.hc_api.helm_package()
5355
assert self.hc_api.helm_installation()
@@ -67,6 +69,8 @@ def test_dancer_application(self):
6769

6870

6971
def test_dancer_application_helm_test(self):
72+
if OS == "rhel10":
73+
pytest.skip("Do NOT test on RHEL10 yet.")
7074
self.hc_api.package_name = "redhat-perl-imagestreams"
7175
assert self.hc_api.helm_package()
7276
assert self.hc_api.helm_installation()

test/test_helm_perl_imagestreams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TestHelmRHELPerlImageStreams:
2020
def setup_method(self):
2121
package_name = "redhat-perl-imagestreams"
2222
path = test_dir
23-
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)
23+
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, shared_cluster=True)
2424
self.hc_api.clone_helm_chart_repo(
2525
repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts",
2626
subdir="charts/redhat"

test/test_imagestreams_quickstart.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
class TestImagestreamsQuickstart:
3636

3737
def setup_method(self):
38-
self.oc_api = OpenShiftAPI(pod_name_prefix="perl-testing", version=VERSION, shared_cluster=True)
38+
self.oc_api = OpenShiftAPI(pod_name_prefix="perl-testing", version=VERSION)
3939

4040
def teardown_method(self):
4141
self.oc_api.delete_project()
4242

4343
def test_perl_template_inside_cluster(self):
44+
if OS == "rhel10":
45+
pytest.skip("Do NOT test on RHEL10 yet.")
4446
service_name = "perl-testing"
4547
assert self.oc_api.imagestream_quickstart(
4648
imagestream_file="imagestreams/perl-rhel.json",
@@ -53,7 +55,7 @@ def test_perl_template_inside_cluster(self):
5355
f"NAME={service_name}"
5456
]
5557
)
56-
assert self.oc_api.template_deployed(name_in_template=service_name, timeout=480)
58+
assert self.oc_api.is_template_deployed(name_in_template=service_name, timeout=480)
5759
assert self.oc_api.check_response_inside_cluster(
5860
name_in_template=service_name, expected_output="Everything is OK"
5961
)

0 commit comments

Comments
 (0)