Skip to content

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Feb 17, 2025

Object pinning on Windows isn't backed by a file system, instead the path is just used as an identifier. Generate a random prefix to use for tests on Windows.

@lmb lmb marked this pull request as ready for review February 17, 2025 17:50
@lmb lmb requested a review from a team as a code owner February 17, 2025 17:50
Object pinning on Windows isn't backed by a file system, instead
the path is just used as an identifier. Generate a random prefix
to use for tests on Windows.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
"github.com/go-quicktest/qt"
)

func TestTempBPFFS(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if this test is really necessary; could we cover this with existing tests that run on both platforms? I get that this is more of a smoke test, but if it wouldn't work correctly, tests in the root package would probably also fail, especially given that t.Cleanup() looks very strict around wanting to remove all pins explicitly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't really have tests which pin and then check that the function removes pins, I discovered this the hard way. Mostly because on Linux the cleanup is just os.RemoveAll, where here it's more involved. We could make this a test which runs on Linux as well, the benefit there is minimal IMO.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is to say: I think it's worth having this test.

@lmb lmb merged commit e2e008f into cilium:main Feb 24, 2025
18 checks passed
@lmb lmb deleted the windows-testutils-bpffs branch February 24, 2025 19:47
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.

2 participants