mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-24 05:25:22 +00:00
tests: Add integration test for CPU unplug
Enhance the CPU hotplug test to also unplug the CPUs. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
a6878accd5
commit
91549ddd71
16
src/main.rs
16
src/main.rs
@ -4336,6 +4336,22 @@ mod tests {
|
|||||||
u32::from(desired_vcpus)
|
u32::from(desired_vcpus)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Resize the VM
|
||||||
|
let desired_vcpus = 2;
|
||||||
|
let http_body = guest.api_resize_body(desired_vcpus);
|
||||||
|
curl_command(
|
||||||
|
&api_socket,
|
||||||
|
"PUT",
|
||||||
|
"http://localhost/api/v1/vm.resize",
|
||||||
|
Some(&http_body),
|
||||||
|
);
|
||||||
|
thread::sleep(std::time::Duration::new(10, 0));
|
||||||
|
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…
x
Reference in New Issue
Block a user