tests: tests_api_create_boot: Use ch-remote for creating and booting vm

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-07-01 12:05:29 +01:00 committed by Sebastien Boeuf
parent 46bbe0e612
commit 67bfd4e234

View File

@ -4042,15 +4042,17 @@ mod parallel {
DIRECT_KERNEL_BOOT_CMDLINE,
);
curl_command(
let temp_config_path = guest.tmp_dir.as_path().join("config");
std::fs::write(&temp_config_path, http_body).unwrap();
remote_command(
&api_socket,
"PUT",
"http://localhost/api/v1/vm.create",
Some(&http_body),
"create",
Some(temp_config_path.as_os_str().to_str().unwrap()),
);
// Then boot it
curl_command(&api_socket, "PUT", "http://localhost/api/v1/vm.boot", None);
remote_command(&api_socket, "boot", None);
thread::sleep(std::time::Duration::new(20, 0));
let r = std::panic::catch_unwind(|| {