Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(sandbox): cover cron passthrough output and pipeline status

Steven Enamakel66d9be951ce7
diff --git a/crates/openhuman-core/src/sandbox/native_jail_tests.rs b/crates/openhuman-core/src/sandbox/native_jail_tests.rs
index 35e4a51754..d1e3534f9c 100644
--- a/crates/openhuman-core/src/sandbox/native_jail_tests.rs
+++ b/crates/openhuman-core/src/sandbox/native_jail_tests.rs
@@ -26,7 +26,7 @@ fn shell_request_uses_the_platform_shell_and_caller_known_process_resource() ->
let resource = contract::ResourceId("known-resource".to_owned());
let cwd = tempfile::tempdir()?;
let env = BTreeMap::from([("LANG".to_owned(), "C".to_owned())]);
- let request = shell_request(&resource, "printf 'one two'", cwd.path(), env.clone())?;
+ let request = shell_request(&resource, "printf 'one two'", cwd.path(), env.clone(), false)?;
let expected = platform_shell::build_std_command("printf 'one two'");
let expected_argv = std::iter::once(expected.get_program().to_str().unwrap().to_owned())
@@ -241,5 +241,25 @@ async fn released_tinybox_runs_a_native_jail_through_the_pinned_loader() -> anyh
.await?;
assert!(output.success());
assert_eq!(output.stdout.len(), 150_000, "all terminal output batches are read");
+
+ let output = execute_passthrough(
+ &config,
+ "printf cron-module-ok; printf cron-stderr >&2",
+ workspace.path(),
+ Duration::from_secs(10),
+ )
+ .await?;
+ assert!(output.success());
+ assert_eq!(output.stdout, "cron-module-ok");
+ assert_eq!(output.stderr, "cron-stderr");
+
+ let output = execute_passthrough(
+ &config,
+ "false | true",
+ workspace.path(),
+ Duration::from_secs(10),
+ )
+ .await?;
+ assert!(output.success(), "cron preserves default pipeline status");
Ok(())
}