dagger-rs/crates/dagger-sdk/tests/mod.rs

22 lines
570 B
Rust
Raw Normal View History

use dagger_sdk::{connect, ContainerExecOpts};
2023-02-05 23:44:06 +01:00
#[test]
fn test_example_container() {
let client = connect().unwrap();
let alpine = client.container(None).from("alpine:3.16.2".into());
2023-02-05 23:44:06 +01:00
let out = alpine
.exec(Some(ContainerExecOpts {
args: Some(vec!["cat".into(), "/etc/alpine-release".into()]),
stdin: None,
redirect_stdout: None,
redirect_stderr: None,
experimental_privileged_nesting: None,
}))
.stdout()
.unwrap();
2023-02-05 23:44:06 +01:00
assert_eq!(out, "3.16.2\n".to_string())
2023-02-05 23:44:06 +01:00
}