From 33cd5dfefe6dec48060ec08545ef1a5be8a0b776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 11 Nov 2019 11:28:38 +0100 Subject: [PATCH] test: also mock cfs_read_file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit needed for tests to work without a functional running pmxcfs instance. Signed-off-by: Fabian Grünbichler --- test/ReplicationTestEnv.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/ReplicationTestEnv.pm b/test/ReplicationTestEnv.pm index bc305627f..f1eea688d 100755 --- a/test/ReplicationTestEnv.pm +++ b/test/ReplicationTestEnv.pm @@ -229,6 +229,13 @@ my $mocked_cfs_lock_file = sub { return $res; }; +my $mocked_cfs_read_file = sub { + my ($filename) = @_; + + return {} if $filename eq 'datacenter.cfg'; + return PVE::Cluster::cfs_read_file($filename); +}; + my $mocked_cfs_write_file = sub { my ($filename, $cfg) = @_; @@ -267,6 +274,7 @@ sub setup { cfs_update => sub {}, cfs_lock_file => $mocked_cfs_lock_file, cfs_write_file => $mocked_cfs_write_file, + cfs_read_file => $mocked_cfs_read_file, ); $pve_inotify_module->mock('nodename' => sub { return $mocked_nodename; }); };