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

cnf-tests: add tap device tests #725

Merged
merged 1 commit into from
Dec 8, 2021
Merged

cnf-tests: add tap device tests #725

merged 1 commit into from
Dec 8, 2021

Conversation

mmirecki
Copy link

No description provided.

@mmirecki mmirecki changed the title cnf-tests: DRAFT: add tap device tests cnf-tests: add tap device tests Oct 1, 2021
@mmirecki
Copy link
Author

mmirecki commented Oct 4, 2021

/retest

@mmirecki
Copy link
Author

mmirecki commented Oct 6, 2021

/retest

1 similar comment
@SchSeba
Copy link
Member

SchSeba commented Oct 12, 2021

/retest

Copy link
Member

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

Thanks for the PR I leave some comments but the main issue in the PR is that I was not able to find the place where you configure the sriovNetworkNodePolicy to mount the vhost-net device.

you can please also add a check before you start the dpdk application that /dev/vhost-net exist inside the container?

cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Outdated Show resolved Hide resolved
if err != nil {
return "", err
}
macLine := strings.Trim(strings.Split(getMacOutput.String(), "\n")[1], " ")
Copy link
Member

Choose a reason for hiding this comment

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

please check the len here before you do the [1] to be sure we are not going to fly

cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Outdated Show resolved Hide resolved
cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Show resolved Hide resolved
cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Show resolved Hide resolved
@mmirecki
Copy link
Author

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2021
@SchSeba
Copy link
Member

SchSeba commented Nov 29, 2021

@mmirecki everything is merged in the sriov operator, can you please rebase and check this PR.

Also please remove the mknod capability and the creation of the tun device.

cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Outdated Show resolved Hide resolved
cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Outdated Show resolved Hide resolved
cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Outdated Show resolved Hide resolved
cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Outdated Show resolved Hide resolved
cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Outdated Show resolved Hide resolved
sleep INF
`, dpdkResourceName, testpmdCommand, dpdkResourceName, runningTime)},
command,
},
SecurityContext: &corev1.SecurityContext{
RunAsUser: pointer.Int64Ptr(0),
Capabilities: &corev1.Capabilities{
// Enable NET_RAW is required by mellanox nics as they are using the netdevice driver
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 move the comment above this line (capabilities := []corev1.Capability{"IPC_LOCK", "SYS_RESOURCE", "NET_RAW"})

Copy link
Author

Choose a reason for hiding this comment

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

Done

@@ -1397,3 +1506,42 @@ func CleanSriov() {
}
sriov.WaitStable(sriovclient)
}

func getDeviceMac(pod *corev1.Pod, device string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

no need for this function lets just static allocate the mac addresses

Copy link
Author

Choose a reason for hiding this comment

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

Done

cnf-tests/testsuites/e2esuite/dpdk/dpdk.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Dec 1, 2021
@SchSeba
Copy link
Member

SchSeba commented Dec 6, 2021

Hi @mmirecki please take a look on the CI lane

The test [sriov] operator Custom SriovNetworkNodePolicy vhost-net and tun devices Validation Should have the vhost-net device inside the container does not have a valid description
2021/12/03 20:33:29 Failed to fill missing descriptions 'Found tests with no description'

@@ -74,6 +77,8 @@ var (
intelVendorID = "8086"

sriovNicsTable []TableEntry

dpdkWorkloadMac = "60:00:00:00:00:01"
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think this can be a const

Copy link
Author

Choose a reason for hiding this comment

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

done

}, 2*time.Minute, 1*time.Second).Should(ContainSubstring(LOG_ENTRY),
"Cannot find accumulated statistics")
By("Checking the tx output from the client DPDK application")
checkTxOnly(out)
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 please also check the tap side here

Copy link
Author

Choose a reason for hiding this comment

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

done

Expect(len(lines)).To(BeNumerically(">=", 3))
for i, line := range lines {
if strings.Contains(line, "NIC statistics for port") {
if getNumberOfPackets(lines[i+1], "RX") > 0 {
Copy link
Member

Choose a reason for hiding this comment

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

should you check here if i+1 exist?

Copy link
Author

Choose a reason for hiding this comment

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

done

return out
}, 8*time.Minute, 1*time.Second).Should(ContainSubstring("NIC statistics for port"),
"Cannot find accumulated statistics")
checkRx(out)
Copy link
Member

Choose a reason for hiding this comment

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

should the function be checkRxOnly like checkTxOnly

Copy link
Author

Choose a reason for hiding this comment

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

done

@mmirecki
Copy link
Author

mmirecki commented Dec 7, 2021

/retest

@mmirecki
Copy link
Author

mmirecki commented Dec 7, 2021

/retest

1 similar comment
@mmirecki
Copy link
Author

mmirecki commented Dec 7, 2021

/retest

Copy link
Member

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 8, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 8, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mmirecki, SchSeba

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2021
@openshift-merge-robot openshift-merge-robot merged commit 441b1f0 into openshift-kni:master Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants