[pve-devel] [PATCH qemu-server v5 02/16] test: avoid duplicate mock module in restore config test

Fiona Ebner f.ebner at proxmox.com
Mon Jan 27 12:29:09 CET 2025


The duplication is there, because two independet fixes for a test
failure where applied, namely commits:
75c430ce ("test: unbreak restore_config_test")
cc1cdadb ("test: fix restore config test as unprivileged user")

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 test/run_qemu_restore_config_tests.pl | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/test/run_qemu_restore_config_tests.pl b/test/run_qemu_restore_config_tests.pl
index 1e1e8072..1566ddf3 100755
--- a/test/run_qemu_restore_config_tests.pl
+++ b/test/run_qemu_restore_config_tests.pl
@@ -7,7 +7,6 @@ use lib qw(..);
 
 use Test::MockModule;
 use Test::More;
-use Test::MockModule;
 
 use File::Basename;
 
@@ -17,18 +16,11 @@ 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;
 
-my $cfs_mock = Test::MockModule->new("PVE::Cluster");
-$cfs_mock->mock(
+my $pve_cluster_module = Test::MockModule->new("PVE::Cluster");
+$pve_cluster_module->mock(
     cfs_read_file => sub {
 	my ($file) = @_;
 
-- 
2.39.5





More information about the pve-devel mailing list