Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reconcile vf functional test #744

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

SchSeba
Copy link
Collaborator

@SchSeba SchSeba commented Jul 22, 2024

we should not lower the MTU on a primary SDN nic.

with this change we select a PF that is not the default route of the node or not the nic connected to the ovs bridge for openshift

Copy link

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

coveralls commented Jul 22, 2024

Pull Request Test Coverage Report for Build 10351277379

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 45.189%

Totals Coverage Status
Change from base Build 10318797846: 0.04%
Covered Lines: 6532
Relevant Lines: 14455

💛 - Coveralls

@SchSeba SchSeba force-pushed the fix_mtu_test_1 branch 3 times, most recently from d98b652 to 377410f Compare July 25, 2024 08:21
Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left few minor comments. As far as I understood, the main change in this PR is

unusedSriovDevices, err := findUnusedSriovDevices(node, sriovDeviceList)
							if err != nil {
								Skip(err.Error())
							}
							intf = unusedSriovDevices[0]

correct?

https://github.com/k8snetworkplumbingwg/sriov-network-operator/pull/744/files#diff-6665a7e475c21cad9c99b9463fba12769e300e6d1a6cc1323c9c3ca68e8cc120R1581

networkStatusJSON, exist := firstPod.Annotations["k8s.v1.cni.cncf.io/network-status"]
Expect(exist).To(BeTrue())
Expect(networkStatusJSON).To(ContainSubstring("\"mtu\": 9000"))
Eventually(func() error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use waitForNetAttachDef() here?

stdout, stderr, err = pod.ExecCommand(clients, firstPod, "ip", "link", "show", "net1")
if stdout == "" {
return fmt.Errorf("empty response from pod exec")
// update the interface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, extract a function like

Suggested change
// update the interface
intf = getInterfaceFromNodeStateByPciAddress(node, intf.PciAddr)
func getInterfaceFromNodeStateByPciAddress(node, pciAddress string) {
nodeState := &sriovv1.SriovNetworkNodeState{}
err = clients.Get(context.Background(), runtimeclient.ObjectKey{Name: node, Namespace: operatorNamespace}, nodeState)
Expect(err).ToNot(HaveOccurred())
found := false
for _, state := range nodeState.Status.Interfaces {
if state.PciAddress == intf.PciAddress {
intf = state.DeepCopy()
found = true
break
}
}
Expect(found).To(BeTrue())
}

WDYT?

@SchSeba SchSeba changed the title Fix MTU functional test Fix reconcile vf functional test Aug 12, 2024
@SchSeba
Copy link
Collaborator Author

SchSeba commented Aug 12, 2024

Hi @zeeke when you have time please take another look :)

we should not lower the MTU on a primary SDN nic.

with this change we select a PF that is not the default route of the node or not the nic connected to the ovs bridge for openshift

Signed-off-by: Sebastian Sch <[email protected]>
Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@zeeke zeeke merged commit 15a3f73 into k8snetworkplumbingwg:master Aug 12, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants