Skip to content

Commit

Permalink
Opt-out a test from runc that it errors on
Browse files Browse the repository at this point in the history
Signed-off-by: Aidan Hobson Sayers <[email protected]>
  • Loading branch information
aidanhs committed Dec 7, 2024
1 parent 6dfbb77 commit 32d5dde
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/contest/contest/src/tests/fd_control/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use std::os::fd::{AsRawFd, RawFd};

use anyhow::{anyhow, Context, Result};
use oci_spec::runtime::{ProcessBuilder, Spec, SpecBuilder};
use test_framework::{test_result, Test, TestGroup, TestResult};
use test_framework::{test_result, ConditionalTest, Test, TestGroup, TestResult};

use crate::utils::{test_inside_container, CreateOptions};
use crate::utils::{is_runtime_runc, test_inside_container, CreateOptions};

fn create_spec() -> Result<Spec> {
SpecBuilder::default()
Expand Down Expand Up @@ -94,11 +94,16 @@ fn pass_single_fd_test() -> TestResult {
pub fn get_fd_control_test() -> TestGroup {
let mut test_group = TestGroup::new("fd_control");
test_group.set_nonparallel(); // fds are process-wide state
let test_only_stdio = Test::new("only_stdio", Box::new(only_stdio_test));
let test_only_stdio = ConditionalTest::new(
"only_stdio",
// runc errors if any of the N passed FDs via preserve-fd are not currently open
Box::new(|| !is_runtime_runc()),
Box::new(only_stdio_test),
);
let test_closes_fd = Test::new("closes_fd", Box::new(closes_fd_test));
let test_pass_single_fd = Test::new("pass_single_fd", Box::new(pass_single_fd_test));
test_group.add(vec![Box::new(test_only_stdio)]);
test_group.add(vec![
Box::new(test_only_stdio),
Box::new(test_closes_fd),
Box::new(test_pass_single_fd),
]);
Expand Down

0 comments on commit 32d5dde

Please sign in to comment.