Add test cases for service, secret, ingress, and configmap

Change-Id: Iea98e3f36e49a4538ad1d0d000aebef56c1b4c01
This commit is contained in:
okozachenko 2020-05-26 23:27:38 +03:00
parent d421fc1107
commit 6b47b65fa5
7 changed files with 103 additions and 0 deletions

View File

@ -124,3 +124,19 @@ class StatefulSetTestCase(KubernetesObjectTestCase,
class DaemonSetTestCase(KubernetesObjectTestCase): class DaemonSetTestCase(KubernetesObjectTestCase):
"""Basic tests for Kubernetes DaemonSets.""" """Basic tests for Kubernetes DaemonSets."""
class ConfigMapTestCase(KubernetesObjectTestCase):
"""Basic tests for Kubernetes ConfigMaps."""
class IngressTestCase(KubernetesObjectTestCase):
"""Basic tests for Kubernetes Ingresses."""
class SecretTestCase(KubernetesObjectTestCase):
"""Basic tests for Kubernetes Secrets."""
class ServiceTestCase(KubernetesObjectTestCase):
"""Basic tests for Kubernetes Services."""

View File

@ -25,3 +25,10 @@ class ChronydAPIDeploymentTestCase(base.DaemonSetTestCase):
RELEASE_TYPE = 'chronyd' RELEASE_TYPE = 'chronyd'
TEMPLATE_FILE = 'chronyd/daemonset.yml.j2' TEMPLATE_FILE = 'chronyd/daemonset.yml.j2'
class ChronydAPIConfigMapTestCase(base.ConfigMapTestCase):
"""Basic tests for the ConfigMap."""
RELEASE_TYPE = 'chronyd'
TEMPLATE_FILE = 'chronyd/configmap.yml.j2'

View File

@ -25,3 +25,10 @@ class HeatAPIDeploymentTestCase(base.DeploymentTestCase):
RELEASE_TYPE = 'heat' RELEASE_TYPE = 'heat'
TEMPLATE_FILE = 'heat/deployment.yml.j2' TEMPLATE_FILE = 'heat/deployment.yml.j2'
class HeatAPServiceTestCase(base.ServiceTestCase):
"""Basic tests for the Service."""
RELEASE_TYPE = 'heat'
TEMPLATE_FILE = 'heat/service.yml.j2'

View File

@ -20,8 +20,36 @@ This module contains all the tests for the Horizon operator.
from openstack_operator.tests.unit import base from openstack_operator.tests.unit import base
class HorizonConfigMapTestCase(base.ConfigMapTestCase):
"""Basic tests for the ConfigMap."""
RELEASE_TYPE = 'horizon'
TEMPLATE_FILE = 'horizon/configmap.yml.j2'
class HorizonDeploymentTestCase(base.DeploymentTestCase): class HorizonDeploymentTestCase(base.DeploymentTestCase):
"""Basic tests for the Deployment.""" """Basic tests for the Deployment."""
RELEASE_TYPE = 'horizon' RELEASE_TYPE = 'horizon'
TEMPLATE_FILE = 'horizon/deployment.yml.j2' TEMPLATE_FILE = 'horizon/deployment.yml.j2'
class HorizonIngressTestCase(base.IngressTestCase):
"""Basic tests for the Ingress."""
RELEASE_TYPE = 'horizon'
TEMPLATE_FILE = 'horizon/ingress.yml.j2'
class HorizonSecretTestCase(base.SecretTestCase):
"""Basic tests for the Secret."""
RELEASE_TYPE = 'horizon'
TEMPLATE_FILE = 'horizon/secret-secretkey.yml.j2'
class HorizonServiceTestCase(base.ServiceTestCase):
"""Basic tests for the Service."""
RELEASE_TYPE = 'horizon'
TEMPLATE_FILE = 'horizon/service.yml.j2'

View File

@ -25,3 +25,24 @@ class KeystoneDeploymentTestCase(base.DeploymentTestCase):
RELEASE_TYPE = 'keystone' RELEASE_TYPE = 'keystone'
TEMPLATE_FILE = 'keystone/deployment.yml.j2' TEMPLATE_FILE = 'keystone/deployment.yml.j2'
class KeystoneIngressTestCase(base.IngressTestCase):
"""Basic tests for the Ingress."""
RELEASE_TYPE = 'keystone'
TEMPLATE_FILE = 'keystone/ingress.yml.j2'
class KeystoneSecretTestCase(base.SecretTestCase):
"""Basic tests for the Secret."""
RELEASE_TYPE = 'keystone'
TEMPLATE_FILE = 'keystone/secret-fernet.yml.j2'
class KeystoneServiceTestCase(base.ServiceTestCase):
"""Basic tests for the Service."""
RELEASE_TYPE = 'keystone'
TEMPLATE_FILE = 'keystone/service.yml.j2'

View File

@ -20,9 +20,25 @@ This module contains all the tests for the Mcrouter operator.
from openstack_operator.tests.unit import base from openstack_operator.tests.unit import base
class McrouterConfigMapTestCase(base.ConfigMapTestCase):
"""Basic tests for the ConfigMap."""
SAMPLE_FILE = 'infrastructure_v1alpha1_mcrouter.yaml'
TEMPLATE_FILE = 'mcrouter/configmap.yml.j2'
AUTO_GENERATED = False
class McrouterDeploymentTestCase(base.StatefulSetTestCase): class McrouterDeploymentTestCase(base.StatefulSetTestCase):
"""Basic tests for the Deployment.""" """Basic tests for the Deployment."""
SAMPLE_FILE = 'infrastructure_v1alpha1_mcrouter.yaml' SAMPLE_FILE = 'infrastructure_v1alpha1_mcrouter.yaml'
TEMPLATE_FILE = 'mcrouter/deployment.yml.j2' TEMPLATE_FILE = 'mcrouter/deployment.yml.j2'
AUTO_GENERATED = False AUTO_GENERATED = False
class McrouterServiceTestCase(base.ServiceTestCase):
"""Basic tests for the Service."""
SAMPLE_FILE = 'infrastructure_v1alpha1_mcrouter.yaml'
TEMPLATE_FILE = 'mcrouter/service.yml.j2'
AUTO_GENERATED = False

View File

@ -38,6 +38,14 @@ class MemcachedOperatorTestCase(base.BaseTestCase):
'memcached/deployment.yml.j2', name="foo", spec={}) 'memcached/deployment.yml.j2', name="foo", spec={})
class MemcachedServiceTestCase(base.ServiceTestCase):
"""Basic tests for the Service."""
SAMPLE_FILE = 'infrastructure_v1alpha1_memcached.yaml'
TEMPLATE_FILE = 'memcached/service.yml.j2'
AUTO_GENERATED = False
class MemcachedStatefulSetTestCase(base.StatefulSetTestCase): class MemcachedStatefulSetTestCase(base.StatefulSetTestCase):
"""Basic tests for the StatefulSet.""" """Basic tests for the StatefulSet."""