From 3c66af5fc836b82bc21f580b51032c3ccef9b595 Mon Sep 17 00:00:00 2001 From: evgenLevin <76552389+evgenLevin@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:12:15 -0400 Subject: [PATCH] cnf-network: fixed Metallb metric tests (#174) --- tests/cnf/core/network/metallb/internal/frr/frr.go | 2 +- .../core/network/metallb/internal/tsparams/mlbvars.go | 9 +++++---- tests/cnf/core/network/metallb/tests/bfd-test.go | 2 +- tests/cnf/core/network/metallb/tests/bgp-tests.go | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/cnf/core/network/metallb/internal/frr/frr.go b/tests/cnf/core/network/metallb/internal/frr/frr.go index 7e8bca749..563e5f2e8 100644 --- a/tests/cnf/core/network/metallb/internal/frr/frr.go +++ b/tests/cnf/core/network/metallb/internal/frr/frr.go @@ -127,7 +127,7 @@ func IsProtocolConfigured(frrPod *pod.Builder, protocol string) (bool, error) { // GetMetricsByPrefix pulls all metrics from frr pods and sort them in the list by given prefix. func GetMetricsByPrefix(frrPod *pod.Builder, metricPrefix string) ([]string, error) { - stdout, err := frrPod.ExecCommand([]string{"curl", "localhost:29151/metrics"}, "frr") + stdout, err := frrPod.ExecCommand([]string{"curl", "localhost:7573/metrics"}, "frr") if err != nil { return nil, err diff --git a/tests/cnf/core/network/metallb/internal/tsparams/mlbvars.go b/tests/cnf/core/network/metallb/internal/tsparams/mlbvars.go index b5588412e..1c48375c6 100644 --- a/tests/cnf/core/network/metallb/internal/tsparams/mlbvars.go +++ b/tests/cnf/core/network/metallb/internal/tsparams/mlbvars.go @@ -67,10 +67,11 @@ var ( // TestLabel represents node label for testing. TestLabel = map[string]string{"test": "label"} // MetalLbBgpMetrics represents the list of expected metallb metrics. - MetalLbBgpMetrics = []string{"metallb_bgp_keepalives_sent", "metallb_bgp_keepalives_received", - "metallb_bgp_notifications_sent", "metallb_bgp_opens_received", "metallb_bgp_opens_sent", - "metallb_bgp_route_refresh_sent", "metallb_bgp_session_up", "metallb_bgp_total_received", "metallb_bgp_total_sent", - "metallb_bgp_updates_total", "metallb_bgp_updates_total_received", "metallb_bgp_announced_prefixes_total", + MetalLbBgpMetrics = []string{"frrk8s_bgp_keepalives_sent", "frrk8s_bgp_keepalives_received", + "frrk8s_bgp_notifications_sent", "frrk8s_bgp_opens_received", "frrk8s_bgp_opens_sent", + "frrk8s_bgp_route_refresh_sent", "frrk8s_bgp_session_up", "frrk8s_bgp_total_received", "frrk8s_bgp_total_sent", + "frrk8s_bgp_updates_total", "frrk8s_bgp_updates_total_received", "frrk8s_bgp_announced_prefixes_total", + "frrk8s_bgp_received_prefixes_total", } ) diff --git a/tests/cnf/core/network/metallb/tests/bfd-test.go b/tests/cnf/core/network/metallb/tests/bfd-test.go index 775f666df..e68b09a63 100644 --- a/tests/cnf/core/network/metallb/tests/bfd-test.go +++ b/tests/cnf/core/network/metallb/tests/bfd-test.go @@ -121,7 +121,7 @@ var _ = Describe("BFD", Ordered, Label(tsparams.LabelBFDTestCases), ContinueOnFa }) Expect(err).ToNot(HaveOccurred(), "Failed to list prometheus pods") - verifyMetricPresentInPrometheus(frrk8sPods, prometheusPods[0], "metallb_bfd_") + verifyMetricPresentInPrometheus(frrk8sPods, prometheusPods[0], "frrk8s_bfd_") }) AfterEach(func() { diff --git a/tests/cnf/core/network/metallb/tests/bgp-tests.go b/tests/cnf/core/network/metallb/tests/bgp-tests.go index 2d432a083..b687a1ab8 100644 --- a/tests/cnf/core/network/metallb/tests/bgp-tests.go +++ b/tests/cnf/core/network/metallb/tests/bgp-tests.go @@ -190,7 +190,7 @@ var _ = Describe("BGP", Ordered, Label(tsparams.LabelBGPTestCases), ContinueOnFa Expect(err).ToNot(HaveOccurred(), "Failed to list prometheus pods") verifyMetricPresentInPrometheus( - frrk8sPods, prometheusPods[0], "metallb_bgp_", tsparams.MetalLbBgpMetrics) + frrk8sPods, prometheusPods[0], "frrk8s_bgp_", tsparams.MetalLbBgpMetrics) }) AfterAll(func() {