-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathtest_helm_ruby_imagestreams.py
More file actions
56 lines (43 loc) · 1.77 KB
/
Copy pathtest_helm_ruby_imagestreams.py
File metadata and controls
56 lines (43 loc) · 1.77 KB
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
46
47
48
49
50
51
52
53
54
55
56
import os
import sys
import pytest
from pathlib import Path
from container_ci_suite.helm import HelmChartsAPI
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)
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))
VERSION = os.getenv("VERSION")
IMAGE_NAME = os.getenv("IMAGE_NAME")
OS = os.getenv("TARGET")
@pytest.fixture(scope="module")
def helm_api(request):
helm_api = HelmChartsAPI(
path=test_dir / "../charts/redhat", package_name="redhat-ruby-imagestreams", tarball_dir=test_dir
)
helm_api.clone_helm_chart_repo(
repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts",
subdir="charts/redhat"
)
# app_name = os.path.basename(request.param)
yield helm_api
pass
helm_api.delete_project()
class TestHelmRHELRubyImageStreams:
@pytest.mark.parametrize(
"version,registry,expected",
[
("3.3-ubi9", "registry.redhat.io/ubi9/ruby-33:latest", True),
("3.3-ubi8", "registry.redhat.io/ubi8/ruby-33:latest", True),
("3.1-ubi9", "registry.redhat.io/ubi9/ruby-31:latest", True),
("3.1-ubi8", "registry.redhat.io/ubi8/ruby-31:latest", True),
("3.0-ubi9", "registry.redhat.io/ubi9/ruby-30:latest", True),
("3.0-ubi8", "registry.redhat.io/ubi8/ruby-30:latest", False),
("2.5-ubi8", "registry.redhat.io/ubi8/ruby-25:latest", True),
],
)
def test_package_imagestream(self, helm_api, version, registry, expected):
assert helm_api.helm_package()
assert helm_api.helm_installation()
assert helm_api.check_imagestreams(version=version, registry=registry) == expected