[pve-devel] [PATCH manager] fix tests in 'vzdump_new_test.pl'

Dominik Csapak d.csapak at proxmox.com
Fri Jan 28 09:36:47 CET 2022


commmit
a55cfb53 ("close #3476: vzdump: add job-init hook")

introduces a 'cfs_update' in VZDump->new(), which overwrites our
carefully prepared storage/vm config which can break the tests

to prevent this, mock 'cfs_update' to do nothing, since we never
want to load the 'real' configs during tests anyway

fixes commit a55cfb5359f86adc2d3981cab032bbf8a0411931

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 test/vzdump_new_test.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/vzdump_new_test.pl b/test/vzdump_new_test.pl
index 23676239..8cd73075 100755
--- a/test/vzdump_new_test.pl
+++ b/test/vzdump_new_test.pl
@@ -61,6 +61,10 @@ $pve_cluster_module->mock(
 	die "unexpected filename '$filename'\n" if $filename ne 'storage.cfg';
 	return $storage_config;
     },
+    # never update during the tests
+    cfs_update => sub {
+	return;
+    },
 );
 
 my $pve_tools_module = Test::MockModule->new('PVE::Tools');
-- 
2.30.2





More information about the pve-devel mailing list