mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-20 23:11:16 +00:00
tests: Check that the test binary cleanly terminated
As part of the reboot test check that the binary cleanly terminated after the subsequent shutdown. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
8f37dec498
commit
389f9e3779
13
src/main.rs
13
src/main.rs
@ -2146,6 +2146,12 @@ mod tests {
|
|||||||
.ssh_command("sudo shutdown -h now")
|
.ssh_command("sudo shutdown -h now")
|
||||||
.unwrap_or_default();
|
.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.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
});
|
});
|
||||||
@ -2208,7 +2214,12 @@ mod tests {
|
|||||||
aver_eq!(tb, reboot_count, 1);
|
aver_eq!(tb, reboot_count, 1);
|
||||||
|
|
||||||
guest.ssh_command("sudo shutdown -h now")?;
|
guest.ssh_command("sudo shutdown -h now")?;
|
||||||
thread::sleep(std::time::Duration::new(10, 0));
|
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.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user