From 767beec1bda16b62652b5acd63e1dff5ef637422 Mon Sep 17 00:00:00 2001 From: Andrea Panattoni Date: Thu, 5 Dec 2024 09:53:25 +0100 Subject: [PATCH] e2e: Improve `findUnusedSriovDevices` errors Signed-off-by: Andrea Panattoni --- test/conformance/tests/test_sriov_operator.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/conformance/tests/test_sriov_operator.go b/test/conformance/tests/test_sriov_operator.go index cdd0edadc..184b682bf 100644 --- a/test/conformance/tests/test_sriov_operator.go +++ b/test/conformance/tests/test_sriov_operator.go @@ -1846,9 +1846,17 @@ func findUnusedSriovDevices(testNode string, sriovDevices []*sriovv1.InterfaceEx if isDefaultRouteInterface(device.Name, routes) { continue } - stdout, _, err = pod.ExecCommand(clients, createdPod, "ip", "link", "show", device.Name) - Expect(err).ToNot(HaveOccurred()) - Expect(len(stdout)).Should(Not(Equal(0)), "Unable to query link state") + stdout, stderr, err := pod.ExecCommand(clients, createdPod, "ip", "link", "show", device.Name) + if err != nil { + fmt.Printf("Can't query link state for device [%s]: %s", device.Name, err.Error()) + continue + } + + if len(stdout) == 0 { + fmt.Printf("Can't query link state for device [%s]: stderr:[%s]", device.Name, string(stderr)) + continue + } + if strings.Contains(stdout, "master ovs-system") { continue // The interface is not active }