test_infra: Allow to create a GuestCommand with input binary path

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2022-04-12 12:52:31 -07:00 committed by Bo Chen
parent 4ca066f077
commit f81220ae2d

View File

@ -1190,12 +1190,12 @@ pub struct GuestCommand<'a> {
impl<'a> GuestCommand<'a> {
pub fn new(guest: &'a Guest) -> Self {
Self::new_with_binary_name(guest, "cloud-hypervisor")
Self::new_with_binary_path(guest, &clh_command("cloud-hypervisor"))
}
pub fn new_with_binary_name(guest: &'a Guest, binary_name: &str) -> Self {
pub fn new_with_binary_path(guest: &'a Guest, binary_path: &str) -> Self {
Self {
command: Command::new(clh_command(binary_name)),
command: Command::new(binary_path),
guest,
capture_output: false,
print_cmd: true,