Skip to content

Commit

Permalink
Merge pull request #50 from adobes1/add-centos-imagestreams-tests
Browse files Browse the repository at this point in the history
Add CentOS imagestreams tests
  • Loading branch information
phracek authored Aug 23, 2023
2 parents dfef940 + b755440 commit 66c52bd
Show file tree
Hide file tree
Showing 12 changed files with 329 additions and 12 deletions.
28 changes: 27 additions & 1 deletion tests/test_httpd_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmHttpdImageStreams:
class TestHelmRHELHttpdImageStreams:

def setup_method(self):
package_name = "httpd-imagestreams"
Expand All @@ -33,3 +33,29 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSHttpdImagestreams:
def setup_method(self):
package_name = "httpd-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("2.4-ubi9", "registry.access.redhat.com/ubi9/httpd-24:latest"),
("2.4-ubi8", "registry.access.redhat.com/ubi8/httpd-24:latest"),
("2.4-el8", "docker.io/centos/httpd-24-centos8:latest"),
("2.4-el7", "quay.io/centos7/httpd-24-centos7:latest"),
("2.4", "quay.io/centos7/httpd-24-centos7:latest"),
]
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
self.hc_api.check_imagestreams(version=version, registry=registry)
28 changes: 27 additions & 1 deletion tests/test_mariadb_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmMariadbImageStreams:
class TestHelmRHELMariadbImageStreams:

def setup_method(self):
package_name = "mariadb-imagestreams"
Expand All @@ -34,3 +34,29 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSMariadbImageStreams:

