github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/upgrades/steps121_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package upgrades_test 5 6 import ( 7 gc "gopkg.in/check.v1" 8 9 "github.com/juju/juju/testing" 10 "github.com/juju/juju/version" 11 ) 12 13 type steps121Suite struct { 14 testing.BaseSuite 15 } 16 17 var _ = gc.Suite(&steps121Suite{}) 18 19 func (s *steps121Suite) TestStateStepsFor121(c *gc.C) { 20 expected := []string{ 21 // Environment UUID related migrations should come first as 22 // other upgrade steps may rely on them. 23 "add environment uuid to state server doc", 24 "set environment owner and server uuid", 25 // It is important to keep the order of the following three steps: 26 // 1.migrate machine instanceId, 2. Add env ID to machine docs, 3. 27 // Add env ID to instanceData docs. If the order changes, bad things 28 // will happen. 29 "migrate machine instanceId into instanceData", 30 "prepend the environment UUID to the ID of all machine docs", 31 "prepend the environment UUID to the ID of all instanceData docs", 32 "prepend the environment UUID to the ID of all containerRef docs", 33 "prepend the environment UUID to the ID of all service docs", 34 "prepend the environment UUID to the ID of all unit docs", 35 "prepend the environment UUID to the ID of all reboot docs", 36 "prepend the environment UUID to the ID of all relations docs", 37 "prepend the environment UUID to the ID of all relationscopes docs", 38 "prepend the environment UUID to the ID of all charm docs", 39 "prepend the environment UUID to the ID of all minUnit docs", 40 "prepend the environment UUID to the ID of all cleanup docs", 41 "prepend the environment UUID to the ID of all sequence docs", 42 43 // Non-environment UUID upgrade steps follow. 44 "rename the user LastConnection field to LastLogin", 45 "add all users in state as environment users", 46 "migrate charm archives into environment storage", 47 "migrate custom image metadata into environment storage", 48 "migrate tools into environment storage", 49 "migrate individual unit ports to openedPorts collection", 50 "create entries in meter status collection for existing units", 51 "migrate machine jobs into ones with JobManageNetworking based on rules", 52 } 53 assertStateSteps(c, version.MustParse("1.21.0"), expected) 54 } 55 56 func (s *steps121Suite) TestStepsFor121(c *gc.C) { 57 assertSteps(c, version.MustParse("1.21.0"), []string{}) 58 }