diff --git a/ui/dr-ui/src/presets.rs b/ui/dr-ui/src/presets.rs index 187cf43..8df9507 100644 --- a/ui/dr-ui/src/presets.rs +++ b/ui/dr-ui/src/presets.rs @@ -1608,6 +1608,22 @@ mod tests { perms.set_mode(0o500); std::fs::set_permissions(&dir, perms.clone()).unwrap(); + // Root is not refused by a mode, and CI's desktop job runs as root + // inside its container: there the directory is as writable as it ever + // was and the "failed" write succeeds. Probed rather than assumed from + // the uid, because what the test needs is the refusal itself, and a + // filesystem mounted without permission checks would pass the uid + // test and fail this one all the same. + let probe = dir.join("probe"); + let enforced = std::fs::write(&probe, b"").is_err(); + if !enforced { + let _ = std::fs::remove_file(&probe); + perms.set_mode(0o700); + std::fs::set_permissions(&dir, perms).unwrap(); + eprintln!("directory modes are not enforced here (root?); skipping"); + return; + } + let failed = presets.insert("Warm", Preset::default()).is_err(); // Restore the permissions before asserting, so a failure here does not