30
30
MYSQL_TAG = MYSQL_TAGS .get (OS , None )
31
31
IMAGE_TAG = f"mysql:8.0{ MYSQL_TAG } "
32
32
MYSQL_VERSION = f"8.0{ MYSQL_TAG } "
33
-
33
+ TEMPLATE_VERSION = VERSION . replace ( "." , "" )
34
34
35
35
class TestDeployDancerExTemplateWithoutMySQL :
36
36
37
37
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 )
40
39
41
40
def teardown_method (self ):
42
41
self .oc_api .delete_project ()
43
42
44
43
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"
46
48
template_url = self .oc_api .get_raw_url_for_json (
47
49
container = "dancer-ex" , dir = "openshift/templates" , filename = "dancer.json" , branch = "master"
48
50
)
@@ -56,7 +58,7 @@ def test_perl_template_inside_cluster(self):
56
58
"SOURCE_REPOSITORY_REF=master"
57
59
]
58
60
)
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 )
60
62
assert self .oc_api .check_response_inside_cluster (
61
63
name_in_template = service_name , expected_output = "Welcome to your Dancer application on OpenShift"
62
64
)
@@ -65,15 +67,18 @@ def test_perl_template_inside_cluster(self):
65
67
class TestDeployDancerExTemplateWithMySQL :
66
68
67
69
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 )
69
72
self .oc_api .import_is ("imagestreams/perl-rhel.json" , "" , skip_check = True )
70
73
assert self .oc_api .upload_image (DEPLOYED_MYSQL_IMAGE , f"{ IMAGE_TAG } " )
71
74
72
75
def teardown_method (self ):
73
76
self .oc_api .delete_project ()
74
77
75
78
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"
77
82
template_url = self .oc_api .get_raw_url_for_json (
78
83
container = "dancer-ex" , dir = "openshift/templates" , filename = "dancer-mysql-persistent.json" , branch = "master"
79
84
)
@@ -89,7 +94,7 @@ def test_perl_template_inside_cluster(self):
89
94
90
95
]
91
96
)
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 )
93
98
assert self .oc_api .check_response_inside_cluster (
94
99
name_in_template = service_name , expected_output = "Welcome to your Dancer application on OpenShift"
95
100
)
0 commit comments