mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
test_infra, tests: Unify error message formatting
Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
@@ -147,13 +147,13 @@ impl GuestNetworkConfig {
|
|||||||
Err(e) => {
|
Err(e) => {
|
||||||
let duration = start.elapsed();
|
let duration = start.elapsed();
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"\n\n==== Start 'wait_vm_boot' (FAILED) ====\n\n\
|
"\n\n==== Start 'wait_vm_boot' (FAILED) ==== \
|
||||||
duration =\"{duration:?}, timeout = {timeout}s\"\n\
|
\n\nduration =\"{duration:?}, timeout = {timeout}s\" \
|
||||||
listen_addr=\"{listen_addr}\"\n\
|
\nlisten_addr=\"{listen_addr}\" \
|
||||||
expected_guest_addr=\"{expected_guest_addr}\"\n\
|
\nexpected_guest_addr=\"{expected_guest_addr}\" \
|
||||||
message=\"{s}\"\n\
|
\nmessage=\"{s}\" \
|
||||||
error=\"{e:?}\"\n\
|
\nerror=\"{e:?}\" \
|
||||||
\n==== End 'wait_vm_boot' outout ====\n\n"
|
\n\n==== End 'wait_vm_boot' outout ====\n\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
Err(e)
|
Err(e)
|
||||||
@@ -1346,7 +1346,7 @@ pub fn parse_iperf3_output(output: &[u8], sender: bool, bandwidth: bool) -> Resu
|
|||||||
})
|
})
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"=============== iperf3 output ===============\n\n{}\n\n===========end============\n\n",
|
"==== Start iperf3 output ===\n\n{}\n\n=== End iperf3 output ===\n\n",
|
||||||
String::from_utf8_lossy(output)
|
String::from_utf8_lossy(output)
|
||||||
);
|
);
|
||||||
Error::Iperf3Parse
|
Error::Iperf3Parse
|
||||||
@@ -1424,9 +1424,7 @@ pub fn parse_fio_output(output: &str, fio_ops: &FioOps, num_jobs: u32) -> Result
|
|||||||
total_bps
|
total_bps
|
||||||
})
|
})
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
eprintln!(
|
eprintln!("=== Start Fio output ===\n\n{output}\n\n=== End Fio output ===\n\n");
|
||||||
"=============== Fio output ===============\n\n{output}\n\n===========end============\n\n"
|
|
||||||
);
|
|
||||||
Error::FioOutputParse
|
Error::FioOutputParse
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1479,9 +1477,7 @@ pub fn parse_fio_output_iops(output: &str, fio_ops: &FioOps, num_jobs: u32) -> R
|
|||||||
total_iops
|
total_iops
|
||||||
})
|
})
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
eprintln!(
|
eprintln!("=== Start Fio output ===\n\n{output}\n\n=== End Fio output ===\n\n");
|
||||||
"=============== Fio output ===============\n\n{output}\n\n===========end============\n\n"
|
|
||||||
);
|
|
||||||
Error::FioOutputParse
|
Error::FioOutputParse
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1614,7 +1610,7 @@ pub fn parse_ethr_latency_output(output: &[u8]) -> Result<Vec<f64>, Error> {
|
|||||||
})
|
})
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"=============== ethr output ===============\n\n{}\n\n===========end============\n\n",
|
"=== Start ethr output ===\n\n{}\n\n=== End ethr output ===\n\n",
|
||||||
String::from_utf8_lossy(output)
|
String::from_utf8_lossy(output)
|
||||||
);
|
);
|
||||||
Error::EthrLogParse
|
Error::EthrLogParse
|
||||||
|
|||||||
@@ -8525,8 +8525,13 @@ mod live_migration {
|
|||||||
if !send_success {
|
if !send_success {
|
||||||
let _ = send_migration.kill();
|
let _ = send_migration.kill();
|
||||||
let output = send_migration.wait_with_output().unwrap();
|
let output = send_migration.wait_with_output().unwrap();
|
||||||
eprintln!("\n\n==== Start 'send_migration' output ====\n\n---stdout---\n{}\n\n---stderr---\n{}\n\n==== End 'send_migration' output ====\n\n",
|
eprintln!(
|
||||||
String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
|
"\n\n==== Start 'send_migration' output ==== \
|
||||||
|
\n\n---stdout---\n{}\n\n---stderr---\n{} \
|
||||||
|
\n\n==== End 'send_migration' output ====\n\n",
|
||||||
|
String::from_utf8_lossy(&output.stdout),
|
||||||
|
String::from_utf8_lossy(&output.stderr)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The 'receive-migration' command should be executed successfully within the given timeout
|
// The 'receive-migration' command should be executed successfully within the given timeout
|
||||||
@@ -8542,8 +8547,13 @@ mod live_migration {
|
|||||||
if !receive_success {
|
if !receive_success {
|
||||||
let _ = receive_migration.kill();
|
let _ = receive_migration.kill();
|
||||||
let output = receive_migration.wait_with_output().unwrap();
|
let output = receive_migration.wait_with_output().unwrap();
|
||||||
eprintln!("\n\n==== Start 'receive_migration' output ====\n\n---stdout---\n{}\n\n---stderr---\n{}\n\n==== End 'receive_migration' output ====\n\n",
|
eprintln!(
|
||||||
String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
|
"\n\n==== Start 'receive_migration' output ==== \
|
||||||
|
\n\n---stdout---\n{}\n\n---stderr---\n{} \
|
||||||
|
\n\n==== End 'receive_migration' output ====\n\n",
|
||||||
|
String::from_utf8_lossy(&output.stdout),
|
||||||
|
String::from_utf8_lossy(&output.stderr)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
send_success && receive_success
|
send_success && receive_success
|
||||||
@@ -9706,7 +9716,9 @@ mod rate_limiter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"\n\n==== check_rate_limit failed! ====\n\nmeasured={measured}, , lower_limit={lower_limit}, upper_limit={upper_limit}\n\n"
|
"\n\n==== Start 'check_rate_limit' failed ==== \
|
||||||
|
\n\nmeasured={measured}, , lower_limit={lower_limit}, upper_limit={upper_limit} \
|
||||||
|
\n\n==== End 'check_rate_limit' failed ====\n\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
false
|
false
|
||||||
|
|||||||
Reference in New Issue
Block a user