mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-24 00:41:16 +00:00
tests: Add rebooting to the CPU hotplug test
Check that the added vCPUs are still there after a reboot. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
f98b16f308
commit
fcf92d86b5
25
src/main.rs
25
src/main.rs
@ -3259,6 +3259,31 @@ mod tests {
|
|||||||
u32::from(desired_vcpus)
|
u32::from(desired_vcpus)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
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(30, 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);
|
||||||
|
|
||||||
|
aver_eq!(
|
||||||
|
tb,
|
||||||
|
guest.get_cpu_count().unwrap_or_default(),
|
||||||
|
u32::from(desired_vcpus)
|
||||||
|
);
|
||||||
|
|
||||||
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(10, 0));
|
||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
|
Loading…
Reference in New Issue
Block a user