mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-08 00:49:11 +00:00
test: mock calls that can fail in a chroot environment
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
e4263214b8
commit
da8fc2f2ad
@ -61,6 +61,13 @@ my $mocked_cfs_read_file = sub {
|
|||||||
|
|
||||||
# mocked modules
|
# 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");
|
our $cluster_module = Test::MockModule->new("PVE::Cluster");
|
||||||
$cluster_module->mock(
|
$cluster_module->mock(
|
||||||
cfs_read_file => $mocked_cfs_read_file,
|
cfs_read_file => $mocked_cfs_read_file,
|
||||||
@ -133,6 +140,12 @@ $replication_config_module->mock(
|
|||||||
cfs_read_file => $mocked_cfs_read_file,
|
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");
|
our $storage_module = Test::MockModule->new("PVE::Storage");
|
||||||
$storage_module->mock(
|
$storage_module->mock(
|
||||||
activate_volumes => sub {
|
activate_volumes => sub {
|
||||||
|
Loading…
Reference in New Issue
Block a user