mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-21 19:02:30 +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));
|
||||
|
||||
guest.ssh_command("sudo shutdown -h now")?;
|
||||
thread::sleep(std::time::Duration::new(5, 0));
|
||||
let reboot_count = guest
|
||||
.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.wait();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user