mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-06 23:07:59 +00:00
test: unbreak restore_config_test
for unprivileged users (and possibly some root setups). reading from pmxcfs now results in a hard error for unprivileged users, so there might be some more of these lurking somewhere.. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
872cfcf5bc
commit
75c430cee8
@ -7,6 +7,7 @@ use lib qw(..);
|
|||||||
|
|
||||||
use Test::MockModule;
|
use Test::MockModule;
|
||||||
use Test::More;
|
use Test::More;
|
||||||
|
use Test::MockModule;
|
||||||
|
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
|
|
||||||
@ -26,6 +27,19 @@ $pve_cluster_module->mock(
|
|||||||
# NOTE update when you add/remove tests
|
# NOTE update when you add/remove tests
|
||||||
plan tests => 4;
|
plan tests => 4;
|
||||||
|
|
||||||
|
my $cfs_mock = Test::MockModule->new("PVE::Cluster");
|
||||||
|
$cfs_mock->mock(
|
||||||
|
cfs_read_file => sub {
|
||||||
|
my ($file) = @_;
|
||||||
|
|
||||||
|
if ($file eq 'datacenter.cfg') {
|
||||||
|
return {};
|
||||||
|
} else {
|
||||||
|
die "'cfs_read_file' called - missing mock?\n";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
dir_glob_foreach('./restore-config-input', '[0-9]+.conf', sub {
|
dir_glob_foreach('./restore-config-input', '[0-9]+.conf', sub {
|
||||||
my ($file) = @_;
|
my ($file) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user