MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / test_sandbox

Function test_sandbox

crates/openshell-driver-docker/src/tests.rs:27–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25static ENV_LOCK: LazyLock<Mutex<()>> = LazyLock::new(|| Mutex::new(()));
26
27fn test_sandbox() -> DriverSandbox {
28 // Mirrors the gateway-supplied request: the public `Sandbox` API no
29 // longer carries `namespace`, so the gateway elides the field and the
30 // driver must source it from its own runtime config.
31 DriverSandbox {
32 id: "sbx-123".to_string(),
33 name: "demo".to_string(),
34 namespace: String::new(),
35 spec: Some(DriverSandboxSpec {
36 log_level: "debug".to_string(),
37 environment: HashMap::from([("SPEC_ENV".to_string(), "spec".to_string())]),
38 template: Some(DriverSandboxTemplate {
39 image: "ghcr.io/nvidia/openshell/sandbox:dev".to_string(),
40 agent_socket_path: String::new(),
41 labels: HashMap::new(),
42 environment: HashMap::from([("TEMPLATE_ENV".to_string(), "template".to_string())]),
43 ..Default::default()
44 }),
45 resource_requirements: None,
46 sandbox_token: String::new(),
47 }),
48 status: None,
49 }
50}
51
52fn cdi_devices_config(device_ids: &[&str]) -> prost_types::Struct {
53 list_string_driver_config("cdi_devices", device_ids)

Calls

no outgoing calls

Tested by

no test coverage detected