From cc1cdadbf461b0c89c865664c33199f8a33caa1b Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Mon, 31 May 2021 16:27:10 +0200 Subject: [PATCH] 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 --- test/run_qemu_restore_config_tests.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/run_qemu_restore_config_tests.pl b/test/run_qemu_restore_config_tests.pl index e5d9f2ab..d8c0f375 100755 --- a/test/run_qemu_restore_config_tests.pl +++ b/test/run_qemu_restore_config_tests.pl @@ -5,6 +5,7 @@ use warnings; use lib qw(..); +use Test::MockModule; use Test::More; use File::Basename; @@ -15,6 +16,13 @@ use PVE::Tools qw(dir_glob_foreach file_get_contents); my $INPUT_DIR = './restore-config-input'; 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 plan tests => 4;