diff --git a/tests/test_dancer.py b/tests/test_dancer.py index 931c540..6e2c75a 100644 --- a/tests/test_dancer.py +++ b/tests/test_dancer.py @@ -23,6 +23,23 @@ def setup_method(self): def teardown_method(self): self.oc_api.delete_project() + + def test_local_template_inside_cluster(self): + expected_output = "Welcome to your Dancer application" + template_json = "../openshift/templates/dancer.json" + assert self.oc_api.deploy_template( + template=template_json, name_in_template="dancer-example", expected_output=expected_output, + openshift_args=[ + "SOURCE_REPOSITORY_REF=master", + f"PERL_VERSION={VERSION}", + "NAME=dancer-example" + ] + ) + assert self.oc_api.template_deployed(name_in_template="dancer-example") + assert self.oc_api.check_response_inside_cluster( + name_in_template="dancer-example", expected_output=expected_output + ) + def test_template_inside_cluster(self): expected_output = "Welcome to your Dancer application" template_json = self.oc_api.get_raw_url_for_json( diff --git a/tests/test_dancer_mysql.py b/tests/test_dancer_mysql.py index 867283e..ff4254b 100644 --- a/tests/test_dancer_mysql.py +++ b/tests/test_dancer_mysql.py @@ -11,7 +11,7 @@ if not VERSION: VERSION="5.32-ubi8" -class TestDancerAppExTemplate: +class TestDancerAppMySQLExTemplate: def setup_method(self): self.oc_api = OpenShiftAPI(pod_name_prefix="dancer-example") @@ -27,6 +27,23 @@ def setup_method(self): def teardown_method(self): self.oc_api.delete_project() + def test_local_template_inside_cluster(self): + expected_output = "Welcome to your Dancer application" + template_json = "../openshift/templates/dancer-mysql-persistent.json" + assert self.oc_api.deploy_template( + template=template_json, name_in_template="dancer-example", expected_output=expected_output, + openshift_args=[ + "SOURCE_REPOSITORY_REF=master", + f"PERL_VERSION={VERSION}", + "NAME=dancer-example", + "MYSQL_VERSION=8.0-el8" + ] + ) + assert self.oc_api.template_deployed(name_in_template="dancer-example") + assert self.oc_api.check_response_inside_cluster( + name_in_template="dancer-example", expected_output=expected_output + ) + def test_template_inside_cluster(self): expected_output = "Welcome to your Dancer application" template_json = self.oc_api.get_raw_url_for_json(