mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add master_opts
fixture under tests/pytests/unit
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
c1558ae7e7
commit
673143e702
1 changed files with 22 additions and 3 deletions
|
@ -8,11 +8,30 @@ 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["root_dir"] = str(tmp_path)
|
||||
opts["__role"] = "minion"
|
||||
opts["root_dir"] = str(root_dir)
|
||||
for name in ("cachedir", "pki_dir", "sock_dir", "conf_dir"):
|
||||
dirpath = tmp_path / name
|
||||
dirpath.mkdir()
|
||||
dirpath = root_dir / name
|
||||
dirpath.mkdir(parents=True)
|
||||
opts[name] = str(dirpath)
|
||||
opts["log_file"] = "logs/minion.log"
|
||||
return opts
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def master_opts(tmp_path):
|
||||
"""
|
||||
Default master configuration with relative temporary paths to not require root permissions.
|
||||
"""
|
||||
root_dir = tmp_path / "master"
|
||||
opts = salt.config.DEFAULT_MASTER_OPTS.copy()
|
||||
opts["__role"] = "master"
|
||||
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/master.log"
|
||||
return opts
|
||||
|
|
Loading…
Add table
Reference in a new issue