From dbb701fa2e70e3b261e1b259a84b278ecdf2fbc9 Mon Sep 17 00:00:00 2001 From: Jayapriya Pai Date: Fri, 19 Dec 2025 11:31:35 +0530 Subject: [PATCH] MON-4432: Add e2e test for network DaemonSet EndpointSlice discovery Add a test to verify that network DaemonSet ServiceMonitor targets are correctly discovered. This validates the changes from openshift/cluster-network-operator#2839 which migrates DaemonSet ServiceMonitors to use EndpointSlice instead of the Endpoints API. Signed-off-by: Jayapriya Pai Assisted-By: Cursor AI --- test/extended/prometheus/prometheus.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/extended/prometheus/prometheus.go b/test/extended/prometheus/prometheus.go index 792e9cb14cf7..6ff1613a79a3 100644 --- a/test/extended/prometheus/prometheus.go +++ b/test/extended/prometheus/prometheus.go @@ -883,6 +883,17 @@ var _ = g.Describe("[sig-instrumentation] Prometheus [apigroup:image.openshift.i o.Expect(err).NotTo(o.HaveOccurred()) }) + // This test validates that network DaemonSet ServiceMonitors work correctly + // with EndpointSlice service discovery (CNO PR #2839 / MON-4432) + g.It("should have working network DaemonSet ServiceMonitor target", func() { + g.By("verifying network DaemonSet metrics are being scraped") + queries := map[string]bool{ + `count(up{job="network-metrics-daemon"} == 1) >= 1`: true, + } + err := helper.RunQueries(context.TODO(), oc.NewPrometheusClient(context.TODO()), queries, oc) + o.Expect(err).NotTo(o.HaveOccurred()) + }) + g.It("should provide named network metrics [apigroup:project.openshift.io]", func() { ns := oc.SetupProject()