Skip to content

Commit f22f90e

Browse files
test(conformance): port scheduling and signal mediation probes
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent c53fd05 commit f22f90e

3 files changed

Lines changed: 21 additions & 16 deletions

File tree

‎e2e/rust/e2e-podman.sh‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ PODMAN_CI_TESTS=(
3434
podman_host_gateway
3535
provider_github_app
3636
provider_token_exchange
37-
sandbox_compat_signals_sched
3837
)
3938

4039
if [ -n "${E2E_TEST}" ] && [ -n "${E2E_TEST_SET}" ]; then

‎tests/suites/conformance/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ mod policy_update;
2727
mod port_forward;
2828
mod process;
2929
mod settings;
30+
mod signals_scheduling;
3031
mod smoke;
3132
mod ssh;
3233
mod templates;

e2e/rust/tests/sandbox_compat_signals_sched.rs renamed to tests/suites/conformance/src/signals_scheduling.rs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
//! failed with EPERM. The broker now mediates them: the caller's own thread
1010
//! group is allowed and every other target stays denied.
1111
12-
#![cfg(feature = "e2e")]
13-
14-
use openshell_e2e::harness::sandbox::SandboxGuard;
12+
use testkit::Context;
1513

1614
const SUCCESS_MARKER: &str = "sandbox_compat_signals_sched=ok";
1715

@@ -175,17 +173,24 @@ sys.exit(0 if not failures else 1)
175173
"#
176174
}
177175

178-
#[tokio::test]
179-
async fn sandbox_allows_own_group_and_denies_foreign_scheduling_and_signals() {
180-
let mut sandbox = SandboxGuard::create(&["--", "python3", "-c", compat_script()])
181-
.await
182-
.expect("sandbox create");
183-
184-
assert!(
185-
sandbox.create_output.contains(SUCCESS_MARKER),
186-
"expected own-group probes to pass and foreign-target probes to be denied:\n{}",
187-
sandbox.create_output
176+
/// Scheduling and signal probes may act on the caller's thread group, but
177+
/// scheduling changes that target another process must fail with EPERM.
178+
#[testkit::test]
179+
async fn sandbox_allows_own_group_and_denies_foreign_scheduling_and_signals(
180+
cx: &mut Context,
181+
) -> testkit::Result {
182+
let sandbox = cx
183+
.sandbox("sig")
184+
.image(testkit::python_image())
185+
.command(["sleep", "infinity"])
186+
.create_ready()
187+
.await?;
188+
let output = sandbox.run_python(compat_script(), &[]).await?;
189+
testkit::ensure!(
190+
output.stdout.lines().any(|line| line == SUCCESS_MARKER),
191+
"missing successful syscall probes:\n{}{}",
192+
output.stdout,
193+
output.stderr
188194
);
189-
190-
sandbox.cleanup().await;
195+
Ok(())
191196
}

0 commit comments

Comments
 (0)