func (s *rebootSuite) TestContainerCatchesParentFlag(c *gc.C) { wrk, err := reboot.NewReboot(s.ctRebootState, s.AgentConfigForTag(c, s.ct.Tag()), s.lock) c.Assert(err, jc.ErrorIsNil) err = s.rebootState.RequestReboot() c.Assert(err, jc.ErrorIsNil) c.Assert(wrk.Wait(), gc.Equals, worker.ErrShutdownMachine) }
func (s *rebootSuite) TestWorkerCatchesRebootEvent(c *gc.C) { wrk, err := reboot.NewReboot(s.rebootState, s.AgentConfigForTag(c, s.machine.Tag()), s.lock) c.Assert(err, jc.ErrorIsNil) err = s.rebootState.RequestReboot() c.Assert(err, jc.ErrorIsNil) c.Assert(wrk.Wait(), gc.Equals, worker.ErrRebootMachine) }
func (s *rebootSuite) TestCleanupIsDoneOnBoot(c *gc.C) { s.lock.Lock(reboot.RebootMessage) wrk, err := reboot.NewReboot(s.rebootState, s.AgentConfigForTag(c, s.machine.Tag()), s.lock) c.Assert(err, jc.ErrorIsNil) wrk.Kill() c.Assert(wrk.Wait(), gc.IsNil) c.Assert(s.lock.IsLocked(), jc.IsFalse) }
func (s *rebootSuite) TestStartStop(c *gc.C) { worker, err := reboot.NewReboot(s.rebootState, s.AgentConfigForTag(c, s.machine.Tag()), s.lock) c.Assert(err, jc.ErrorIsNil) worker.Kill() c.Assert(worker.Wait(), gc.IsNil) }