Skip to content

Commit

Permalink
Fix gitfs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Jul 31, 2023
1 parent cbcc5fb commit 9529f72
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/pytests/unit/utils/test_gitfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from time import time

import pytest

import salt.config
import salt.fileserver.gitfs
import salt.utils.gitfs
from salt.exceptions import FileserverConfigError
Expand All @@ -24,6 +24,23 @@
import pygit2


@pytest.fixture
def minion_opts(tmp_path):
"""
Default minion configuration with relative temporary paths to not require root permissions.
"""
root_dir = tmp_path / "minion"
opts = salt.config.DEFAULT_MINION_OPTS.copy()
opts["__role"] = "minion"
opts["root_dir"] = str(root_dir)
for name in ("cachedir", "pki_dir", "sock_dir", "conf_dir"):
dirpath = root_dir / name
dirpath.mkdir(parents=True)
opts[name] = str(dirpath)
opts["log_file"] = "logs/minion.log"
return opts


@pytest.mark.parametrize(
"role_name,role_class",
(
Expand Down

0 comments on commit 9529f72

Please sign in to comment.