~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/environs/instances/instancetype_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
        arches         []string
125
125
}{
126
126
        {
127
 
                about: "cpu-cores",
128
 
                cons:  "cpu-cores=2",
 
127
                about: "cores",
 
128
                cons:  "cores=2",
129
129
                expectedItypes: []string{
130
130
                        "c1.medium", "m1.large", "m1.xlarge", "c1.xlarge", "cc1.4xlarge",
131
131
                        "cc2.8xlarge",
154
154
        },
155
155
        {
156
156
                about: "enough memory for mongodb if mem not specified",
157
 
                cons:  "cpu-cores=4",
 
157
                cons:  "cores=4",
158
158
                itypesToUse: []InstanceType{
159
159
                        {Id: "5", Name: "it-5", Arches: []string{"amd64"}, Mem: 1024, CpuCores: 2},
160
160
                        {Id: "4", Name: "it-4", Arches: []string{"amd64"}, Mem: 2048, CpuCores: 4},
198
198
        },
199
199
        {
200
200
                about: "largest mem available matching other constraints if mem not specified",
201
 
                cons:  "cpu-cores=4",
 
201
                cons:  "cores=4",
202
202
                itypesToUse: []InstanceType{
203
203
                        {Id: "3", Name: "it-3", Arches: []string{"amd64"}, Mem: 1024, CpuCores: 2},
204
204
                        {Id: "2", Name: "it-2", Arches: []string{"amd64"}, Mem: 256, CpuCores: 4},
208
208
        },
209
209
        {
210
210
                about: "largest mem available matching other constraints if mem not specified, cost is tie breaker",
211
 
                cons:  "cpu-cores=4",
 
211
                cons:  "cores=4",
212
212
                itypesToUse: []InstanceType{
213
213
                        {Id: "4", Name: "it-4", Arches: []string{"amd64"}, Mem: 1024, CpuCores: 2},
214
214
                        {Id: "3", Name: "it-3", Arches: []string{"amd64"}, Mem: 256, CpuCores: 4},
261
261
        _, err = MatchingInstanceTypes(instanceTypes, "test", constraints.MustParse("arch=i386 mem=8G"))
262
262
        c.Check(err, gc.ErrorMatches, `no instance types in test matching constraints "arch=i386 mem=8192M"`)
263
263
 
264
 
        _, err = MatchingInstanceTypes(instanceTypes, "test", constraints.MustParse("cpu-cores=9000"))
265
 
        c.Check(err, gc.ErrorMatches, `no instance types in test matching constraints "cpu-cores=9000"`)
 
264
        _, err = MatchingInstanceTypes(instanceTypes, "test", constraints.MustParse("cores=9000"))
 
265
        c.Check(err, gc.ErrorMatches, `no instance types in test matching constraints "cores=9000"`)
266
266
 
267
267
        _, err = MatchingInstanceTypes(instanceTypes, "test", constraints.MustParse("mem=90000M"))
268
268
        c.Check(err, gc.ErrorMatches, `no instance types in test matching constraints "mem=90000M"`)
280
280
        {"", "m1.large", []string{"amd64"}},
281
281
        {"cpu-power=100", "m1.small", []string{"amd64", "armhf"}},
282
282
        {"arch=amd64", "m1.small", []string{"amd64"}},
283
 
        {"cpu-cores=3", "m1.xlarge", []string{"amd64"}},
 
283
        {"cores=3", "m1.xlarge", []string{"amd64"}},
284
284
        {"cpu-power=", "t1.micro", []string{"amd64", "armhf"}},
285
285
        {"cpu-power=500", "c1.medium", []string{"amd64", "armhf"}},
286
286
        {"cpu-power=2000", "c1.xlarge", []string{"amd64"}},