You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ddm-api] PUT /peer for state-machine-bypassing peer injection
Fills out the testing work for `ddmd` in Omicron.
Includes:
- Adds a `PUT /peer` admin endpoint, gated at v2.0.0 (MULTICAST_SUPPORT), that
injects a `PeerInfo` directly into the in-memory peer table at a supplied
interface index. Intended for fixtures running ddmd with `--no-state-machine`.
Note that in typical operations the discovery handler will overwrite any
directly-injected entry the next time a peer is observed on that interface.
- Extracts the `get_peers` and `put_peer` impl bodies into
`do_get_peers` / `do_put_peer` free functions in `ddm/src/admin.rs`,
mirroring `mgd::bgp_admin::do_bgp_apply`, so the endpoints can be
exercised in-process.
- Adds `tests::put_peer_round_trips` over a tempdir-backed setup covering the
round-trip and same interface-index overwrite invariant.
- Adds a `put_peer` synthetic injection into the `run_trio_tests` smoke test
that exercises the full HTTP path through the generated client against a
running ddmd.
Copy file name to clipboardExpand all lines: openapi/ddm-admin/ddm-admin-2.0.0-0cfd90.json
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,34 @@
223
223
}
224
224
}
225
225
},
226
+
"/peer": {
227
+
"put": {
228
+
"summary": "Set peer information for a given interface index, bypassing the state machine.",
229
+
"description": "Intended for test fixtures that run `ddmd` with `--no-state-machine`. In a normal run, discovery writes peer entries keyed by interface index whenever it processes an advertisement, so any directly-injected entry for an active interface will be overwritten the next time a peer is observed there.",
230
+
"operationId": "put_peer",
231
+
"requestBody": {
232
+
"content": {
233
+
"application/json": {
234
+
"schema": {
235
+
"$ref": "#/components/schemas/PutPeerRequest"
236
+
}
237
+
}
238
+
},
239
+
"required": true
240
+
},
241
+
"responses": {
242
+
"204": {
243
+
"description": "resource updated"
244
+
},
245
+
"4XX": {
246
+
"$ref": "#/components/responses/Error"
247
+
},
248
+
"5XX": {
249
+
"$ref": "#/components/responses/Error"
250
+
}
251
+
}
252
+
}
253
+
},
226
254
"/peers": {
227
255
"get": {
228
256
"operationId": "get_peers",
@@ -717,6 +745,24 @@
717
745
"Expired"
718
746
]
719
747
},
748
+
"PutPeerRequest": {
749
+
"description": "Body for `PUT /peer`. Sets `info` at the slot keyed by `if_index` (interface index) in the in-memory peer map.",
0 commit comments