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

22 lines
579 B
Rust
Raw Normal View History

2023-02-05 23:44:06 +01:00
use dagger_sdk::client::connect;
use dagger_sdk::gen::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,
}))
2023-02-05 23:44:06 +01:00
.stdout();
assert_eq!(out, "3.16.2\n".to_string())
2023-02-05 23:44:06 +01:00
}