]> git.proxmox.com Git - qemu-server.git/commitdiff
test: mock calls that can fail in a chroot environment
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 19 May 2023 09:49:15 +0000 (11:49 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 May 2023 13:06:46 +0000 (15:06 +0200)
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
test/MigrationTest/Shared.pm

index 8ae6a6e1df3c8b5c4de56b33a7dd8266820c37c6..bd4d20c0256c67122e90d31931f495e454938e23 100644 (file)
@@ -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 {