func removeAllUnits(c *C, s *state.Service) { us, err := s.AllUnits() c.Assert(err, IsNil) for _, u := range us { err = u.EnsureDead() c.Assert(err, IsNil) err = s.RemoveUnit(u) c.Assert(err, IsNil) } }