Skip to content

Commit

Permalink
Add support for testing httpd-ex repository also within OCP4 cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <[email protected]>
  • Loading branch information
phracek committed Mar 14, 2024
1 parent ea2dfac commit 7e97545
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/test_httpd_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
if not VERSION:
VERSION="2.4-el8"

@pytest.mark.parametrize('VERSION', ["2.4-el7", "2.4-el8", "2.4-ubi8", "2.4-ubi9"])
class TestHTTPDExTemplate:

def setup_method(self):
Expand All @@ -24,7 +23,20 @@ def setup_method(self):
def teardown_method(self):
self.oc_api.delete_project()

def test_httpd_ex_template_by_request(self, VERSION):
def test_httpd_ex_template_inside_cluster(self):
template_json = self.oc_api.get_raw_url_for_json(
container="httpd-ex", dir="openshift/templates", filename="httpd.json"
)
assert self.oc_api.deploy_template(
template=template_json, name_in_template="httpd-example", expected_output="Welcome to your static httpd",
openshift_args=["SOURCE_REPOSITORY_REF=master", f"HTTPD_VERSION={VERSION}", "NAME=httpd-example"]
)
assert self.oc_api.template_deployed(name_in_template="httpd-example")
assert self.oc_api.check_response_inside_cluster(
name_in_template="httpd-example", expected_output="Welcome to your static httpd"
)

def test_httpd_ex_template_by_request(self):
template_json = self.oc_api.get_raw_url_for_json(
container="httpd-ex", dir="openshift/templates", filename="httpd.json"
)
Expand All @@ -34,5 +46,5 @@ def test_httpd_ex_template_by_request(self, VERSION):
)
assert self.oc_api.template_deployed(name_in_template="httpd-example")
assert self.oc_api.check_response_outside_cluster(
name_in_template="httpd-example", port=8080, expected_output="Welcome to your static httpd"
name_in_template="httpd-example", expected_output="Welcome to your static httpd"
)

0 comments on commit 7e97545

Please sign in to comment.