]> git.proxmox.com Git - pve-manager.git/commitdiff
test: mock PVE::SSHInfo module
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 11 Nov 2019 10:28:35 +0000 (11:28 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 18 Nov 2019 11:25:35 +0000 (12:25 +0100)
since it is now used for getting a cluster node's migration IP address.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
test/ReplicationTestEnv.pm

index fa1060372b43edacd8b509d9d70c981f9ae73319..bc305627fd1a956ebb428b5d4cce43208e995e85 100755 (executable)
@@ -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 {},