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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
//! Integration test entry point.
//!
//! This file serves as the entry point for integration tests.
//! The actual tests are organized in the `integration/` directory.
//!
//! # Running Tests
//!
//! Integration tests require root privileges:
//!
//! ```bash
//! # Run all integration tests
//! sudo cargo test --test integration
//!
//! # Run specific test module
//! sudo cargo test --test integration link
//!
//! # Run a single test
//! sudo cargo test --test integration test_create_veth_pair
//!
//! # Run with output
//! sudo cargo test --test integration -- --nocapture
//! ```
//!
//! # Test Organization
//!
//! - `link.rs` - Link creation, modification, and deletion
//! - `address.rs` - IP address management
//! - `route.rs` - Route management
//! - `tc.rs` - Traffic control (qdisc, class, filter)
//! - `events.rs` - Event monitoring
// Plan 186 — VLAN parent ifindex race repro + topo-sort
// regression coverage. Lives in its own module so the focused
// scenarios stay out of the broader `config` integration
// surface.
// Feature-gated: the privileged integration workflow builds with
// `lab,sockdiag,namespace_watcher` so the inotify round-trip (#183)
// runs there.
// Feature-gated: only compiles when `sockdiag` is enabled. The
// privileged integration workflow builds with `lab,sockdiag` so the
// on-kernel bytecode validation runs there.
// Unprivileged by design — sock_diag dumps your own sockets without any
// capability, so these run for the non-root maintainer too.
// Plan 166 backfill — root-gated tests for the headline 0.16 features.
// Each module gates on `require_root!()` so this all early-returns
// when run as a regular user.
// Plan 194 — concurrent stress + seq-routing regression.
// Spawns 16 concurrent dumps on a shared Arc<Connection>
// and 16 concurrent LabNamespace::new calls. Both root-gated.
// 0.19 cycle backfill — Plan 188/196/199/200/202 round-trips
// surfaced by the post-cycle audit as kernel-touching surfaces
// with only unit-test coverage. All root-gated; WG/nft tests
// also gated by require_module!().
// Plan 221 — 0.19.1 XFRM hotfix regression tests. Root-gated +
// `xfrm_user` module-gated. Lock the corrected constant + dispatch
// values so a future commit can't re-introduce the bug class.
// Plan 197 — OVPN GENL family integration tests. Root-gated +
// `ovpn` module-gated (kernel 6.16+). Exercises peer + key ops
// + the declarative OvpnConfig diff + apply cycle.
// #190, #195, #199 — nftables safety. A foreign table must survive an
// apply that doesn't declare it; rules must install in declaration
// order; a mid-batch kernel rejection must surface as that error
// rather than an opaque 30s timeout.
// #191-#194, #218 — psched tick conversion. The unit tests pin the
// bytes nlink emits; these pin that the *kernel* accepts them and
// reads back what we wrote. Needed because the pre-fix writer and
// reader were wrong in the same direction and agreed with each other.
// Plan 234 (0.21) — Dispatcher foundation: ENOBUFS routing to
// ResyncMarker::ResyncStart, per-family wiring smoke checks,
// concurrent-request coexistence with dispatcher subscribers.
// #253 — the rtnetlink + uevent netdev lifecycle join. Root-gated +
// `veth` module-gated. The unit tests pin the join's logic with
// hand-fed streams; this pins the kernel facts underneath it — that a
// net uevent inside a namespace reaches a socket opened in that
// namespace, and that its IFINDEX= agrees with rtnetlink's.
// #251 — uevent socket hardening. Unprivileged by design: attaching a
// classic-BPF socket filter and reading uevents both need no
// capability, and it is the kernel's BPF verifier — not the privilege
// — that these check.
// #292 — extended-ack parsing, end to end. The unit tests synthesise the
// capped payload; only the kernel sends the shape that was actually
// arriving.
// #275 — MPTCP endpoint wiring. `dev(name)` was stored and never
// resolved, so endpoints had no interface binding; and the port's byte
// order is only checkable against an independent reader, because nlink
// writes and reads it symmetrically.
// #275 — declared values that the writers never read. Each test asserts
// the *value* landed, not that the call returned Ok; asserting Ok is
// what let these ship.
// #258/#268/#269/#270 — the TC shaping recipes. The HTB `default` and
// the class it names must agree (three bugs shipped because nothing
// checked), reconcile must notice an edited match criterion, and
// declaring a clsact must not delete the root qdisc.
// #267 — NLMSG_DONE's result code. Unprivileged: sock_diag dumps your
// own sockets without any capability, and a protocol with no diag
// handler answers DONE-with-ENOENT, which used to read as an empty list.
// #276, #280 — public API reachability. The integration target is a
// separate crate, so it sees what a downstream user sees.