2017-11-22 18:11:39 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
# Import Python libs
|
|
|
|
from __future__ import absolute_import
|
|
|
|
import random
|
|
|
|
|
|
|
|
# Import Salt Testing libs
|
|
|
|
from tests.support.case import ModuleCase
|
|
|
|
from tests.support.unit import skipIf
|
|
|
|
|
|
|
|
# Import Salt libs
|
2018-01-12 17:27:08 +00:00
|
|
|
import salt.utils.platform
|
2017-11-22 18:11:39 +00:00
|
|
|
|
2017-11-22 21:41:59 +00:00
|
|
|
|
2017-11-22 18:11:39 +00:00
|
|
|
class StatusModuleTest(ModuleCase):
|
|
|
|
'''
|
|
|
|
Test the status module
|
|
|
|
'''
|
2018-01-12 17:27:08 +00:00
|
|
|
@skipIf(salt.utils.platform.is_windows(), 'minion is windows')
|
2017-11-22 18:11:39 +00:00
|
|
|
def test_status_pid(self):
|
|
|
|
'''
|
|
|
|
status.pid
|
|
|
|
'''
|
|
|
|
status_pid = self.run_function('status.pid', ['salt'])
|
|
|
|
grab_pids = status_pid.split()[:10]
|
|
|
|
random_pid = random.choice(grab_pids)
|
|
|
|
grep_salt = self.run_function('cmd.run', ['ps aux | grep salt'])
|
|
|
|
self.assertIn(random_pid, grep_salt)
|