Skip to content

Commit 9529f72

Browse files
committed
Fix gitfs tests
1 parent cbcc5fb commit 9529f72

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/pytests/unit/utils/test_gitfs.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from time import time
44

55
import pytest
6-
6+
import salt.config
77
import salt.fileserver.gitfs
88
import salt.utils.gitfs
99
from salt.exceptions import FileserverConfigError
@@ -24,6 +24,23 @@
2424
import pygit2
2525

2626

27+
@pytest.fixture
28+
def minion_opts(tmp_path):
29+
"""
30+
Default minion configuration with relative temporary paths to not require root permissions.
31+
"""
32+
root_dir = tmp_path / "minion"
33+
opts = salt.config.DEFAULT_MINION_OPTS.copy()
34+
opts["__role"] = "minion"
35+
opts["root_dir"] = str(root_dir)
36+
for name in ("cachedir", "pki_dir", "sock_dir", "conf_dir"):
37+
dirpath = root_dir / name
38+
dirpath.mkdir(parents=True)
39+
opts[name] = str(dirpath)
40+
opts["log_file"] = "logs/minion.log"
41+
return opts
42+
43+
2744
@pytest.mark.parametrize(
2845
"role_name,role_class",
2946
(

0 commit comments

Comments
 (0)