|
|
|
[package]
|
|
|
|
name = "integration-ebpf"
|
|
|
|
version = "0.1.0"
|
|
|
|
publish = false
|
|
|
|
authors.workspace = true
|
|
|
|
license.workspace = true
|
|
|
|
repository.workspace = true
|
|
|
|
homepage.workspace = true
|
|
|
|
edition.workspace = true
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
aya-ebpf = { path = "../../ebpf/aya-ebpf" }
|
|
|
|
aya-log-ebpf = { path = "../../ebpf/aya-log-ebpf" }
|
|
|
|
network-types = "0.0.6"
|
|
|
|
|
|
|
|
[build-dependencies]
|
|
|
|
which = { workspace = true }
|
|
|
|
xtask = { path = "../../xtask" }
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "log"
|
|
|
|
path = "src/log.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "map_test"
|
|
|
|
path = "src/map_test.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "name_test"
|
|
|
|
path = "src/name_test.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "pass"
|
|
|
|
path = "src/pass.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "test"
|
|
|
|
path = "src/test.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "relocations"
|
|
|
|
path = "src/relocations.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "bpf_probe_read"
|
|
|
|
path = "src/bpf_probe_read.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "two_progs"
|
|
|
|
path = "src/two_progs.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "redirect"
|
|
|
|
path = "src/redirect.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "xdp_sec"
|
|
|
|
path = "src/xdp_sec.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "ring_buf"
|
|
|
|
path = "src/ring_buf.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "memmove_test"
|
|
|
|
path = "src/memmove_test.rs"
|
aya,integration-test: improve integration tests for info API
Improves the existing integraiton tests for `loaded_programs()` and
`loaded_maps()` in consideration for older kernels:
- Opt for `SocketFilter` program in tests since XDP requires v4.8 and
fragments requires v5.18.
- For assertion tests, first perform the assertion, if the assertion
fails, then it checks the host kernel version to see if it is above
the minimum version requirement. If not, then continue with test,
otherwise fail.
For assertions that are skipped, they're logged in stderr which can
be observed with `-- --nocapture`.
This also fixes the `bpf_prog_get_info_by_fd()` call for kernels below
v4.15. If calling syscall on kernels below v4.15, it can produce an
`E2BIG` error because `check_uarg_tail_zero()` expects the entire
struct to all-zero bytes (which is caused from the map info).
Instead, we first attempt the syscall with the map info filled, if it
returns `E2BIG`, then perform syscall again with empty closure.
Also adds doc for which version a kernel feature was introduced for
better awareness.
The tests have been verified kernel versions:
- 4.13.0
- 4.15.0
- 6.1.0
3 months ago
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "simple_prog"
|
|
|
|
path = "src/simple_prog.rs"
|