Add chronyd unit test

Change-Id: I9765e34f9b5e021bbbc76992ccdc02e74ae8c213
This commit is contained in:
okozachenko 2020-05-26 23:09:33 +03:00
parent 738584ddb8
commit e4dc96553d
3 changed files with 33 additions and 2 deletions

View File

@ -120,3 +120,7 @@ class DeploymentTestCase(KubernetesObjectTestCase,
class StatefulSetTestCase(KubernetesObjectTestCase,
KubernetesAppTestCaseMixin):
"""Basic tests for Kubernetes StatefulSets."""
class DaemonSetTestCase(KubernetesObjectTestCase):
"""Basic tests for Kubernetes DaemonSets."""

View File

@ -0,0 +1,27 @@
# Copyright 2020 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Chronyd Operator
This module contains all the tests for the Chronyd operator.
"""
from openstack_operator.tests.unit import base
class ChronydAPIDeploymentTestCase(base.DaemonSetTestCase):
"""Basic tests for the DaemonSet."""
RELEASE_TYPE = 'chronyd'
TEMPLATE_FILE = 'chronyd/daemonset.yml.j2'

View File

@ -25,7 +25,7 @@
command: kubectl get pods -l app.kubernetes.io/name=memcached,app.kubernetes.io/instance=devstack -o=jsonpath='{range .items[*]}{.status.podIP}{"\n"}{end}'
register: _memcached_ips
until: _memcached_ips is success
retries: 20
retries: 60
delay: 5
failed_when: |
{{ _memcached_ips.stdout_lines | length == 0 }} or
@ -38,7 +38,7 @@
register: _metrics
loop: "{{ _memcached_ips.stdout_lines }}"
until: _metrics is success
retries: 60
retries: 10
delay: 5
failed_when: "'memcached_up 1' not in _metrics.content"