Otherwise the user running the tests may either create (and
end up being the ownderof) the system wide
/var/lock/pve-manager/* files, or the tests will fail (or
loop endlessly) if the user doesn't have access to them.
$PVE::ReplicationState::state_path = $statefile;
$PVE::ReplicationState::state_lock = ".mocked_repl_state_lock";
$PVE::Replication::pvesr_lock_path = ".mocked_pvesr_lock";
+$PVE::GuestHelpers::lockdir = ".mocked_pve-manager_lock";
+
+if (!mkdir($PVE::GuestHelpers::lockdir) && !$!{EEXIST}) {
+ # If we cannot create the guest helper lockdir we'll loop endlessly, so die
+ # if it fails.
+ die "mkdir($PVE::GuestHelpers::lockdir): $!\n";
+}
my $pve_cluster_module = Test::MockModule->new('PVE::Cluster');