test: mock PVE::SSHInfo module

since it is now used for getting a cluster node's migration IP address.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2019-11-11 11:28:35 +01:00 committed by Thomas Lamprecht
parent 3ac3653e63
commit fe57e096cc

View File

@ -83,6 +83,8 @@ if (!mkdir($PVE::GuestHelpers::lockdir) && !$!{EEXIST}) {
die "mkdir($PVE::GuestHelpers::lockdir): $!\n";
}
my $pve_sshinfo_module = Test::MockModule->new('PVE::SSHInfo');
my $pve_cluster_module = Test::MockModule->new('PVE::Cluster');
my $pve_inotify_module = Test::MockModule->new('PVE::INotify');
@ -254,9 +256,12 @@ sub setup {
$pve_lxc_config_module->mock(load_config => $mocked_lxc_load_conf);
$pve_cluster_module->mock(
$pve_sshinfo_module->mock(
get_ssh_info => $mocked_get_ssh_info,
ssh_info_to_command => $mocked_ssh_info_to_command,
);
$pve_cluster_module->mock(
get_vmlist => sub { return $mocked_vmlist->(); },
get_members => $mocked_get_members,
cfs_update => sub {},