diff --git a/conformance-tests/Cargo.toml b/conformance-tests/Cargo.toml index e4bcca3..aa3b9cc 100644 --- a/conformance-tests/Cargo.toml +++ b/conformance-tests/Cargo.toml @@ -9,7 +9,7 @@ homepage.workspace = true [dependencies] anyhow = "1.0" -conformance-tests = { git = "https://github.com/fermyon/conformance-tests" } +conformance-tests = { git = "https://github.com/fermyon/conformance-tests", ref = "c19e5cf54b7586829e923bd2091314e4d473f4f5" } log = "0.4" nix = "0.26" -test-environment = { git = "https://github.com/fermyon/conformance-tests" } +test-environment = { git = "https://github.com/fermyon/conformance-tests", ref = "c19e5cf54b7586829e923bd2091314e4d473f4f5" } diff --git a/conformance-tests/README.md b/conformance-tests/README.md index 6547013..b097ce0 100644 --- a/conformance-tests/README.md +++ b/conformance-tests/README.md @@ -26,14 +26,14 @@ Containerd must be configured to access the `containerd-shim-spin`: ``` ## Running tests -Containerd can only be executed as a root user. Choose one of the following options +Containerd can only be executed as a root user. Choose one of the following option, being sure to pass the path to the Spin and `ctr` binaries as arguments. 1. Build the `conformance-tests` bin and excute it as sudo user: ```sh cargo build - sudo ../target/debug/conformance-tests + sudo ../target/debug/conformance-tests /path/to/spin /path/to/ctr ``` 2. Run cargo as root by passing in the environment from the user's context and full path to cargo: ```sh - sudo -E $HOME/.cargo/bin/cargo run + sudo -E $HOME/.cargo/bin/cargo run /path/to/spin /path/to/ctr ``` 3. Follow the [containerd instructions](https://github.com/containerd/containerd/blob/main/docs/rootless.md) to configure it to be runnable as a non-root user \ No newline at end of file diff --git a/conformance-tests/src/main.rs b/conformance-tests/src/main.rs index f84083b..3463ac1 100644 --- a/conformance-tests/src/main.rs +++ b/conformance-tests/src/main.rs @@ -21,7 +21,11 @@ fn main() { .next() .expect("expected second arg to be path to ctr binary"); - 'test: for test in conformance_tests::tests(&tests_dir).unwrap() { + 'test: for test in conformance_tests::tests_iter(&tests_dir).unwrap() { + if test.name.starts_with("tcp") { + // Skip TCP tests for now as shim cannot create sockets + continue; + } println!("running test: {}", test.name); let mut services = vec!["registry".into()]; for precondition in &test.config.preconditions { @@ -34,6 +38,9 @@ fn main() { panic!("unsupported label: {}", k.label); } } + conformance_tests::config::Precondition::TcpEcho => { + services.push("tcp-echo".into()); + } } } let env_config = SpinShim::config( @@ -98,14 +105,14 @@ impl SpinShim { .get_port(5000)? .context("environment doesn't expose port for OCI registry")? ); - SpinShim::regisry_push(&spin_binary, &oci_image, env)?; + SpinShim::registry_push(&spin_binary, &oci_image, env)?; SpinShim::image_pull(&ctr_binary, &oci_image)?; SpinShim::start(&ctr_binary, env, &oci_image, CTR_RUN_ID) }), } } - pub fn regisry_push( + pub fn registry_push( spin_binary_path: &Path, image: &str, env: &mut TestEnvironment,