internal/testutils: make TempBPFFS portable#1688
Conversation
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 <[email protected]>
| "github.com/go-quicktest/qt" | ||
| ) | ||
|
|
||
| func TestTempBPFFS(t *testing.T) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
That is to say: I think it's worth having this test.
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.