Skip to content

Commit

Permalink
Add allowance for machine identifier for recent test
Browse files Browse the repository at this point in the history
  • Loading branch information
David Murphy committed May 10, 2024
1 parent fa5c821 commit 41d7eca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/pytests/functional/utils/gitfs/test_pillar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from salt.pillar.git_pillar import GLOBAL_ONLY, PER_REMOTE_ONLY, PER_REMOTE_OVERRIDES
from salt.utils.gitfs import GitPillar, GitPython, Pygit2
from salt.utils.immutabletypes import ImmutableDict, ImmutableList
from salt.utils.platform import get_machine_identifier as _get_machine_identifier

pytestmark = [
pytest.mark.windows_whitelisted,
Expand Down Expand Up @@ -339,17 +340,24 @@ def _test_lock(opts):
p.fetch_remotes()
assert len(p.remotes) == 1
repo = p.remotes[0]
mach_id = _get_machine_identifier().get("machine_id", "no_machine_id_available")
assert repo.get_salt_working_dir() in repo._get_lock_file()
assert repo.lock() == (
[
"Set update lock for git_pillar remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git'"
(
f"Set update lock for gitfs remote "
f"'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 git_pillar remote 'https://github.com/saltstack/salt-test-pillar-gitfs.git'"
(
f"Removed update lock for gitfs remote "
f"'https://github.com/saltstack/salt-test-pillar-gitfs.git' on machine_id '{mach_id}'"
)
],
[],
)
Expand Down

0 comments on commit 41d7eca

Please sign in to comment.