Expand $PWD in config paths to the launch directory
This commit is contained in:
@@ -43,6 +43,25 @@ fn cwd_is_writable() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_pwd_binds_launch_directory_writable() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let config = ConfigFile::new(r#"rw = ["$PWD"]"#);
|
||||
|
||||
let output = Command::new(env!("CARGO_BIN_EXE_agent-sandbox"))
|
||||
.args(["--config", &config, "--", "touch", "canary"])
|
||||
.current_dir(dir.path())
|
||||
.output()
|
||||
.expect("agent-sandbox binary failed to execute");
|
||||
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"stderr: {}",
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
assert!(dir.path().join("canary").exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn host_fs_is_readonly() {
|
||||
let output = Sandbox::new(&[])
|
||||
|
||||
Reference in New Issue
Block a user