Skip to content

Commit

Permalink
draft
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed Aug 16, 2024
1 parent 9c0f0ff commit 806674f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions test/conformance/tests/test_sriov_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1709,14 +1709,17 @@ func findMainSriovDevice(executorPod *corev1.Pod, sriovDevices []*sriovv1.Interf
stdout, _, err = pod.ExecCommand(clients, executorPod, "ip", "link", "show", device.Name)
Expect(err).ToNot(HaveOccurred())
Expect(len(stdout)).Should(Not(Equal(0)), "Unable to query link state")

if strings.Contains(stdout, "state DOWN") {
fmt.Printf("Debug: DOWN %+v\n", device.Name)
continue // The interface is not active
}
if strings.Contains(stdout, "master ovs-system") {
fmt.Println("Chosen ", device.Name, " as it is used by ovs")
return device
}
}

return nil
}

Expand Down
12 changes: 8 additions & 4 deletions test/conformance/tests/test_switchdev.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tests

import (
"context"
"fmt"
"time"

Check failure on line 7 in test/conformance/tests/test_switchdev.go

View workflow job for this annotation

GitHub Actions / Golangci-lint

File is not `goimports`-ed with -local github.com/k8snetworkplumbingwg/sriov-network-operator (goimports)
sriovv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1"
Expand Down Expand Up @@ -40,12 +41,15 @@ var _ = Describe("[sriov] Switchdev", Ordered, func() {
testNode, interfaces, err := sriovInfos.FindSriovDevicesAndNode()
Expect(err).ToNot(HaveOccurred())

By("Testing on node " + testNode)
By(fmt.Sprintf("Testing on node %s, %d devices found", testNode, len(interfaces)))

mainDevice := findMainSriovDevice(getConfigDaemonPod(testNode), interfaces)
Expect(mainDevice).ToNot(BeNil())

By("Skipping " + mainDevice.Name + " as it is the primary NIC")
if mainDevice == nil {
mainDevice = &sriovv1.InterfaceExt{}
By("No SR-IOV device is the primary NIC of the node")
} else {
By("Skipping " + mainDevice.Name + " as it is the primary NIC")
}

for _, intf := range interfaces {
if !doesInterfaceSupportSwitchdev(intf) {
Expand Down

0 comments on commit 806674f

Please sign in to comment.