2023-02-19 15:24:37 +01:00
|
|
|
use dagger_sdk::{connect, ContainerExecOpts};
|
2023-02-05 23:44:06 +01:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_example_container() {
|
|
|
|
let client = connect().unwrap();
|
|
|
|
|
2023-02-17 12:33:16 +01:00
|
|
|
let alpine = client.container(None).from("alpine:3.16.2".into());
|
2023-02-05 23:44:06 +01:00
|
|
|
|
|
|
|
let out = alpine
|
2023-02-17 12:33:16 +01:00
|
|
|
.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-19 15:18:25 +01:00
|
|
|
.stdout()
|
|
|
|
.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
|
|
|
}
|