//! v3.3 config-parsing smoke test for `[client.circuit] rotation_interval_secs`. //! //! Asserts that: //! 1. A `client.toml` with `rotation_interval_secs = N` parses and surfaces `N` on the //! [`ClientConfigFile`]. //! 2. Omitting the key keeps the v3.2-compatible default of `0` (i.e. rotation off). //! //! Pure TOML parsing — no networking, no actors. This is the back-compat smoke test the v3.3 //! direction memory calls for. use aura_cli::config::ClientConfigFile; const TOML_WITH_ROTATION: &str = r#" [client] name = "laptop" server_addr = "203.0.113.10:443" sni = "cdn.example.com" [client.circuit] enabled = true hops = ["198.51.100.5:443", "203.0.113.10:443"] cell_padding = true cell_size = 1280 rotation_interval_secs = 600 [pki] ca_cert = "~/.aura/ca.crt" cert = "~/.aura/client.crt" key = "~/.aura/client.key" [tunnel] local_ip = "10.7.0.2" "#; const TOML_NO_ROTATION: &str = r#" [client] name = "laptop" server_addr = "203.0.113.10:443" sni = "cdn.example.com" [client.circuit] enabled = true hops = ["198.51.100.5:443", "203.0.113.10:443"] [pki] ca_cert = "~/.aura/ca.crt" cert = "~/.aura/client.crt" key = "~/.aura/client.key" [tunnel] local_ip = "10.7.0.2" "#; #[test] fn rotation_interval_secs_parses_when_set() { let cfg = ClientConfigFile::parse(TOML_WITH_ROTATION).expect("parse client.toml with rotation"); let circuit = cfg.circuit(); assert!(circuit.enabled, "circuit must be enabled"); assert_eq!(circuit.hops.len(), 2); assert!(circuit.cell_padding); assert_eq!(circuit.cell_size, 1280); assert_eq!( circuit.rotation_interval_secs, 600, "rotation_interval_secs surfaces the TOML value" ); } #[test] fn rotation_interval_secs_defaults_to_zero_back_compat() { let cfg = ClientConfigFile::parse(TOML_NO_ROTATION).expect("parse client.toml without rotation"); let circuit = cfg.circuit(); assert!(circuit.enabled); assert_eq!( circuit.rotation_interval_secs, 0, "default is 0 = rotation off; preserves v3.2 single-dial behaviour" ); }