def test_resumes_a_sysv_service(self, service, check_call, systemd,
service_running):
"""When process is in a stop/waiting state, service start is called."""
service_name = 'foo-service'
service.side_effect = [True]
systemd.return_value = False
service_running.return_value = False
tempdir = mkdtemp(prefix="test_resumes_a_sysv_service")
sysv_path = os.path.join(tempdir, service_name)
# Just needs to exist
with open(sysv_path, "w") as fh:
fh.write("")
self.addCleanup(rmtree, tempdir)
self.assertTrue(host.service_resume(
service_name, init_dir=tempdir, initd_dir=tempdir))
service.assert_called_with('start', service_name)
check_call.assert_called_with(["update-rc.d", service_name, "enable"])
评论列表
文章目录