[pve-devel] [PATCH manager 07/12] test: also mock cfs_read_file
Fabian Grünbichler
f.gruenbichler at proxmox.com
Wed Nov 6 13:37:11 CET 2019
needed for tests to work without a functional running pmxcfs instance.
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
test/ReplicationTestEnv.pm | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/test/ReplicationTestEnv.pm b/test/ReplicationTestEnv.pm
index bc305627..f1eea688 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; });
};
--
2.20.1
More information about the pve-devel
mailing list