tests: Remove unnecessary sleeps and kill on clean shutdown tests

On tests that expect a clean shutdown there is no need to try and kill
the child after wait() has returned as the process has already exited.
Further there is no need to sleep before wait() as wait will block until
the VM and VMM shutdown is complete.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-02-27 13:57:33 +00:00
parent c98949bdd3
commit 5ade9d4610

View File

@ -2398,13 +2398,10 @@ mod tests {
.ssh_command("sudo shutdown -h now")
.unwrap_or_default();
thread::sleep(std::time::Duration::new(20, 0));
// Check that the cloud-hypervisor binary actually terminated
if let Ok(status) = child.wait() {
aver_eq!(tb, status.success(), true);
}
let _ = child.kill();
let _ = child.wait();
});
Ok(())
@ -2460,7 +2457,6 @@ mod tests {
if let Ok(status) = child.wait() {
aver_eq!(tb, status.success(), true);
}
let _ = child.kill();
let _ = child.wait();
Ok(())
});