mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 04:11:00 +00:00
test: fix restore config test as unprivileged user
after upgrading to bullseye, the cfs_read_file call within restore_update_config_line() results in an error: Is a directory! when done as an unprivileged user. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
8a0addab87
commit
cc1cdadbf4
@ -5,6 +5,7 @@ use warnings;
|
|||||||
|
|
||||||
use lib qw(..);
|
use lib qw(..);
|
||||||
|
|
||||||
|
use Test::MockModule;
|
||||||
use Test::More;
|
use Test::More;
|
||||||
|
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
@ -15,6 +16,13 @@ use PVE::Tools qw(dir_glob_foreach file_get_contents);
|
|||||||
my $INPUT_DIR = './restore-config-input';
|
my $INPUT_DIR = './restore-config-input';
|
||||||
my $EXPECTED_DIR = './restore-config-expected';
|
my $EXPECTED_DIR = './restore-config-expected';
|
||||||
|
|
||||||
|
my $pve_cluster_module = Test::MockModule->new('PVE::Cluster');
|
||||||
|
$pve_cluster_module->mock(
|
||||||
|
cfs_read_file => sub {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
# NOTE update when you add/remove tests
|
# NOTE update when you add/remove tests
|
||||||
plan tests => 4;
|
plan tests => 4;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user