From 555fabc0bf2b8c14fdea1fe6f0160e4509a26f08 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sat, 25 Apr 2020 09:10:36 -0400 Subject: [PATCH] Enforce tests on ImagePullPolicy being always Change-Id: I1b1c7dd5ca14588d1175a25e35c958ad0b2bfc64 --- openstack_operator/tests/unit/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openstack_operator/tests/unit/base.py b/openstack_operator/tests/unit/base.py index 4fd55021..b93a0892 100644 --- a/openstack_operator/tests/unit/base.py +++ b/openstack_operator/tests/unit/base.py @@ -48,6 +48,11 @@ class KubernetesObjectTestCase(testtools.TestCase): class KubernetesAppTestCaseMixin: """Mix-in to be used for tests that involve apps and containers.""" + def test_containers_use_always_image_pull_policy(self): + """Ensure that all containers use 'Always' as imagePullPolicy.""" + for container in self.object['spec']['template']['spec']['containers']: + self.assertEqual("Always", container.get('imagePullPolicy')) + def test_containers_have_liveness_probe(self): """Ensure that all containers have liveness probes.""" for container in self.object['spec']['template']['spec']['containers']: