Skip to content

Commit e7ce2a8

Browse files
committed
test(supervisor): run sandbox instance host tests only on Unix hosts
The sandbox_instance_host tests added with per-instance supervisor state (#4701) admit hosted instances through SandboxInstanceHost::new, which prepares a private directory per instance. Hosted sandbox instances are Unix-only: on other hosts prepare_private_dir returns "hosted sandbox instances require a Unix host". Prior to this change, the test module still compiled and ran on Windows, so all three tests failed while creating their host. Now, the test module is gated to Unix, and the Unix-only permission check inside one test no longer needs its own cfg attribute. Signed-off-by: Kris Hicks <khicks@nvidia.com>
1 parent fa1ee60 commit e7ce2a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎crates/openshell-supervisor/src/sandbox_instance_host.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,8 @@ pub(crate) fn prepare_private_dir(_path: &Path) -> Result<()> {
745745
))
746746
}
747747

748-
#[cfg(test)]
748+
// Hosted sandbox instances require a Unix host.
749+
#[cfg(all(test, unix))]
749750
mod tests {
750751
use super::*;
751752
use http_body_util::BodyExt as _;
@@ -1050,7 +1051,6 @@ mod tests {
10501051

10511052
// Files that cannot be deleted keep the key reserved until a later
10521053
// removal deletes them. Root ignores the permission this relies on.
1053-
#[cfg(unix)]
10541054
if !nix::unistd::geteuid().is_root() {
10551055
use std::os::unix::fs::PermissionsExt as _;
10561056

0 commit comments

Comments
 (0)