mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 11:22:26 +00:00
tests: Test rebooting works for block self spawn test
Being able to reboot the VM is an important aspect of the self spawning behaviour. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
e817aa6824
commit
2f58fb8307
@ -1380,8 +1380,25 @@ mod tests {
|
|||||||
|
|
||||||
thread::sleep(std::time::Duration::new(20, 0));
|
thread::sleep(std::time::Duration::new(20, 0));
|
||||||
|
|
||||||
guest.ssh_command("sudo shutdown -h now")?;
|
let reboot_count = guest
|
||||||
thread::sleep(std::time::Duration::new(5, 0));
|
.ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"")
|
||||||
|
.unwrap_or_default()
|
||||||
|
.trim()
|
||||||
|
.parse::<u32>()
|
||||||
|
.unwrap_or(1);
|
||||||
|
|
||||||
|
aver_eq!(tb, reboot_count, 0);
|
||||||
|
guest.ssh_command("sudo reboot").unwrap_or_default();
|
||||||
|
|
||||||
|
thread::sleep(std::time::Duration::new(20, 0));
|
||||||
|
let reboot_count = guest
|
||||||
|
.ssh_command("sudo journalctl | grep -c -- \"-- Reboot --\"")
|
||||||
|
.unwrap_or_default()
|
||||||
|
.trim()
|
||||||
|
.parse::<u32>()
|
||||||
|
.unwrap_or_default();
|
||||||
|
aver_eq!(tb, reboot_count, 1);
|
||||||
|
|
||||||
let _ = cloud_child.kill();
|
let _ = cloud_child.kill();
|
||||||
let _ = cloud_child.wait();
|
let _ = cloud_child.wait();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user