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

Function parses_full_example

crates/openshell-server/src/config_file.rs:346–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344
345 #[test]
346 fn parses_full_example() {
347 let toml = r#"
348[openshell]
349version = 1
350
351[openshell.gateway]
352bind_address = "0.0.0.0:8080"
353health_bind_address = "0.0.0.0:8081"
354log_level = "info"
355compute_drivers = ["kubernetes"]
356sandbox_namespace = "agents"
357grpc_rate_limit_requests = 120
358grpc_rate_limit_window_seconds = 60
359default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
360supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
361client_tls_secret_name = "openshell-sandbox-tls"
362service_account_name = "openshell-sandbox"
363
364[openshell.gateway.tls]
365cert_path = "/etc/openshell/certs/gateway.pem"
366key_path = "/etc/openshell/certs/gateway-key.pem"
367client_ca_path = "/etc/openshell/certs/client-ca.pem"
368
369[openshell.gateway.oidc]
370issuer = "https://idp.example.com/realms/openshell"
371audience = "openshell-cli"
372
373[openshell.drivers.kubernetes]
374namespace = "agents"
375grpc_endpoint = "https://openshell-gateway.agents.svc:8080"
376"#;
377 let tmp = write_tmp(toml);
378 let file = load(tmp.path()).expect("valid file parses");
379 let gw = &file.openshell.gateway;
380 assert_eq!(gw.log_level.as_deref(), Some("info"));
381 assert_eq!(
382 gw.default_image.as_deref(),
383 Some("ghcr.io/nvidia/openshell/sandbox:latest")
384 );
385 assert_eq!(gw.grpc_rate_limit_requests, Some(120));
386 assert_eq!(gw.grpc_rate_limit_window_seconds, Some(60));
387 assert!(gw.tls.is_some());
388 assert!(gw.oidc.is_some());
389 assert!(file.openshell.drivers.contains_key("kubernetes"));
390 }
391
392 #[test]
393 fn parses_gateway_auth_config() {

Callers

nothing calls this directly

Calls 3

write_tmpFunction · 0.85
loadFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected