exein-io / pulsar

A modular and blazing fast runtime security tool for the IoT, powered by eBPF.
https://pulsar.sh
Other
888 stars 51 forks source link

test: Allow to provide arguments through `cargo xtask test` #308

Closed vadorovsky closed 2 months ago

vadorovsky commented 2 months ago

The main motivation is the ability to specify a pattern for tests to run together with architest. Example command:

cargo xtask test --target x86_64-unknown-linux-musl \
    --features all-vendored --features tls-rustls \
    --kernel-versions 6.3 --force-architest \
    -- dns
vadorovsky commented 2 months ago

please do also the changes to the test-suite binary to handle the args, it seems that at this state it remains unused

I don't think any change is needed there. Passing arguments to test-suite is already supported:

 sudo -E ./target/release/test-suite exec_updates_interest

running 1 test
test filtering::exec_updates_interest ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 40 filtered out; finished in 0.22s

We just weren't exposing this functionality in xtask. This PR is only about being able to pass arguments to test-suite when using QEMU/architest.