container-ci-suite
This repo is used for testing SCL containers. For container execution docker or podman commands are used.
No Python bidings. The same for OpenShift tests. oc command is used.
How to use Container CI Suite for testing containers
Install this suite from PyPi:
pip3 install container-ci-suite
Install this suite from GitHub repository:
pip3 install git+https://github.com/sclorg/container-ci-suite
Run a test with Container-CI-Suite
import os
import pytest
from container_ci_suite.container import ContainerAPI
image_name = os.environ.get("IMAGE_NAME", "nginx-container")
test_dir = os.path.abspath(os.path.dirname(__file__))
class TestDummyImage(object):
def test_s2i_usage(self):
ccs = ContainerAPI(image_name=image_name)
ccs.s2i_usage()
Run a test with Container-CI-Suite for Example repositories
import os
import pytest
from container_ci_suite.openshift import OpenShiftAPI
test_dir = os.path.abspath(os.path.dirname(__file__))
IS_RUBY = OpenShiftAPI.get_raw_url_for_json(container="s2i-ruby-container", dir="imagestreams", filename="ruby-rhel.json")
IS_POSTGRESQL = OpenShiftAPI.get_raw_url_for_json(container="postgresql-container", dir="imagestreams", filename="postgresql-rhel.json")
TEMPLATE_RAILS_POSTGRESQL = OpenShiftAPI.get_raw_url_for_json(container="s2i-ruby-container", dir="examples", filename="rails-postgresql-persistent.json")
class TestRubyEx:
def setup_method(self):
self.oc_api = OpenShiftAPI(namespace="test-ruby-ex")
# Reference https://github.com/sclorg/s2i-nodejs-container/blob/master/test/test-lib-nodejs.sh#L561 (ct_os_test_template_app_func)
def test_deployment_template(self):
self.oc_api.create(IS_RUBY)
self.oc_api.create(IS_POSTGRESQL)
assert self.oc_api.check_is_exists(is_name="ruby", version_to_check="2.5-ubi8")
assert self.oc_api.check_is_exists(is_name="postgresql", version_to_check="10-el8")
self.oc_api.process_file(TEMPLATE_RAILS_POSTGRESQL)
self.oc_api.new_app(image_name="ruby:2.5-ubi8", github_repo="https://github.com/sclorg/ruby-ex")
self.oc_api.is_pod_ready(pod_name="")
self.oc_api.ct_os_check_service_image_info()
#oc process -f rails-postgresql.json -p NAMESPACE=$(oc project -q) | oc create -f -
# Reference https://github.com/sclorg/s2i-nodejs-container/blob/master/test/test-lib-nodejs.sh#L554 (ct_os_test_s2i_app_func)
# ct_os_deploy_s2i_image
def test_s2i_app_func(self):
self.oc_api.create(IS_RUBY)
self.oc_api.create(IS_POSTGRESQL)
assert self.oc_api.check_is_exists(is_name="ruby", version_to_check="2.5-ubi8")
assert self.oc_api.check_is_exists(is_name="postgresql", version_to_check="10-el8")
self.oc_api.process_file(TEMPLATE_RAILS_POSTGRESQL)
self.oc_api.new_app("ruby-ex-tests/ruby:2.5-ubi8~https://github.com/sclorg/ruby-ex")
self.oc_api.start-build() # service-name, --from-dir
self.oc_api.is_pod_ready()
self.oc_api.ct_os_check_service_image_info()
#oc process -f rails-postgresql.json -p NAMESPACE=$(oc project -q) | oc create -f -
# Reference https://github.com/sclorg/s2i-nodejs-container/blob/master/test/test-lib-nodejs.sh#L533 (ct_os_test_image_stream_quickstart)
# ct_os_deploy_s2i_image
def test_iamgestream_quicstart(self):
self.oc_api.create(IS_RUBY)
self.oc_api.create(IS_POSTGRESQL)
assert self.oc_api.check_is_exists(is_name="ruby", version_to_check="2.5-ubi8")
assert self.oc_api.check_is_exists(is_name="postgresql", version_to_check="10-el8")
self.oc_api.process_file(TEMPLATE_RAILS_POSTGRESQL)
self.oc_api.create()
self.oc_api.ct_os_test_template_app("ruby-ex-tests/ruby:2.5-ubi8~https://github.com/sclorg/ruby-ex")
self.oc_api.start-build() # service-name, --from-dir
self.oc_api.is_pod_ready()
self.oc_api.ct_os_check_service_image_info()
#oc process -f rails-postgresql.json -p NAMESPACE=$(oc project -q) | oc create -f -
Run a test with Container-CI-Suite for Helm charts
import os
import pytest
from container_ci_suite.helm import HelmChartsAPI
test_dir = os.path.abspath(os.path.dirname(__file__))
class TestHelmPostgresqlImageStreams:
def setup_method(self):
package_name = "postgresql-imagestreams"
path = os.path.join(test_dir, "../charts/redhat", package_name)
self.hc_api = HelmChartsAPI(path=path, package_name=package_name)
def test_package_imagestream(self):
self.hc_api.helm_package()
Metadata
Release files for container-ci-suite 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| container_ci_suite-0.13.0.tar.gz | 91.1 kB | Without provenance | Details for container_ci_suite-0.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| container_ci_suite-0.13.0-py3-none-any.whl | Python 3 | none | any | Details for container_ci_suite-0.13.0-py3-none-any.whl |
Total release size: 167.9 kB
Release files / container_ci_suite-0.13.0.tar.gz
| Download URL | container_ci_suite-0.13.0.tar.gz |
|---|---|
| Size | 91.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd557223143f1d3d5f283303caef330efdd00f2e3ba08a1b510c08a0c9acb976
|
|
BLAKE2b-256 checksum How to use checksums |
b3b6635021d7369746931c4407faec44d46dfc3354a103424976857a9cf344ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / container_ci_suite-0.13.0-py3-none-any.whl
| Download URL | container_ci_suite-0.13.0-py3-none-any.whl |
|---|---|
| Size | 76.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
332f1626530fac9fd5f204b171c854a84eb2c2ffeda6f5891df763da5cf0709f
|
|
BLAKE2b-256 checksum How to use checksums |
350c93f9ff0eb6642f1f16ba19608e03eeed5fb99c46b3e3a6bd7d6dd45755a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for container-ci-suite 0.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.