summaryrefslogtreecommitdiff
path: root/integrationtests/README.md
blob: 00360196d16fa0c284fa4dde6b93b59dcf237c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Integration Tests

End-to-end integration tests for ior. A standalone I/O workload binary performs
deterministic syscalls, ior traces the workload by PID via BPF, and the test
harness asserts the captured `.ior.zst` output matches expectations.

## Prerequisites

- Built `ior` binary (`mage all`)
- Root privileges or `CAP_BPF` (required for BPF tracepoint attachment)
- Local `libbpfgo` checkout pinned to `v0.9.2-libbpf-1.5.1` and rebuilt with
  `git -C ../libbpfgo submodule update --init --recursive && make -C ../libbpfgo libbpfgo-static`

The binary embeds its default BPF object. Set `IOR_BPF_OBJECT=/path/to/ior.bpf.o`
only when you explicitly want to override the embedded object during testing.
The harness runs `ior` in the legacy compatibility mode that writes aggregated
`.ior.zst` output via `-flamegraph -name <scenario>`; this is kept specifically
for integration coverage and rollback validation.

## Running

```bash
env GOTOOLCHAIN=auto mage integrationTest
```

This builds everything (ior, ioworkload) and runs integration tests in parallel.
Default parallelism is `NumCPU * 2` (minimum `1`).

Validated upgrade checks:

```bash
env GOTOOLCHAIN=auto mage world
env GOTOOLCHAIN=auto mage integrationTest
```

Tests automatically skip with `t.Skip` when not running as root.

To run serially (useful for debugging/flaky triage):

```bash
env GOTOOLCHAIN=auto INTEGRATION_PARALLEL=1 mage integrationTest
```

Tune parallelism by setting `INTEGRATION_PARALLEL`, for example:

```bash
env GOTOOLCHAIN=auto INTEGRATION_PARALLEL=4 mage integrationTest
```

If the suite fails before tracing starts, check for these common causes:

- The local `libbpfgo` checkout is not pinned to `v0.9.2-libbpf-1.5.1` or was
  rebuilt without `git submodule update --init --recursive`.
- `ior` was not rebuilt after pulling the compatibility fix for `-flamegraph`
  / `-name`.
- The run is missing root privileges, in which case the suite will skip or fail
  before BPF attach.

## Structure

- `cmd/ioworkload/` — Standalone binary performing known I/O patterns
- `harness.go` — Test orchestration (start ior + workload, collect output)
- `parse.go` — Parse `.ior.zst` into assertable `TestResult`
- `expectations.go` — `ExpectedEvent` type and assertion helpers
- `*_test.go` — One file per syscall family

See `../INTEGRATIONTESTS-PLAN.md` for the full design.