mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Enable service if disabled before running state service tests
This commit is contained in:
parent
b2431eab10
commit
f44a2fc349
@ -41,9 +41,19 @@ class ServiceTest(ModuleCase, SaltReturnAssertsMixin):
|
||||
self.stopped = ''
|
||||
self.running = '[0-9]'
|
||||
|
||||
self.pre_srv_enabled = True if self.service_name in self.run_function('service.get_enabled') else False
|
||||
self.post_srv_disable = False
|
||||
if not self.pre_srv_enabled:
|
||||
self.run_function('service.enable', name=self.service_name)
|
||||
self.post_srv_disable = True
|
||||
|
||||
if salt.utils.which(cmd_name) is None:
|
||||
self.skipTest('{0} is not installed'.format(cmd_name))
|
||||
|
||||
def tearDown(self):
|
||||
if self.post_srv_disable:
|
||||
self.run_function('service.disable', name=self.service_name)
|
||||
|
||||
def check_service_status(self, exp_return):
|
||||
'''
|
||||
helper method to check status of service
|
||||
|
Loading…
Reference in New Issue
Block a user