Add test to ensure salt user is running salt-master

This commit is contained in:
Megan Wilhite 2023-04-07 08:31:43 -06:00 committed by Pedro Algarvio
parent 9d259f37d9
commit 60d790597a
3 changed files with 21 additions and 0 deletions

View 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

View file

@ -1,3 +1,4 @@
cherrypy
pytest-salt-factories==1.0.0rc17
docker
psutil

View file

@ -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