Skip to content

Commit 5799ce1

Browse files
committed
Add support for testing RHEL10 imagestreams.
Refactoring PyTest so we do not duplicate definitions Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent e0bd882 commit 5799ce1

12 files changed

+71
-23
lines changed

imagestreams/imagestreams.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
- name: RHEL 9
2828
app_versions: [13, 15, 16]
2929

30+
- name: RHEL 10
31+
app_versions: [16]
32+
3033
- filename: postgresql-rhel-aarch64.json
3134
latest: "16-el9"
3235
distros:
@@ -35,3 +38,6 @@
3538

3639
- name: RHEL 9
3740
app_versions: [13, 15, 16]
41+
42+
- name: RHEL 10
43+
app_versions: [16]

imagestreams/postgresql-rhel-aarch64.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,24 @@
135135
"type": "Local"
136136
}
137137
},
138+
{
139+
"name": "16-el10",
140+
"annotations": {
141+
"openshift.io/display-name": "PostgreSQL 16 (RHEL 10)",
142+
"openshift.io/provider-display-name": "Red Hat, Inc.",
143+
"description": "Provides a PostgreSQL 16 database on RHEL 10. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/README.md.",
144+
"iconClass": "icon-postgresql",
145+
"tags": "database,postgresql",
146+
"version": "16"
147+
},
148+
"from": {
149+
"kind": "DockerImage",
150+
"name": "registry.redhat.io/rhel10/postgresql-16:latest"
151+
},
152+
"referencePolicy": {
153+
"type": "Local"
154+
}
155+
},
138156
{
139157
"name": "latest",
140158
"annotations": {

imagestreams/postgresql-rhel.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,24 @@
135135
"type": "Local"
136136
}
137137
},
138+
{
139+
"name": "16-el10",
140+
"annotations": {
141+
"openshift.io/display-name": "PostgreSQL 16 (RHEL 10)",
142+
"openshift.io/provider-display-name": "Red Hat, Inc.",
143+
"description": "Provides a PostgreSQL 16 database on RHEL 10. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/postgresql-container/blob/master/README.md.",
144+
"iconClass": "icon-postgresql",
145+
"tags": "database,postgresql",
146+
"version": "16"
147+
},
148+
"from": {
149+
"kind": "DockerImage",
150+
"name": "registry.redhat.io/rhel10/postgresql-16:latest"
151+
},
152+
"referencePolicy": {
153+
"type": "Local"
154+
}
155+
},
138156
{
139157
"name": "latest",
140158
"annotations": {

test/__init__.py

Whitespace-only changes.

test/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
TAGS = {
2+
"rhel8": "-el8",
3+
"rhel9": "-el9",
4+
"rhel10": "-el10",
5+
}

test/pg-test-lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ get_image_id ()
2929
ns=rhel9
3030
local image=registry.redhat.io/$ns/postgresql-${version}
3131
;;
32+
rhel10)
33+
ns=rhel10
34+
local image=registry.redhat.io/$ns/postgresql-${version}
35+
;;
3236
c9s)
3337
ns=c9s
3438
local image=quay.io/sclorg/postgresql-${version}-$ns

test/test-lib-postgresql.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ function test_postgresql_imagestream() {
4444
tag="-el8"
4545
if [ "${OS}" == "rhel9" ]; then
4646
tag="-el9"
47+
elif [ "${OS}" == "rhel10" ]; then
48+
tag="-el10"
4749
fi
4850
# Check if the current version is already GA
4951
# This directory is cloned from TMT plan repo 'sclorg-tmt-plans'

test/test_postgresql_imagestream.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from container_ci_suite.openshift import OpenShiftAPI
77
from container_ci_suite.utils import check_variables
88

9+
from constants import TAGS
10+
911
if not check_variables():
1012
print("At least one variable from IMAGE_NAME, OS, VERSION is missing.")
1113
sys.exit(1)
@@ -14,17 +16,14 @@
1416
VERSION = os.getenv("VERSION")
1517
IMAGE_NAME = os.getenv("IMAGE_NAME")
1618
OS = os.getenv("TARGET")
17-
TAGS = {
18-
"rhel8": "-el8",
19-
"rhel9": "-el9"
20-
}
21-
TAG = TAGS.get(OS, None)
19+
20+
TAG = TAGS.get(OS)
2221

2322

2423
class TestPostgreSQLImagestreamTemplate:
2524

2625
def setup_method(self):
27-
self.oc_api = OpenShiftAPI(pod_name_prefix="postgresql", version=VERSION)
26+
self.oc_api = OpenShiftAPI(pod_name_prefix="postgresql", version=VERSION, shared_cluster=True)
2827

2928
def teardown_method(self):
3029
self.oc_api.delete_project()

test/test_postgresql_imagestream_template.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from container_ci_suite.openshift import OpenShiftAPI
77
from container_ci_suite.utils import check_variables
88

9+
from constants import TAGS
10+
911
if not check_variables():
1012
print("At least one variable from IMAGE_NAME, OS, VERSION is missing.")
1113
sys.exit(1)
@@ -14,17 +16,14 @@
1416
VERSION = os.getenv("VERSION")
1517
IMAGE_NAME = os.getenv("IMAGE_NAME")
1618
OS = os.getenv("TARGET")
17-
TAGS = {
18-
"rhel8": "-el8",
19-
"rhel9": "-el9"
20-
}
21-
TAG = TAGS.get(OS, None)
19+
20+
TAG = TAGS.get(OS)
2221

2322

2423
class TestPostgreSQLImagestreamTemplate:
2524

2625
def setup_method(self):
27-
self.oc_api = OpenShiftAPI(pod_name_prefix="postgresql", version=VERSION)
26+
self.oc_api = OpenShiftAPI(pod_name_prefix="postgresql", version=VERSION, shared_cluster=True)
2827

2928
def teardown_method(self):
3029
self.oc_api.delete_project()

test/test_postgresql_template.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from container_ci_suite.openshift import OpenShiftAPI
77
from container_ci_suite.utils import check_variables
88

9+
from constants import TAGS
10+
911
if not check_variables():
1012
print("At least one variable from IMAGE_NAME, OS, VERSION is missing.")
1113
sys.exit(1)
@@ -15,17 +17,13 @@
1517
IMAGE_NAME = os.getenv("IMAGE_NAME")
1618
OS = os.getenv("TARGET")
1719

18-
TAGS = {
19-
"rhel8": "-el8",
20-
"rhel9": "-el9"
21-
}
22-
TAG = TAGS.get(OS, None)
20+
TAG = TAGS.get(OS)
2321

2422

2523
class TestPostgreSQLDeployTemplate:
2624

2725
def setup_method(self):
28-
self.oc_api = OpenShiftAPI(pod_name_prefix="postgresql-testing", version=VERSION)
26+
self.oc_api = OpenShiftAPI(pod_name_prefix="postgresql-testing", version=VERSION, shared_cluster=True)
2927

3028
def teardown_method(self):
3129
self.oc_api.delete_project()

0 commit comments

Comments
 (0)