2023-02-19 17:21:40 +01:00
|
|
|
use dagger_sdk::{connect, ContainerExecOptsBuilder};
|
2023-02-05 23:44:06 +01:00
|
|
|
|
2023-02-19 21:37:54 +01:00
|
|
|
#[tokio::test]
|
|
|
|
async fn test_example_container() {
|
2023-02-20 10:10:42 +01:00
|
|
|
let client = connect().await.unwrap();
|
2023-02-05 23:44:06 +01:00
|
|
|
|
2023-02-19 17:43:12 +01:00
|
|
|
let alpine = client.container().from("alpine:3.16.2");
|
2023-02-05 23:44:06 +01:00
|
|
|
|
|
|
|
let out = alpine
|
2023-02-19 17:49:22 +01:00
|
|
|
.exec_opts(
|
2023-02-19 17:21:40 +01:00
|
|
|
ContainerExecOptsBuilder::default()
|
|
|
|
.args(vec!["cat", "/etc/alpine-release"])
|
|
|
|
.build()
|
|
|
|
.unwrap(),
|
2023-02-19 17:49:22 +01:00
|
|
|
)
|
2023-02-19 15:18:25 +01:00
|
|
|
.stdout()
|
2023-02-19 21:37:54 +01:00
|
|
|
.await
|
2023-02-19 15:18:25 +01:00
|
|
|
.unwrap();
|
2023-02-05 23:44:06 +01:00
|
|
|
|
2023-02-17 12:33:16 +01:00
|
|
|
assert_eq!(out, "3.16.2\n".to_string())
|
2023-02-05 23:44:06 +01:00
|
|
|
}
|