Beispiel #1
0
func (s *blockSuite) TestUpgradeBlocks(c *gc.C) {
	err := s.State.UpdateEnvironConfig(map[string]interface{}{
		"block-destroy-environment": true,
		"block-remove-object":       true,
		"block-all-changes":         true,
	}, nil, nil)
	c.Assert(err, jc.ErrorIsNil)

	err = upgrades.MoveBlocksFromEnvironToState(s.ctx)

	c.Assert(err, jc.ErrorIsNil)
	s.ensureBlocksUpdated(c, []string{
		state.ChangeBlock.String(),
		state.DestroyBlock.String(),
		state.RemoveBlock.String(),
	})
	s.ensureBlocksRemovedFromEnvConfig(c)
}
Beispiel #2
0
func (s *blockSuite) TestUpdateBlocksNone(c *gc.C) {
	err := upgrades.MoveBlocksFromEnvironToState(s.ctx)
	c.Assert(err, jc.ErrorIsNil)
	s.ensureBlocksUpdated(c, nil)
	s.ensureBlocksRemovedFromEnvConfig(c)
}