Merge pull request #47959 from twangboy/fix_test_service

Fix failing test when service doesn't exist
This commit is contained in:
Nicole Thomas 2018-06-06 15:05:42 -04:00 committed by GitHub
commit a67b21ef3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,11 @@ class ServiceModuleTest(ModuleCase):
# currently upstart does not have a mechanism to report if disabling a service fails if does not exist
self.assertTrue(self.run_function('service.disable', [srv_name]))
else:
self.assertFalse(self.run_function('service.disable', [srv_name]))
if salt.utils.is_windows():
disable = self.run_function('service.disable', [srv_name])
self.assertTrue('error' in disable.lower())
else:
self.assertFalse(self.run_function('service.disable', [srv_name]))
if salt.utils.is_darwin():
self.assertFalse(self.run_function('service.disabled', [srv_name]))