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

21 lines
483 B
Rust
Raw Normal View History

use dagger_sdk::{connect, ContainerExecOptsBuilder};
2023-02-05 23:44:06 +01:00
#[test]
fn test_example_container() {
let client = connect().unwrap();
let alpine = client.container().from("alpine:3.16.2");
2023-02-05 23:44:06 +01:00
let out = alpine
.exec_opts(
ContainerExecOptsBuilder::default()
.args(vec!["cat", "/etc/alpine-release"])
.build()
.unwrap(),
)
.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
}