ebpf
ebpf copied to clipboard
replace virtme
cmd/bpf2go: don't require internet connection in tests
Disable the checksum db and the module proxy. They aren't needed for tests
and disabling means we don't need internet access.
Signed-off-by: Lorenz Bauer <[email protected]>
replace virtme with vimto
vimto is a lightweight wrapper around qemu with the sole purpose of
executing Go unit tests. Use it instead of virtme, which has not had a
reliable upstream for a while.
Signed-off-by: Lorenz Bauer <[email protected]>
Test runs are suspiciously fast.
Not sure if fully applicable, but https://github.com/arighi/virtme-ng is actually supported, and is gaining traction after an article on LWN. Maybe something to look at if we want to replace virtme
@paulcacheux yeah, I'm aware of virtme-ng! I looked at it a while ago.
Pro:
- Already works
- Support for a variety of kernel sources
- virtiofsd
- gdb support?
Con:
- Dependency on rust for init which makes it more difficult to install.
- Doesn't allow distributing kernels as OCI images
So even if we use virtme-ng we need some wrapper code. vimto is easy to install when you're in the go ecosystem already, and I want to add go specific things like a delve wrapper.
Overall virtme-ng is probably the saner choice. The good news is that we can always rip out vimto if it turns out to be too much of a burden.
Finally managed to get CI green. @ti-mo @dylandreimerink @rgo3 maybe you can give it a spin on your machines to see whether it works? (I know that Robin's nix setup is mysteriously broken.)
Current status is that vimto needs a bit more thinking. @ti-mo how about I upstream the non-CI changes so that I can use vimto on my machine to test? Currently stranded without a viable virtme
and the changes themselves are useful either way I think.
Any concerns around merging this? It's at least as useable as virtme from my side.
I had some issues running vimto locally initially. When I ran the command from the updated index.md to run vimto locally vimto -- go test ./...
it fails with a lot of Error: exec: binary is not statically linked (did you build with CGO_ENABLED=0?)
errors.
Turns out its because I didn't add CGO_ENABLED=0
when installing vimto itself go install lmb.io/vimto@latest
. Adding so is very unusual. It would be nice if we can look into not requiring this. Or else add warnings in docs. Because I think more people will hit this.
Other than that, everything seems to be working! I say merge