def setup_method(self):
package_name = "mariadb-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("10.5-el7", "quay.io/centos7/mariadb-105-centos7:latest"),
("10.3-el8", "docker.io/centos/mariadb-103-centos8:latest"),
("10.3-el7", "quay.io/centos7/mariadb-103-centos7:latest"),
("10.3", "quay.io/centos7/mariadb-103-centos7:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
27 changes: 26 additions & 1 deletion tests/test_mysql_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmMySQLImageStreams:
class TestHelmRHELMySQLImageStreams:

def setup_method(self):
package_name = "mysql-imagestreams"
Expand All @@ -31,3 +31,28 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSMySQLImageStreams:

def setup_method(self):
package_name = "mysql-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("8.0-el8", "docker.io/centos/mysql-80-centos8:latest"),
("8.0-el7", "quay.io/centos7/mysql-80-centos7:latest"),
("8.0", "quay.io/centos7/mysql-80-centos7:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
27 changes: 26 additions & 1 deletion tests/test_nginx_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmMariadbImageStreams:
class TestHelmRHELNginxImageStreams:

def setup_method(self):
package_name = "nginx-imagestreams"
Expand All @@ -31,3 +31,28 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSNginxImageStreams:

def setup_method(self):
package_name = "nginx-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("1.20-ubi9", "registry.access.redhat.com/ubi9/nginx-120:latest"),
("1.20-ubi8", "registry.access.redhat.com/ubi8/nginx-120:latest"),
("1.20-ubi7", "registry.access.redhat.com/ubi7/nginx-120:latest")
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
31 changes: 30 additions & 1 deletion tests/test_nodejs_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmNodeJSImageStreams:
class TestHelmRHELNodeJSImageStreams:

def setup_method(self):
package_name = "nodejs-imagestreams"
Expand All @@ -33,3 +33,32 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSNodeJSImageStreams:

def setup_method(self):
package_name = "nodejs-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("16-ubi9", "registry.access.redhat.com/ubi9/nodejs-16:latest"),
("16-ubi9-minimal", "registry.access.redhat.com/ubi9/nodejs-16-minimal:latest"),
("16-ubi8", "registry.access.redhat.com/ubi8/nodejs-16:latest"),
("16-ubi8-minimal", "registry.access.redhat.com/ubi8/nodejs-16-minimal:latest"),
("14-ubi8", "registry.access.redhat.com/ubi8/nodejs-14:latest"),
("14-ubi8-minimal", "registry.access.redhat.com/ubi8/nodejs-14-minimal:latest"),
("14-ubi7", "registry.access.redhat.com/ubi7/nodejs-14:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
30 changes: 29 additions & 1 deletion tests/test_perl_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmPerlImageStreams:
class TestHelmRHELPerlImageStreams:

def setup_method(self):
package_name = "perl-imagestreams"
Expand All @@ -34,3 +34,31 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSPerlImageStreams:

def setup_method(self):
package_name = "perl-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("5.32-ubi9", "registry.access.redhat.com/ubi9/perl-532:latest"),
("5.32-ubi8", "registry.access.redhat.com/ubi8/perl-532:latest"),
("5.30-ubi8", "registry.access.redhat.com/ubi8/perl-530:latest"),
("5.30-el7", "quay.io/centos7/perl-530-centos7:latest"),
("5.30", "quay.io/centos7/perl-530-centos7:latest"),
("5.26-ubi8", "registry.access.redhat.com/ubi8/perl-526:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
29 changes: 28 additions & 1 deletion tests/test_php_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmPHPImageStreams:
class TestHelmRHELPHPImageStreams:

def setup_method(self):
package_name = "php-imagestreams"
Expand All @@ -34,3 +34,30 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSPHPImageStreams:

def setup_method(self):
package_name = "php-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("8.0-ubi9", "registry.access.redhat.com/ubi9/php-80:latest"),
("8.0-ubi8", "registry.access.redhat.com/ubi8/php-80:latest"),
("7.4-ubi8", "registry.access.redhat.com/ubi8/php-74:latest"),
("7.3-ubi7", "registry.access.redhat.com/ubi7/php-73:latest"),
("7.3", "quay.io/centos7/php-73-centos7:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
30 changes: 29 additions & 1 deletion tests/test_postgresql_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmPostgresqlImageStreams:
class TestHelmRHELPostgresqlImageStreams:

def setup_method(self):
package_name = "postgresql-imagestreams"
Expand All @@ -34,3 +34,31 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSLPostgresqlImageStreams:

def setup_method(self):
package_name = "postgresql-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("15-el9", "quay.io/sclorg/postgresql-15-c9s:latest"),
("13-el9", "quay.io/sclorg/postgresql-13-c9s:latest"),
("15-el8", "quay.io/sclorg/postgresql-15-c8s:latest"),
("13-el8", "quay.io/sclorg/postgresql-13-c8s:latest"),
("12-el8", "quay.io/sclorg/postgresql-12-c8s:latest"),
("10-el8", "quay.io/sclorg/postgresql-10-c8s:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
30 changes: 29 additions & 1 deletion tests/test_python_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmPythonImageStreams:
class TestHelmRHELPythonImageStreams:

def setup_method(self):
package_name = "python-imagestreams"
Expand Down Expand Up @@ -37,3 +37,31 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSPythonImageStreams:

def setup_method(self):
package_name = "python-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("3.9-ubi9", "registry.access.redhat.com/ubi9/python-39:latest"),
("3.9-ubi8", "registry.access.redhat.com/ubi8/python-39:latest"),
("3.8-ubi8", "registry.access.redhat.com/ubi8/python-38:latest"),
("3.8-ubi7", "registry.access.redhat.com/ubi7/python-38:latest"),
("3.6-ubi8", "registry.access.redhat.com/ubi8/python-36:latest"),
("2.7-ubi8", "registry.access.redhat.com/ubi8/python-27:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
25 changes: 24 additions & 1 deletion tests/test_redis_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))


class TestHelmRedisImageStreams:
class TestHelmRHELRedisImageStreams:

def setup_method(self):
package_name = "redis-imagestreams"
Expand All @@ -31,3 +31,26 @@ def test_package_imagestream(self, version, registry):
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)


class TestHelmCentOSRedisImageStreams:

def setup_method(self):
package_name = "redis-imagestreams"
path = test_dir / "../charts/centos"
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir)

def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
[
("6-el7", "quay.io/centos7/redis-6-centos7:latest"),
],
)
def test_package_imagestream(self, version, registry):
self.hc_api.set_version("0.0.1")
self.hc_api.helm_package()
self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
Loading

0 comments on commit 66c52bd

Please sign in to comment.