Skip to content
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

Test suite refactor #25

Merged
merged 18 commits into from Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions .cargo/config.toml
@@ -1,8 +1,5 @@
[target.x86_64-unknown-linux-gnu]
runner = 'sudo -E'

[target.x86_64-unknown-linux-musl]
runner = 'sudo -E'

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-ld"

[alias]
xtask = "run --package xtask --"
182 changes: 124 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Expand Up @@ -12,6 +12,8 @@ members = [
"bpf-common",
"engine-api",
"validatron",
"xtask",
"test-suite",
]

[profile.release]
Expand Down
32 changes: 26 additions & 6 deletions README.md
Expand Up @@ -34,6 +34,7 @@ sudo apt install clang
git clone https://github.com/Exein-io/pulsar.git
cd pulsar
cargo test
cargo xtask test
cargo build --release

# Install files
Expand Down Expand Up @@ -78,27 +79,46 @@ See <https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md>

### Running without installing

> **Warning**: pulsar requires root privileges to load eBPF programs. To make it
> easier for development, [we run cargo artifacts with `sudo`](.cargo/config).
```sh
cargo xtask pulsard
```

Which is the same as

```sh
cargo run -- pulsard
cargo build
sudo ./target/debug/pulsar-exec pulsard
```

### Integration tests

In order to make sure your system is fully surpported, run the test suite.
In order to make sure your system is fully surpported, run the [test
suite](./test-suite).

```sh
cargo test
cargo xtask test
```

Which is the same as

```sh
cargo build
sudo ./target/debug/test-suite
```

### Single probe runner

Probes can be run in isolation by running the following.

```sh
cargo run --example probe -- file-created
cargo xtask probe file-system-monitor
```

Which is the same as

```sh
cargo build
sudo ./target/debug/probe file-system-monitor
```

## Contributing
Expand Down
5 changes: 1 addition & 4 deletions bpf-common/Cargo.toml
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
[features]
default = []
build = ["tempfile"]
test-utils = ["env_logger"]
test-utils = []

[dependencies]
aya = { version = "0.11.0", features = ["async_tokio"] }
Expand All @@ -27,6 +27,3 @@ tempfile = { version = "3.2", optional = true }
glob = "0.3.0"
hex = "0.4.3"
lazy_static = "1.4.0"

# Tests dependencies
env_logger = { version = "0.9.0", optional = true }