mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add service.status integration test
This commit is contained in:
parent
c849f350ba
commit
7911b4b3eb
1 changed files with 41 additions and 0 deletions
41
tests/integration/modules/test_service.py
Normal file
41
tests/integration/modules/test_service.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import Salt Testing libs
|
||||
from tests.support.case import ModuleCase
|
||||
from tests.support.unit import skipIf
|
||||
from tests.support.helpers import destructiveTest
|
||||
|
||||
# Import Salt libs
|
||||
import salt.utils
|
||||
|
||||
SERVICE_NAME = 'cronie'
|
||||
|
||||
|
||||
@destructiveTest
|
||||
@skipIf(salt.utils.which('crond') is None, 'crond not installed')
|
||||
class ServiceModuleTest(ModuleCase):
|
||||
'''
|
||||
Module testing the service module
|
||||
'''
|
||||
def test_service_status_running(self):
|
||||
'''
|
||||
test service.status execution module
|
||||
when service is running
|
||||
'''
|
||||
start_service = self.run_function('service.start', [SERVICE_NAME])
|
||||
|
||||
check_service = self.run_function('service.status', [SERVICE_NAME])
|
||||
self.assertTrue(check_service)
|
||||
|
||||
def test_service_status_dead(self):
|
||||
'''
|
||||
test service.status execution module
|
||||
when service is dead
|
||||
'''
|
||||
stop_service = self.run_function('service.stop', [SERVICE_NAME])
|
||||
|
||||
check_service = self.run_function('service.status', [SERVICE_NAME])
|
||||
self.assertFalse(check_service)
|
Loading…
Add table
Reference in a new issue