Merge pull request #45259 from Ch3LL/fix-mac-service-test

Fix MacOSX Service Status Check and integration test
This commit is contained in:
Nicole Thomas 2018-01-04 09:25:01 -05:00 committed by GitHub
commit 543eebf411
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -421,7 +421,7 @@ def status(name, sig=None, runas=None):
for line in output.splitlines():
if 'PID' in line:
continue
if re.search(name, line):
if re.search(name, line.split()[-1]):
if line.split()[0].isdigit():
if pids:
pids += '\n'

View file

@ -25,6 +25,8 @@ class ServiceModuleTest(ModuleCase):
elif os_family == 'Arch':
self.service_name = 'systemd-journald'
cmd_name = 'systemctl'
elif os_family == 'MacOS':
self.service_name = 'org.ntp.ntpd'
if salt.utils.which(cmd_name) is None:
self.skipTest('{0} is not installed'.format(cmd_name))