mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Formula tests for vim and sudoers
This commit is contained in:
parent
fc58fa4d9d
commit
94f233cefa
2 changed files with 52 additions and 0 deletions
26
tests/pytests/functional/formulas/test_sudoers.py
Normal file
26
tests/pytests/functional/formulas/test_sudoers.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
"""
|
||||
Tests using sudoers formula
|
||||
"""
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def _formula(saltstack_formula):
|
||||
with saltstack_formula(name="sudoers-formula", tag="0.25.0") as formula:
|
||||
yield formula
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def modules(loaders, _formula):
|
||||
loaders.opts["file_roots"]["base"].append(
|
||||
str(_formula.state_tree_path / f"{_formula.name}-{_formula.tag}")
|
||||
)
|
||||
return loaders.modules
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows
|
||||
@pytest.mark.destructive_test
|
||||
def test_sudoers_formula(modules):
|
||||
ret = modules.state.sls("sudoers")
|
||||
for staterun in ret:
|
||||
assert staterun.result
|
26
tests/pytests/functional/formulas/test_vim.py
Normal file
26
tests/pytests/functional/formulas/test_vim.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
"""
|
||||
Tests using vim formula
|
||||
"""
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def _formula(saltstack_formula):
|
||||
with saltstack_formula(name="vim-formula", tag="0.15.5") as formula:
|
||||
yield formula
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def modules(loaders, _formula):
|
||||
loaders.opts["file_roots"]["base"].append(
|
||||
str(_formula.state_tree_path / f"{_formula.name}-{_formula.tag}")
|
||||
)
|
||||
return loaders.modules
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows
|
||||
@pytest.mark.destructive_test
|
||||
def test_vim_formula(modules):
|
||||
ret = modules.state.sls("vim")
|
||||
for staterun in ret:
|
||||
assert staterun.result
|
Loading…
Add table
Reference in a new issue