From 91549ddd7188189d4abdb799f10a1b0111df55f1 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 17 Dec 2019 11:31:35 +0000 Subject: [PATCH] tests: Add integration test for CPU unplug Enhance the CPU hotplug test to also unplug the CPUs. Signed-off-by: Rob Bradford --- src/main.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.rs b/src/main.rs index e410fa3c1..3df2f9bc9 100755 --- a/src/main.rs +++ b/src/main.rs @@ -4336,6 +4336,22 @@ mod tests { 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")?; thread::sleep(std::time::Duration::new(10, 0)); let _ = child.kill();