func (s *BaseUpgradeCharmSuite) assertUpgraded(c *gc.C, riak *state.Service, revision int, forced bool) *charm.URL { err := riak.Refresh() c.Assert(err, jc.ErrorIsNil) ch, force, err := riak.Charm() c.Assert(err, jc.ErrorIsNil) c.Assert(ch.Revision(), gc.Equals, revision) c.Assert(force, gc.Equals, forced) return ch.URL() }
func removeServiceAndUnits(c *gc.C, service *state.Service) { // Destroy all units for the service. units, err := service.AllUnits() c.Assert(err, jc.ErrorIsNil) for _, unit := range units { err = unit.EnsureDead() c.Assert(err, jc.ErrorIsNil) err = unit.Remove() c.Assert(err, jc.ErrorIsNil) } err = service.Destroy() c.Assert(err, jc.ErrorIsNil) err = service.Refresh() c.Assert(err, jc.Satisfies, errors.IsNotFound) }