Add test to check the http probes has no path
Change-Id: I0e3214326e6006d5b60ba3ffe6f762c92aea2d5c
This commit is contained in:
parent
0e7bc74b79
commit
67427f5b39
@ -63,11 +63,11 @@ spec:
|
||||
containerPort: 9150
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
path: /
|
||||
port: metrics
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
path: /
|
||||
port: metrics
|
||||
resources:
|
||||
limits:
|
||||
|
@ -63,6 +63,21 @@ class KubernetesAppTestCaseMixin:
|
||||
for container in self.object['spec']['template']['spec']['containers']:
|
||||
self.assertIn('resources', container)
|
||||
|
||||
def test_container_http_probes_have_no_metrics_path(self):
|
||||
"""Ensure that http probes (liveness/rediness) of all containers
|
||||
don't have metrics path"""
|
||||
for container in self.object['spec']['template']['spec']['containers']:
|
||||
if 'httpGet' in container['readinessProbe']:
|
||||
self.assertNotEqual(
|
||||
container['readinessProbe']['httpGet']['path'],
|
||||
'/metrics'
|
||||
)
|
||||
if 'httpGet' in container['livenessProbe']:
|
||||
self.assertNotEqual(
|
||||
container['livenessProbe']['httpGet']['path'],
|
||||
'/metrics'
|
||||
)
|
||||
|
||||
|
||||
class DeploymentTestCase(KubernetesObjectTestCase,
|
||||
KubernetesAppTestCaseMixin):
|
||||
|
Loading…
x
Reference in New Issue
Block a user