F: script the remaining fakes on the peer's /api/v1 paths

Follow-up to the proxy path fix: the MCP end-to-end and peers_config
fakes still matched "/systemd/units" and so answered 404. Test
expectations only.
This commit is contained in:
ari committed 2026-10-20 15:04:09 -04:00
1 parent 04992e202d
commit 1d4b568a7c
2 files changed
+16 -8

No files matched your search

+9 -5
View File
@@ -295,7 +295,7 @@ async fn peer_tools_are_absent_without_configuration() {
async fn peer_argument_reads_through_the_consolidator() {
let fake = FakeTransport::new();
fake.peer("beta").respond(
"/systemd/units",
"/api/v1/systemd/units",
200,
"application/json",
r#"[{"name":"peer-only.service","active_state":"failed"}]"#,
@@ -317,7 +317,7 @@ async fn peer_argument_reads_through_the_consolidator() {
let calls = fake.calls();
assert_eq!(calls.len(), 1);
assert_eq!(calls[0].1.path, "/systemd/units");
assert_eq!(calls[0].1.path, "/api/v1/systemd/units");
assert_eq!(
calls[0].1.query,
vec![("state".to_owned(), "failed".to_owned())]
@@ -354,8 +354,12 @@ async fn rest_and_mcp_report_the_same_peer_status_errors() {
];
for (peer_status, http_status, code, message) in rows {
let fake = FakeTransport::new();
fake.peer("beta")
.respond("/systemd/units", peer_status, "application/json", "{}");
fake.peer("beta").respond(
"/api/v1/systemd/units",
peer_status,
"application/json",
"{}",
);
let h = start(peers_state(&fake)).await;
let (status, head, body) = h.get("/api/v1/peers/beta/systemd/units").await;
@@ -391,7 +395,7 @@ async fn rest_and_mcp_report_the_same_peer_status_errors() {
async fn peer_failures_are_visible_tool_errors() {
let fake = FakeTransport::new();
fake.peer("beta").respond_err(
"/systemd/units",
"/api/v1/systemd/units",
skyg_linux_tracker::peers::PeerError::Rejected,
);
let h = start(peers_state(&fake)).await;
+7 -3
View File
@@ -874,8 +874,12 @@ async fn fake_state_carries_the_registry() {
#[tokio::test]
async fn registry_proxies_through_the_fake_and_records_the_request() {
let fake = FakeTransport::new();
fake.peer("beta")
.respond("/systemd/units", 200, "application/json", r#"{"units":[]}"#);
fake.peer("beta").respond(
"/api/v1/systemd/units",
200,
"application/json",
r#"{"units":[]}"#,
);
let reg = registry_with(fake.clone(), fake_peers_config(&["beta"]));
let resp = reg
@@ -911,7 +915,7 @@ async fn registry_proxies_through_the_fake_and_records_the_request() {
async fn unknown_peer_and_peer_failures_use_the_shared_mapping() {
let fake = FakeTransport::new();
fake.peer("beta")
.respond_err("/systemd/units", PeerError::Rejected);
.respond_err("/api/v1/systemd/units", PeerError::Rejected);
let reg = registry_with(fake, fake_peers_config(&["beta"]));
let err = reg