@@ -18,48 +18,24 @@ def setup_method(self):
1818 self .oc_api = OpenShiftAPI (pod_name_prefix = "cakephp-example" )
1919 json_raw_file = self .oc_api .get_raw_url_for_json (container = "s2i-php-container" , dir = "imagestreams" ,
2020 filename = "php-rhel.json" )
21- self .oc_api .import_is (path = json_raw_file , name = "php" )
21+ self .oc_api .import_is (path = json_raw_file , name = "php" , skip_check = True )
2222 json_raw_file = self .oc_api .get_raw_url_for_json (
2323 container = "mysql-container" , dir = "imagestreams" , filename = "mysql-rhel.json"
2424 )
25- self .oc_api .import_is (path = json_raw_file , name = "mysql" )
25+ self .oc_api .import_is (path = json_raw_file , name = "mysql" , skip_check = True )
2626
2727 def teardown_method (self ):
2828 self .oc_api .delete_project ()
2929
30- def test_local_template_inside_cluster (self ):
31- branch_to_test = "master"
32- expected_output = "Welcome to PHP"
33- if VERSION .startswith ("7.4" ) or VERSION .startswith ("8.0" ):
34- branch_to_test = "4.X"
35- expected_output = "Welcome to CakePHP 4"
36- if VERSION .startswith ("8.1" ) or VERSION .startswith ("8.2" ):
37- branch_to_test = "5.X"
38- expected_output = "Welcome to CakePHP 5"
39- template_json = "../openshift/templates/cakephp-mysql-persistent.json"
40- assert self .oc_api .deploy_template (
41- template = template_json , name_in_template = "cakephp-example" , expected_output = expected_output ,
42- openshift_args = [
43- f"SOURCE_REPOSITORY_REF={ branch_to_test } " ,
44- f"PHP_VERSION={ VERSION } " ,
45- "NAME=cakephp-example" ,
46- "MYSQL_VERSION=8.0-el8"
47- ]
48- )
49- assert self .oc_api .template_deployed (name_in_template = "cakephp-example" )
50- assert self .oc_api .check_response_inside_cluster (
51- name_in_template = "cakephp-example" , expected_output = expected_output
52- )
53-
5430 def test_remote_template_inside_cluster (self ):
5531 branch_to_test = "master"
5632 expected_output = "Welcome to PHP"
5733 if VERSION .startswith ("7.4" ) or VERSION .startswith ("8.0" ):
5834 branch_to_test = "4.X"
59- expected_output = "Welcome to CakePHP 4 "
60- if VERSION .startswith ("8.1" ) or VERSION .startswith ("8.2" ):
35+ expected_output = "Welcome to CakePHP"
36+ if VERSION .startswith ("8.1" ) or VERSION .startswith ("8.2" ) or VERSION . startswith ( "8.3" ) :
6137 branch_to_test = "5.X"
62- expected_output = "Welcome to CakePHP 5 "
38+ expected_output = "Welcome to CakePHP"
6339
6440 template_json = self .oc_api .get_raw_url_for_json (
6541 container = "cakephp-ex" , branch = branch_to_test , dir = "openshift/templates" , filename = "cakephp-mysql-persistent.json"
@@ -70,38 +46,13 @@ def test_remote_template_inside_cluster(self):
7046 f"SOURCE_REPOSITORY_REF={ branch_to_test } " ,
7147 f"PHP_VERSION={ VERSION } " ,
7248 "NAME=cakephp-example" ,
73- "MYSQL_VERSION=8.0-el8"
49+ "MYSQL_VERSION=8.0-el8" ,
50+ "DATABASE_USER=testu" ,
51+ "DATABASE_PASSWORD=testp" ,
52+ "DATABASE_NAME=mysql"
7453 ]
7554 )
76- assert self .oc_api .template_deployed (name_in_template = "cakephp-example" )
55+ assert self .oc_api .is_template_deployed (name_in_template = "cakephp-example" )
7756 assert self .oc_api .check_response_inside_cluster (
7857 name_in_template = "cakephp-example" , expected_output = expected_output
7958 )
80-
81- def test_remote_template_by_request (self ):
82- branch_to_test = "master"
83- expected_output = "Welcome to PHP"
84- if VERSION .startswith ("7.4" ) or VERSION .startswith ("8.0" ):
85- branch_to_test = "4.X"
86- expected_output = "Welcome to CakePHP 4"
87- elif VERSION .startswith ("8.1" ) or VERSION .startswith ("8.2" ):
88- branch_to_test = "5.X"
89- expected_output = "Welcome to CakePHP 5"
90-
91- template_json = self .oc_api .get_raw_url_for_json (
92- container = "cakephp-ex" , branch = branch_to_test , dir = "openshift/templates" , filename = "cakephp-mysql-persistent.json"
93- )
94- assert self .oc_api .deploy_template (
95- template = template_json , name_in_template = "cakephp-example" , expected_output = expected_output ,
96- openshift_args = [
97- f"SOURCE_REPOSITORY_REF={ branch_to_test } " ,
98- f"PHP_VERSION={ VERSION } " ,
99- "NAME=cakephp-example" ,
100- "MYSQL_VERSION=8.0-el8"
101- ]
102- )
103- assert self .oc_api .template_deployed (name_in_template = "cakephp-example" )
104- assert self .oc_api .check_response_outside_cluster (
105- protocol = "https" ,
106- name_in_template = "cakephp-example" , expected_output = expected_output
107- )
0 commit comments