Exclude image preparation from client startup deadline
This commit is contained in:
parent
8334fd379f
commit
55eed08db7
1 changed files with 106 additions and 22 deletions
|
|
@ -6,7 +6,8 @@ use std::os::unix::ffi::OsStringExt;
|
|||
use std::path::PathBuf;
|
||||
|
||||
use lazaret_client::{
|
||||
BootstrapAcquisition, ClientBackend, ClientCommand, ClientError, DomainStatus, run,
|
||||
BootstrapAcquisition, ClientBackend, ClientCommand, ClientError, DEFAULT_STARTUP_TIMEOUT,
|
||||
DomainStatus, run,
|
||||
};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
|
|
@ -75,6 +76,7 @@ fn command() -> ClientCommand {
|
|||
profile: "agent".into(),
|
||||
workspace: PathBuf::from("/workspace"),
|
||||
configuration: None,
|
||||
startup_timeout: DEFAULT_STARTUP_TIMEOUT,
|
||||
argv: vec![b"sh".to_vec(), b"-c".to_vec(), b"exit 0".to_vec()],
|
||||
}
|
||||
}
|
||||
|
|
@ -243,6 +245,7 @@ fn command_line_accepts_profile_entry_and_preserves_explicit_command_bytes() {
|
|||
assert_eq!(parsed.profile, "agent");
|
||||
assert_eq!(parsed.workspace, PathBuf::from("/current"));
|
||||
assert_eq!(parsed.configuration, None);
|
||||
assert_eq!(parsed.startup_timeout, DEFAULT_STARTUP_TIMEOUT);
|
||||
assert_eq!(parsed.argv, [b"/bin/bash".to_vec()]);
|
||||
|
||||
let parsed = lazaret_client::cli::parse(
|
||||
|
|
@ -263,6 +266,8 @@ fn command_line_accepts_profile_entry_and_preserves_explicit_command_bytes() {
|
|||
"/project",
|
||||
"--config",
|
||||
"/host/config.toml",
|
||||
"--startup-timeout-seconds",
|
||||
"180",
|
||||
"--",
|
||||
"tool",
|
||||
"argument",
|
||||
|
|
@ -280,6 +285,7 @@ fn command_line_accepts_profile_entry_and_preserves_explicit_command_bytes() {
|
|||
parsed.configuration,
|
||||
Some(PathBuf::from("/host/config.toml"))
|
||||
);
|
||||
assert_eq!(parsed.startup_timeout.as_secs(), 180);
|
||||
assert_eq!(parsed.argv, [b"tool".to_vec(), b"argument".to_vec()]);
|
||||
|
||||
assert!(
|
||||
|
|
@ -336,6 +342,7 @@ fn public_help_explains_commands_and_options() {
|
|||
&[
|
||||
"Agent profile to use",
|
||||
"Project directory to share",
|
||||
"Maximum time to wait for Domain publication",
|
||||
"default `/bin/bash`",
|
||||
],
|
||||
),
|
||||
|
|
@ -374,6 +381,13 @@ fn clap_rejects_missing_profile_and_ambiguous_reset_scope() {
|
|||
for arguments in [
|
||||
vec!["run", "--", "tool"],
|
||||
vec!["state", "reset", "--profile", "agent"],
|
||||
vec![
|
||||
"run",
|
||||
"--profile",
|
||||
"agent",
|
||||
"--startup-timeout-seconds",
|
||||
"0",
|
||||
],
|
||||
vec![
|
||||
"state",
|
||||
"reset",
|
||||
|
|
|
|||
Loading…
Reference in a new issue