def test_resumes_a_running_upstart_service(self, service, check_output,
systemd, service_running):
"""When the service is already running, service start isn't called."""
service_name = 'foo-service'
service.side_effect = [True]
systemd.return_value = False
service_running.return_value = True
tempdir = mkdtemp(prefix="test_resumes_an_upstart_service")
conf_path = os.path.join(tempdir, "{}.conf".format(service_name))
with open(conf_path, "w") as fh:
fh.write("")
self.addCleanup(rmtree, tempdir)
self.assertTrue(host.service_resume(service_name, init_dir=tempdir))
# Start isn't called because service is already running
self.assertFalse(service.called)
override_path = os.path.join(
tempdir, "{}.override".format(service_name))
self.assertFalse(os.path.exists(override_path))
评论列表
文章目录