refactor: setup mocks for provisioner test

This commit is contained in:
2025-02-28 16:32:19 +00:00
parent e84e6afd54
commit 7ab64a94f0
6 changed files with 181 additions and 49 deletions

View File

@ -11,6 +11,7 @@ pub trait VmHostClient {
}
#[cfg(not(test))]
pub fn get_host_client(host: &VmHost, cfg: &ProvisionerConfig) -> Result<ProxmoxClient> {
Ok(match (host.kind.clone(), &cfg) {
(VmHostKind::Proxmox, ProvisionerConfig::Proxmox { qemu, ssh, .. }) => {
@ -20,3 +21,8 @@ pub fn get_host_client(host: &VmHost, cfg: &ProvisionerConfig) -> Result<Proxmox
_ => bail!("Unsupported host type"),
})
}
#[cfg(test)]
pub fn get_host_client(host: &VmHost, cfg: &ProvisionerConfig) -> Result<ProxmoxClient> {
todo!()
}