Skip to content

Commit cecce6c

Browse files
Use latest conformance tests structure and tests
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 0a67bbb commit cecce6c

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

conformance-tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ homepage.workspace = true
99

1010
[dependencies]
1111
anyhow = "1.0"
12-
conformance-tests = { git = "https://github.com/fermyon/conformance-tests" }
12+
conformance-tests = { git = "https://github.com/fermyon/conformance-tests", ref = "c19e5cf54b7586829e923bd2091314e4d473f4f5" }
1313
log = "0.4"
1414
nix = "0.26"
15-
test-environment = { git = "https://github.com/fermyon/conformance-tests" }
15+
test-environment = { git = "https://github.com/fermyon/conformance-tests", ref = "c19e5cf54b7586829e923bd2091314e4d473f4f5" }

conformance-tests/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Containerd must be configured to access the `containerd-shim-spin`:
2626
```
2727

2828
## Running tests
29-
Containerd can only be executed as a root user. Choose one of the following options
29+
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.
3030
1. Build the `conformance-tests` bin and excute it as sudo user:
3131
```sh
3232
cargo build
33-
sudo ../target/debug/conformance-tests
33+
sudo ../target/debug/conformance-tests /path/to/spin /path/to/ctr
3434
```
3535
2. Run cargo as root by passing in the environment from the user's context and full path to cargo:
3636
```sh
37-
sudo -E $HOME/.cargo/bin/cargo run
37+
sudo -E $HOME/.cargo/bin/cargo run /path/to/spin /path/to/ctr
3838
```
3939
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

conformance-tests/src/main.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ fn main() {
2121
.next()
2222
.expect("expected second arg to be path to ctr binary");
2323

24-
'test: for test in conformance_tests::tests(&tests_dir).unwrap() {
24+
'test: for test in conformance_tests::tests_iter(&tests_dir).unwrap() {
25+
if test.name.starts_with("tcp") {
26+
// Skip TCP tests for now as shim cannot create sockets
27+
continue;
28+
}
2529
println!("running test: {}", test.name);
2630
let mut services = vec!["registry".into()];
2731
for precondition in &test.config.preconditions {
@@ -34,6 +38,9 @@ fn main() {
3438
panic!("unsupported label: {}", k.label);
3539
}
3640
}
41+
conformance_tests::config::Precondition::TcpEcho => {
42+
services.push("tcp-echo".into());
43+
}
3744
}
3845
}
3946
let env_config = SpinShim::config(
@@ -98,14 +105,14 @@ impl SpinShim {
98105
.get_port(5000)?
99106
.context("environment doesn't expose port for OCI registry")?
100107
);
101-
SpinShim::regisry_push(&spin_binary, &oci_image, env)?;
108+
SpinShim::registry_push(&spin_binary, &oci_image, env)?;
102109
SpinShim::image_pull(&ctr_binary, &oci_image)?;
103110
SpinShim::start(&ctr_binary, env, &oci_image, CTR_RUN_ID)
104111
}),
105112
}
106113
}
107114

108-
pub fn regisry_push<R>(
115+
pub fn registry_push<R>(
109116
spin_binary_path: &Path,
110117
image: &str,
111118
env: &mut TestEnvironment<R>,

0 commit comments

Comments
 (0)