mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add test to ensure salt user is running salt-master
This commit is contained in:
parent
9d259f37d9
commit
60d790597a
3 changed files with 21 additions and 0 deletions
19
pkg/tests/integration/test_salt_user.py
Normal file
19
pkg/tests/integration/test_salt_user.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import psutil
|
||||
import pytest
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.skip_on_windows,
|
||||
]
|
||||
|
||||
|
||||
def test_salt_user_master(salt_master):
|
||||
"""
|
||||
Test the correct user is running the Salt Master
|
||||
"""
|
||||
user = "salt"
|
||||
match = False
|
||||
for _proc in psutil.process_iter(["username", "cmdline", "name"]):
|
||||
if any([x for x in _proc.info["cmdline"] if "salt-master" in x]):
|
||||
assert _proc.info["username"] == user
|
||||
match = True
|
||||
assert match
|
|
@ -1,3 +1,4 @@
|
|||
cherrypy
|
||||
pytest-salt-factories==1.0.0rc17
|
||||
docker
|
||||
psutil
|
||||
|
|
|
@ -89,6 +89,7 @@ portend==3.1.0
|
|||
psutil==5.9.4
|
||||
# via
|
||||
# -r requirements/base.txt
|
||||
# -r requirements/static/ci/pkgtests.in
|
||||
# pytest-salt-factories
|
||||
# pytest-shell-utilities
|
||||
# pytest-system-statistics
|
||||
|
|
Loading…
Add table
Reference in a new issue