tests: Print full commandline for better debugging

This patch prints the complete commandline when launching
cloud-hypervisor. It also prints the details of the `ssh` command if
the command is failing.

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2020-10-14 10:22:15 -07:00 committed by Rob Bradford
parent 5867a1af4a
commit e869d2f1bc

View File

@ -532,6 +532,7 @@ mod tests {
cmd.status().expect("Failed to launch ch-remote").success()
}
#[derive(Debug)]
struct PasswordAuth {
username: String,
password: String,
@ -574,6 +575,16 @@ mod tests {
Err(e) => {
counter += 1;
if counter >= retries {
eprintln!(
"\n\n==== Start ssh command output (FAILED) ====\n\n\
command=\"{}\"\n\
auth=\"{:#?}\"\n\
ip=\"{}\"\n\
output=\"{}\"\n\
\n==== End ssh command outout ====\n\n",
command, auth, ip, s
);
return Err(e);
}
}
@ -1004,6 +1015,13 @@ mod tests {
}
fn spawn(&mut self) -> io::Result<Child> {
println!(
"\n\n==== Start cloud-hypervisor command-line ====\n\n\
{:?}\n\
\n==== End cloud-hypervisor command-line ====\n\n",
self.command
);
if self.capture_output {
let child = self
.command