From: Fiona Ebner Date: Fri, 19 May 2023 09:49:15 +0000 (+0200) Subject: test: mock calls that can fail in a chroot environment X-Git-Url: https://git.proxmox.com/?p=qemu-server.git;a=commitdiff_plain;h=da8fc2f2ad65bdd69493cf53e6c09884584640bb test: mock calls that can fail in a chroot environment Signed-off-by: Fiona Ebner Signed-off-by: Thomas Lamprecht --- diff --git a/test/MigrationTest/Shared.pm b/test/MigrationTest/Shared.pm index 8ae6a6e..bd4d20c 100644 --- a/test/MigrationTest/Shared.pm +++ b/test/MigrationTest/Shared.pm @@ -61,6 +61,13 @@ my $mocked_cfs_read_file = sub { # mocked modules +our $cgroup_module = Test::MockModule->new("PVE::CGroup"); +$cgroup_module->mock( + cgroup_mode => sub { + return 2; + }, +); + our $cluster_module = Test::MockModule->new("PVE::Cluster"); $cluster_module->mock( cfs_read_file => $mocked_cfs_read_file, @@ -133,6 +140,12 @@ $replication_config_module->mock( cfs_read_file => $mocked_cfs_read_file, ); +our $safe_syslog_module = Test::MockModule->new("PVE::SafeSyslog"); +$safe_syslog_module->mock( + initlog => sub {}, + syslog => sub {}, +); + our $storage_module = Test::MockModule->new("PVE::Storage"); $storage_module->mock( activate_volumes => sub {