Skip the read-only-directory test where modes are not enforced
Benchmarks / CPU and I/O (per commit) (push) Successful in 3m41s
Benchmarks / Frame budget (on demand) (push) Skipped
Build and test / Desktop (Linux) (push) Successful in 1h44m9s
Build and test / Layer separation (push) Successful in 48s
🐳 Android image / Build and push (push) Successful in 2s
Build and test / android-image (push) Successful in 2s
Traceability / Requirement traces (push) Successful in 36s
Build and test / Android (aarch64) (push) Successful in 1h1m51s
Benchmarks / CPU and I/O (per commit) (push) Successful in 3m41s
Benchmarks / Frame budget (on demand) (push) Skipped
Build and test / Desktop (Linux) (push) Successful in 1h44m9s
Build and test / Layer separation (push) Successful in 48s
🐳 Android image / Build and push (push) Successful in 2s
Build and test / android-image (push) Successful in 2s
Traceability / Requirement traces (push) Successful in 36s
Build and test / Android (aarch64) (push) Successful in 1h1m51s
`a_failed_overwrite_puts_the_original_back` makes the presets directory read-only and expects the overwrite to fail. CI's Desktop job runs in a container as root, and root is not refused by a mode: the write succeeds, the assertion fails, and build-and-test has been red on every push to master since the test arrived. The test now probes the refusal it depends on -- one write into the directory it just locked -- and skips where that write goes through. Probed rather than keyed on the uid, because what the test needs is the refusal itself, and a filesystem mounted without permission checks would pass a uid test and fail this one all the same.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user