From 563556eade299f8ce01c828bd509a4bc7e2026fc Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 1 Feb 2024 16:52:44 -0700 Subject: [PATCH] Updated gitfs tests for machine identifier --- tests/pytests/functional/utils/gitfs/test_gitfs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/pytests/functional/utils/gitfs/test_gitfs.py b/tests/pytests/functional/utils/gitfs/test_gitfs.py index 30a5f147faa..36c93797978 100644 --- a/tests/pytests/functional/utils/gitfs/test_gitfs.py +++ b/tests/pytests/functional/utils/gitfs/test_gitfs.py @@ -2,6 +2,7 @@ import os.path import pytest +import salt.utils.platform from salt.fileserver.gitfs import PER_REMOTE_ONLY, PER_REMOTE_OVERRIDES from salt.utils.gitfs import GitFS, GitPython, Pygit2 from salt.utils.immutabletypes import ImmutableDict, ImmutableList @@ -248,17 +249,18 @@ def _test_lock(opts): g.fetch_remotes() assert len(g.remotes) == 1 repo = g.remotes[0] + mach_id = salt.utils.platform.get_machine_identifier() assert repo.get_salt_working_dir() in repo._get_lock_file() assert repo.lock() == ( [ - "Set update lock for gitfs remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git'" + f"Set update lock for gitfs remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git' on machine_id '{mach_id}'" ], [], ) assert os.path.isfile(repo._get_lock_file()) assert repo.clear_lock() == ( [ - "Removed update lock for gitfs remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git'" + "Removed update lock for gitfs remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git' on machine_id '{mach_id}'" ], [], )