Signed-off-by: Fabian Grünbichler <f.gruenbich...@proxmox.com> --- src/test/run_setup_tests.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/src/test/run_setup_tests.pl b/src/test/run_setup_tests.pl index 678ff0f..bb66c01 100755 --- a/src/test/run_setup_tests.pl +++ b/src/test/run_setup_tests.pl @@ -2,6 +2,9 @@ use strict; use warnings; + +use Test::MockModule; + use PVE::Tools qw(run_command); use lib qw(..); @@ -100,6 +103,21 @@ sub run_test { print "TEST $testdir => OK\n"; } +my $cluster_module = Test::MockModule->new("PVE::Cluster"); +$cluster_module->mock( + cfs_read_file => sub { + my ($filename) = @_; + return {} if $filename eq 'datacenter.cfg'; + die "illegal access to pmxcfs in test!\n"; + }, + cfs_write_file => sub { + die "illegal access to pmxcfs in test!\n"; + }, + cfs_lock_file => sub { + die "illegal access to pmxcfs in test!\n"; + }, +); + if (scalar(@ARGV)) { foreach my $testdir (@ARGV) { -- 2.20.1 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel