Skip to content

Commit 52e2f28

Browse files
committed
fix(network): reconcile additional CA tests with suspend/resume and auth changes
Upstream's suspend/resume lifecycle took StartSandboxRequest fields 7 and 8, so the durable-snapshot field moves from 7 to 9; update the wire-format test to assert the field-9 key (0x4a) and initialize the new resume controls. Repair the cli test module after the auth opt-in test merged alongside the environment-guard helpers, and initialize the gateway driver-startup context's network-trust fields in the shared supervision test. Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
1 parent 0ac6fa8 commit 52e2f28

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎crates/openshell-server/src/cli.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,8 @@ mod tests {
15731573
assert!(error.contains(expected), "missing {expected:?} in {error}");
15741574
}
15751575
});
1576+
}
1577+
}
15761578

15771579
static ENV_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());
15781580

‎crates/openshell-server/src/compute/mod.rs‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18128,14 +18128,16 @@ endpoint = { kind = "unix", socket_path = "/run/agent-substrate/isolation.sock"
1812818128
}
1812918129

1813018130
#[test]
18131-
fn start_sandbox_request_uses_optional_wire_field_seven_for_durable_snapshot() {
18131+
fn start_sandbox_request_uses_optional_wire_field_nine_for_durable_snapshot() {
1813218132
let legacy = StartSandboxRequest {
1813318133
sandbox_id: "sandbox-id".into(),
1813418134
name: "sandbox-name".into(),
1813518135
launch_authentication: b"opaque-auth".to_vec(),
1813618136
generation_id: "generation-id".into(),
1813718137
expected_runtime_identity: String::new(),
1813818138
isolation_backend: None,
18139+
resume: false,
18140+
restart_if_restore_fails: false,
1813918141
sandbox: None,
1814018142
};
1814118143
let with_snapshot = StartSandboxRequest {
@@ -18148,11 +18150,11 @@ endpoint = { kind = "unix", socket_path = "/run/agent-substrate/isolation.sock"
1814818150
};
1814918151
let legacy_wire = legacy.encode_to_vec();
1815018152
let snapshot_wire = with_snapshot.encode_to_vec();
18151-
// Field 7 is length-delimited, hence its protobuf key is 0x3a. The
18152-
// legacy form does not emit it, preserving existing fields 1–6
18153-
// (field 6 is the upstream isolation backend registration).
18154-
assert!(!legacy_wire.contains(&0x3a));
18155-
assert!(snapshot_wire.contains(&0x3a));
18153+
// Field 9 is length-delimited, hence its protobuf key is 0x4a. The
18154+
// legacy form does not emit it, preserving existing fields 1–8
18155+
// (fields 7 and 8 are the upstream suspend/resume controls).
18156+
assert!(!legacy_wire.contains(&0x4a));
18157+
assert!(snapshot_wire.contains(&0x4a));
1815618158
assert_eq!(
1815718159
StartSandboxRequest::decode(snapshot_wire.as_slice())
1815818160
.unwrap()

‎crates/openshell-server/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,6 +2426,8 @@ mod tests {
24262426
guest_tls: None,
24272427
gateway_port: 8080,
24282428
gateway_tls_enabled: true,
2429+
network_trust: None,
2430+
network_trust_configured: false,
24292431
endpoint_overrides: &endpoint_overrides,
24302432
},
24312433
},

0 commit comments

Comments
 (0)