forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
/
steps_25_test.go
45 lines (35 loc) · 1.47 KB
/
steps_25_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2018 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package upgrades_test
import (
jc "github.com/juju/testing/checkers"
"github.com/juju/version/v2"
gc "gopkg.in/check.v1"
"github.com/juju/juju/testing"
"github.com/juju/juju/upgrades"
)
var v25 = version.MustParse("2.5.0")
type steps25Suite struct {
testing.BaseSuite
}
var _ = gc.Suite(&steps25Suite{})
func (s *steps25Suite) TestMigrateMachineIdField(c *gc.C) {
step := findStateStep(c, v25, `migrate storage records to use "hostid" field`)
// Logic for step itself is tested in state package.
c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.DatabaseMaster})
}
func (s *steps25Suite) TestMigrateLegacyLeases(c *gc.C) {
step := findStateStep(c, v25, `migrate legacy leases into raft`)
// Logic for step itself is tested in state package.
c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.Controller})
}
func (s *steps25Suite) TestMigrateAddModelPermissions(c *gc.C) {
step := findStateStep(c, v25, `migrate add-model permissions`)
// Logic for step itself is tested in state package.
c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.DatabaseMaster})
}
func (s *steps25Suite) TestSetEnableDiskUUIDOnVsphere(c *gc.C) {
step := findStateStep(c, v25, `set enable-disk-uuid (if on vsphere)`)
// Logic for step itself is tested in state package.
c.Assert(step.Targets(), jc.DeepEquals, []upgrades.Target{upgrades.DatabaseMaster})
}