-
Notifications
You must be signed in to change notification settings - Fork 14
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
proposal: use vmtest as go test runner #3
Comments
Assuming we add the one-liner interface to vmtest (which I am much in favor of), wouldn’t it be possible to pass flags to vmtest like this? Passing unknown flags to
My test shows:
wrapper/main.c: https://pastes.dxuuu.xyz/l9knkt It seems the same technique could be used for rust: https://github.com/libbpf/libbpf-rs/blob/4574a7825f1c088726c3d3eefd3d0d8f9ddd116e/libbpf-rs/.cargo/config#L2 |
That seems reasonable to me. The only thing I’m not sure about is what happens if you ask QEMU for more resources than is available on the current machine. For example, if you ask for 4 cpus on a 2 core machine. Assuming QEMU errors out, should we clamp down to 2 or return an error? It’s more of a instance property than a config file property, so maybe it should go on cmd line? Edit: looks like asking for 32 cpus on my 8 core machine works but 1T of memory on a 32G machine does not: https://pastes.dxuuu.xyz/26tn19 |
Yep, this works, but now I have to deal with double-quoting on the cmdline, which isn't very nice. Stripping out extra args gets rid of that problem. |
Good point, not sure there is a good answer. For my use case I have some tests which require > 1 cpu IIRC. |
Ok, I'll give supporting the go-style flags a shot -- UX is important. Hopefully it's possible to use |
I'd like to be able to do the following:
Behind the scenes:
vmtest
with the following args:"/tmp/path/to/test" "-vm.image" "/path/to/vmlinux" "-vm.env" "SOME_ENV" "-other-flag"
vmtest
would make the appropriate 9pfs mounts to make the go test runner happy: https://github.com/cilium/ebpf/blob/master/run-tests.sh#L27-L78vmtest
would execute the test with/tmp/path/to/test -other-flag
, with PWD being the directory vmtest is invoked in on the hostP.S. The weird
vm.
prefix on flags is needed due to how go tests behave when unknown flags are present. Behind the scenes vmtest should strip the prefix.It would also be nice to be able to specify certain "global settings" in
vmtest.toml
, like memory or number of CPUs.My goal would be to replace most of run-tests.sh with vmtest.
The text was updated successfully, but these errors were encountered: