コード例 #1
0
func (s *serviceManagerSuite) TestDelete(c *gc.C) {
	windows.AddService(s.name, s.execPath, s.stub, svc.Status{State: svc.Running})

	err := s.mgr.Delete(s.name)
	c.Assert(err, gc.IsNil)
	exists := s.conn.Exists(s.name)
	c.Assert(exists, jc.IsFalse)
}
コード例 #2
0
func (s *serviceManagerSuite) TestStart(c *gc.C) {
	windows.AddService(s.name, s.execPath, s.stub, svc.Status{State: svc.Stopped})

	err := s.mgr.Start(s.name)
	c.Assert(err, gc.IsNil)

	running, err := s.mgr.Running(s.name)
	c.Assert(err, gc.IsNil)
	c.Assert(running, jc.IsTrue)
}