Skip to content

Commit 8bd564b

Browse files
committed
test(gateway): serialize preflight fixture paths as TOML
Keep temporary paths quoted and escaped through the TOML serializer instead of relying on Rust Debug formatting. Signed-off-by: Shiju <shiju@nvidia.com>
1 parent ee75f43 commit 8bd564b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎crates/openshell-gateway/tests/config_preflight.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ impl Fixture {
3838
fn write_config(&self, driver: Option<&str>) {
3939
let selector =
4040
driver.map_or_else(String::new, |name| format!("compute_driver = {name:?}\n"));
41+
// TOML serialization preserves quotes and escapes in the fixture path.
42+
let state_dir = toml::Value::try_from(self.root.path().join("vm-state"))
43+
.expect("serialize VM state directory");
4144
fs::write(&self.config, format!(
42-
"[openshell]\nversion = 2\n[openshell.gateway]\ndisable_tls = true\n{selector}[openshell.drivers.vm]\nbootstrap_image = 'unreachable.invalid/vm:must-not-pull'\nstate_dir = {:?}\n",
43-
self.root.path().join("vm-state")
45+
"[openshell]\nversion = 2\n[openshell.gateway]\ndisable_tls = true\n{selector}[openshell.drivers.vm]\nbootstrap_image = 'unreachable.invalid/vm:must-not-pull'\nstate_dir = {state_dir}\n"
4446
)).expect("gateway configuration");
4547
}
4648

0 commit comments

Comments
 (0)