Skip to content

Commit

Permalink
Add e2e tests for network name metrics.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
  • Loading branch information
fedepaol committed May 15, 2020
1 parent 3954344 commit 5926461
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/extended/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,19 @@ var _ = g.Describe("[sig-instrumentation] Prometheus", func() {
return true, nil
})).NotTo(o.HaveOccurred(), "ingress router cannot report metrics to monitoring system")

g.By("verifying standard metrics keys")
})
g.It("should provide named network metrics", func() {
oc.SetupProject()
ns := oc.Namespace()

execPod := exutil.CreateCentosExecPodOrFail(oc.AdminKubeClient(), ns, "execpod", nil)
defer func() {
oc.AdminKubeClient().CoreV1().Pods(ns).Delete(context.Background(), execPod.Name, *metav1.NewDeleteOptions(1))
}()

g.By("verifying named metrics keys")
queries := map[string]bool{
`template_router_reload_seconds_count{job="router-internal-default"} >= 1`: true,
`haproxy_server_up{job="router-internal-default"} >= 1`: true,
fmt.Sprintf(`pod_network_name_info{pod="%s",namespace="%s",interface="eth0"} == 0`, execPod.Name, execPod.Namespace): true,
}
helper.RunQueries(queries, oc, ns, execPod.Name, url, bearerToken)
})
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5926461

Please sign in to comment.