[pve-devel] [PATCH v2 7/12] test: mock existing files

Daniel Herzig d.herzig at proxmox.com
Mon Jan 13 09:56:03 CET 2025


Let all files checked by file_exists appear as existing if the path
does not contain the string 'I_DO_NOT_EXIST'.

Signed-off-by: Daniel Herzig <d.herzig at proxmox.com>
---
 test/run_config2command_tests.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/run_config2command_tests.pl b/test/run_config2command_tests.pl
index cfd7309b..71b00e9a 100755
--- a/test/run_config2command_tests.pl
+++ b/test/run_config2command_tests.pl
@@ -209,6 +209,10 @@ $qemu_server_module->mock(
     cleanup_pci_devices => {
 	# do nothing
     },
+    file_exists => sub {
+	my $file_path = shift;
+	return 1 if !($file_path =~ m|I_DO_NOT_EXIST|);
+    },
 );
 
 my $qemu_server_config;
-- 
2.39.5




More information about the pve-devel mailing list