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

virtionet: testing connectUnixPath #199

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

lstocchi
Copy link

@lstocchi lstocchi commented Oct 2, 2024

It adds tests for connectUnixPath and localUnixSocketPath func in virtionet.go.
It mainly test the use case where one end of the unixgram socket is longer of 104 bytes resulting in a failure.

Copy link
Collaborator

@cfergeau cfergeau 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 adding this test! A few minor comments.

pkg/vf/virtionet_test.go Outdated Show resolved Hide resolved
pkg/vf/virtionet_test.go Outdated Show resolved Hide resolved
})

t.Run("Failed connection - End socket longer than 104 bytes", func(t *testing.T) {
// Retrieve HOME env variable (used by the os.UserHomeDir)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah right, kind of messy to do the 100 bytes test with current main :/ This will need to be modified once #195 gets in.

@lstocchi lstocchi requested a review from cfergeau October 2, 2024 12:52
@cfergeau
Copy link
Collaborator

cfergeau commented Oct 2, 2024

Can you squash all 3 commits together? I don't think it's really useful to keep all 3 in our git history.
Apart from this, ack!

@lstocchi lstocchi force-pushed the testVirtionet branch 2 times, most recently from ed32f4f to e77812d Compare October 2, 2024 14:53
@lstocchi
Copy link
Author

lstocchi commented Oct 2, 2024

@cfergeau updated

pkg/vf/virtionet_test.go Outdated Show resolved Hide resolved
it adds tests for connectUnixPath and localUnixSocketPath func in virtionet.go
it mainly test the use case where one end of the unixgram socket is longer of 104 bytes resulting in a failure. On macOS, a path on the filesystem can have a max of 104 bytes length
@cfergeau
Copy link
Collaborator

cfergeau commented Oct 4, 2024

/lgtm
/approve

Copy link

openshift-ci bot commented Oct 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau

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 label Oct 4, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 751d42c into crc-org:main Oct 4, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants