5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00

cfg2cmd: mock SPICE/VNC port allocation methods

to make them independent of environment, else other running VMs or
quickly sequential test runs may result in false negative test
results, as the port differed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-09-21 13:41:06 +02:00
parent bae64b0ec6
commit ff9e7dc1bb

View File

@ -131,6 +131,21 @@ $qemu_server_config->mock(
},
);
my $pve_common_tools;
$pve_common_tools = Test::MockModule->new('PVE::Tools');
$pve_common_tools->mock(
next_vnc_port => sub {
my ($family, $address) = @_;
return '5900';
},
next_spice_port => sub {
my ($family, $address) = @_;
return '61000';
},
);
sub diff($$) {
my ($a, $b) = @_;
return if $a eq $b;