-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support testig helm charts in Perl container
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
- Loading branch information
Showing
24 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_mysql_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_perl_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_mysql_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_perl_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_mysql_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_perl_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_mysql_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_perl_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_mysql_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_perl_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_mysql_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_perl_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_dancer_mysql_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_helm_perl_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
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__))) | ||
|
||
|
||
class TestHelmPerlDancerAppTemplate: | ||
|
||
def setup_method(self): | ||
package_name = "perl-dancer-application" | ||
path = test_dir | ||
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, remote=True) | ||
self.hc_api.clone_helm_chart_repo( | ||
repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", | ||
subdir="charts/redhat" | ||
) | ||
|
||
def teardown_method(self): | ||
self.hc_api.delete_project() | ||
|
||
def test_dancer_application_curl_output(self): | ||
if self.hc_api.oc_api.shared_cluster: | ||
pytest.skip("Do NOT test on shared cluster") | ||
self.hc_api.package_name = "perl-imagestreams" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation() | ||
self.hc_api.package_name = "perl-dancer-application" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation( | ||
values={ | ||
"perl_version": "5.32-ubi8", | ||
"namespace": self.hc_api.namespace | ||
} | ||
) | ||
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="dancer-example") | ||
assert self.hc_api.test_helm_curl_output( | ||
route_name="dancer-example", | ||
expected_str="Welcome to your Dancer application" | ||
) | ||
|
||
def test_dancer_application_helm_test(self): | ||
self.hc_api.package_name = "perl-imagestreams" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation() | ||
self.hc_api.package_name = "perl-dancer-application" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation( | ||
values={ | ||
"perl_version": "5.32-ubi8", | ||
"namespace": self.hc_api.namespace | ||
} | ||
) | ||
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="dancer-example") | ||
assert self.hc_api.test_helm_chart(expected_str=["Welcome to your Dancer application"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
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__))) | ||
|
||
|
||
class TestHelmPerlDancerMysqlAppTemplate: | ||
|
||
def setup_method(self): | ||
package_name = "perl-dancer-application" | ||
path = test_dir | ||
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, remote=True) | ||
self.hc_api.clone_helm_chart_repo( | ||
repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", | ||
subdir="charts/redhat" | ||
) | ||
|
||
def teardown_method(self): | ||
self.hc_api.delete_project() | ||
|
||
def test_dancer_application(self): | ||
if self.hc_api.oc_api.shared_cluster: | ||
pytest.skip("Do NOT test on shared cluster") | ||
self.hc_api.package_name = "perl-imagestreams" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation() | ||
self.hc_api.package_name = "perl-dancer-application" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation( | ||
values={ | ||
"perl_version": "5.32-ubi8", | ||
"namespace": self.hc_api.namespace | ||
} | ||
) | ||
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="dancer-example") | ||
assert self.hc_api.test_helm_curl_output( | ||
route_name="dancer-example", | ||
expected_str="Welcome to your Dancer application" | ||
) | ||
|
||
|
||
def test_dancer_application_helm_test(self): | ||
self.hc_api.package_name = "perl-imagestreams" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation() | ||
self.hc_api.package_name = "perl-dancer-application" | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation( | ||
values={ | ||
"perl_version": "5.32-ubi8", | ||
"namespace": self.hc_api.namespace | ||
} | ||
) | ||
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="dancer-example") | ||
assert self.hc_api.test_helm_chart(expected_str=["Welcome to your Dancer application"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
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__))) | ||
|
||
|
||
class TestHelmRHELPerlImageStreams: | ||
|
||
def setup_method(self): | ||
package_name = "perl-imagestreams" | ||
path = test_dir | ||
self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, remote=True) | ||
self.hc_api.clone_helm_chart_repo( | ||
repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", | ||
subdir="charts/redhat" | ||
) | ||
|
||
def teardown_method(self): | ||
self.hc_api.delete_project() | ||
|
||
@pytest.mark.parametrize( | ||
"version,registry", | ||
[ | ||
("5.32-ubi9", "registry.redhat.io/ubi9/perl-532:latest"), | ||
("5.32-ubi8", "registry.redhat.io/ubi8/perl-532:latest"), | ||
("5.26-ubi8", "registry.redhat.io/ubi8/perl-526:latest"), | ||
], | ||
) | ||
def test_package_imagestream(self, version, registry): | ||
assert self.hc_api.helm_package() | ||
assert 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.26-ubi8", "registry.access.redhat.com/ubi8/perl-526:latest"), | ||
], | ||
) | ||
def test_package_imagestream(self, version, registry): | ||
assert self.hc_api.helm_package() | ||
assert self.hc_api.helm_installation() | ||
assert self.hc_api.check_imagestreams(version=version, registry=registry) |