-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_valkey_imagestream_template.py
45 lines (35 loc) · 1.21 KB
/
test_valkey_imagestream_template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os
import sys
import pytest
from container_ci_suite.openshift import OpenShiftAPI
from container_ci_suite.utils import check_variables
if not check_variables():
print("At least one variable from IMAGE_NAME, OS, VERSION is missing.")
sys.exit(1)
VERSION = os.getenv("VERSION")
IMAGE_NAME = os.getenv("IMAGE_NAME")
OS = os.getenv("TARGET")
TAGS = {
"rhel9": "-el9"
}
TAG = TAGS.get(OS, None)
class TestValkeyImagestreamTemplate:
def setup_method(self):
self.oc_api = OpenShiftAPI(pod_name_prefix="valkey", version=VERSION)
def teardown_method(self):
self.oc_api.delete_project()
@pytest.mark.parametrize(
"template",
[
"valkey-ephemeral-template.json",
"valkey-persistent-template.json"
]
)
def test_valkey_imagestream_template(self, template):
os_name = ''.join(i for i in OS if not i.isdigit())
assert self.oc_api.deploy_image_stream_template(
imagestream_file=f"imagestreams/valkey-{os_name}.json",
template_file=f"examples/{template}",
app_name=self.oc_api.pod_name_prefix
)
assert self.oc_api.is_pod_running(pod_name_prefix=self.oc_api.pod_name_prefix)