mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
tests: Fix beta clippy issues
error: this boolean expression can be simplified --> tests/integration.rs:3755:33 | 3755 | assert!(!(empty > 5), "No login on pty"); | ^^^^^^^^^^^^ help: try: `empty <= 5` | = note: `-D clippy::nonminimal-bool` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool error: unneeded late initalization --> tests/integration.rs:7619:13 | 7619 | let mut success; | ^^^^^^^^^^^^^^^^ | = note: `-D clippy::needless-late-init` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init help: declare `success` here | 7621 | let mut success = if let Some(status) = send_migration | +++++++++++++++++ help: remove the assignments from the branches | 7625 ~ status.success() 7626 | } else { 7627 ~ false | help: add a semicolon after the `if` expression | 7628 | }; | + error: unneeded late initalization --> tests/integration.rs:7838:13 | 7838 | let mut success; | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init help: declare `success` here | 7840 | let mut success = if let Some(status) = send_migration | +++++++++++++++++ help: remove the assignments from the branches | 7844 ~ status.success() 7845 | } else { 7846 ~ false | help: add a semicolon after the `if` expression | 7847 | }; | + Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
ade8d71264
commit
b204f43aae
@ -3752,7 +3752,7 @@ mod parallel {
|
||||
}
|
||||
Err(mpsc::TryRecvError::Empty) => {
|
||||
empty += 1;
|
||||
assert!(!(empty > 5), "No login on pty");
|
||||
assert!(empty <= 5, "No login on pty");
|
||||
}
|
||||
_ => panic!("No login on pty"),
|
||||
}
|
||||
@ -7616,31 +7616,33 @@ mod live_migration {
|
||||
.spawn()
|
||||
.unwrap();
|
||||
|
||||
let mut success;
|
||||
// The 'send-migration' command should be executed successfully within the given timeout
|
||||
if let Some(status) = send_migration
|
||||
let success = if let Some(status) = send_migration
|
||||
.wait_timeout(std::time::Duration::from_secs(30))
|
||||
.unwrap()
|
||||
{
|
||||
success = status.success();
|
||||
status.success()
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
false
|
||||
};
|
||||
|
||||
if !success {
|
||||
let _ = send_migration.kill();
|
||||
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",
|
||||
String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
|
||||
// The 'receive-migration' command should be executed successfully within the given timeout
|
||||
if let Some(status) = receive_migration
|
||||
let success = if let Some(status) = receive_migration
|
||||
.wait_timeout(std::time::Duration::from_secs(30))
|
||||
.unwrap()
|
||||
{
|
||||
success = status.success();
|
||||
status.success()
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
false
|
||||
};
|
||||
|
||||
if !success {
|
||||
let _ = receive_migration.kill();
|
||||
let output = receive_migration.wait_with_output().unwrap();
|
||||
@ -7835,31 +7837,33 @@ mod live_migration {
|
||||
.spawn()
|
||||
.unwrap();
|
||||
|
||||
let mut success;
|
||||
// The 'send-migration' command should be executed successfully within the given timeout
|
||||
if let Some(status) = send_migration
|
||||
let success = if let Some(status) = send_migration
|
||||
.wait_timeout(std::time::Duration::from_secs(30))
|
||||
.unwrap()
|
||||
{
|
||||
success = status.success();
|
||||
status.success()
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
false
|
||||
};
|
||||
|
||||
if !success {
|
||||
let _ = send_migration.kill();
|
||||
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",
|
||||
String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
|
||||
// The 'receive-migration' command should be executed successfully within the given timeout
|
||||
if let Some(status) = receive_migration
|
||||
let success = if let Some(status) = receive_migration
|
||||
.wait_timeout(std::time::Duration::from_secs(30))
|
||||
.unwrap()
|
||||
{
|
||||
success = status.success();
|
||||
status.success()
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
false
|
||||
};
|
||||
|
||||
if !success {
|
||||
let _ = receive_migration.kill();
|
||||
let output = receive_migration.wait_with_output().unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user