Skip to content

Commit 217de17

Browse files
Merge pull request openshift#22575 from brancz/e2e-add-prom-cadvisor
test/extended/prometheus: Add test for host cAdvisor metrics
2 parents 34ee3a8 + ddd3b59 commit 217de17

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/extended/prometheus/prometheus.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ var _ = g.Describe("[Feature:Prometheus][Conformance] Prometheus", func() {
169169

170170
e2e.Logf("Watchdog alert is firing: %s", bearerToken)
171171
})
172+
g.It("should have non-Pod host cAdvisor metrics", func() {
173+
oc.SetupProject()
174+
ns := oc.Namespace()
175+
execPodName := e2e.CreateExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", func(pod *v1.Pod) { pod.Spec.Containers[0].Image = "centos:7" })
176+
defer func() { oc.AdminKubeClient().CoreV1().Pods(ns).Delete(execPodName, metav1.NewDeleteOptions(1)) }()
177+
178+
tests := map[string][]metricTest{
179+
// should have constantly firing a watchdog alert
180+
`container_cpu_usage_seconds_total{id!~"/kubepods.slice/.*"}`: {metricTest{greaterThanEqual: true, value: 1}},
181+
}
182+
runQueries(tests, oc, ns, execPodName, url, bearerToken)
183+
})
172184
})
173185
})
174186

0 commit comments

Comments
 (0)