Skip to content

Commit ecca014

Browse files
committed
fix failing unit tests.
2 parents afc8622 + 37a8800 commit ecca014

File tree

12 files changed

+41
-40
lines changed

12 files changed

+41
-40
lines changed

cmd/plugins/juju-metadata/toolsmetadata_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (s *ToolsMetadataSuite) SetUpTest(c *gc.C) {
5757
var currentVersionStrings = []string{
5858
// only these ones will make it into the JSON files.
5959
version.Current.Number.String() + "-quantal-amd64",
60-
version.Current.Number.String() + "-quantal-arm",
60+
version.Current.Number.String() + "-quantal-armhf",
6161
version.Current.Number.String() + "-quantal-i386",
6262
}
6363

constraints/constraints_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ var parseConstraintsTests = []struct {
8383
summary: "set arch i386",
8484
args: []string{"arch=i386"},
8585
}, {
86-
summary: "set arch arm",
87-
args: []string{"arch=arm"},
86+
summary: "set arch armhf",
87+
args: []string{"arch=armhf"},
8888
}, {
8989
summary: "set nonsense arch 1",
9090
args: []string{"arch=cheese"},
@@ -99,7 +99,7 @@ var parseConstraintsTests = []struct {
9999
err: `bad "arch" constraint: already set`,
100100
}, {
101101
summary: "double set arch separately",
102-
args: []string{"arch=arm", "arch="},
102+
args: []string{"arch=armhf", "arch="},
103103
err: `bad "arch" constraint: already set`,
104104
},
105105

@@ -269,7 +269,7 @@ var parseConstraintsTests = []struct {
269269
args: []string{" root-disk=8G mem=2T arch=i386 cpu-cores=4096 cpu-power=9001 container=lxc tags=foo,bar"},
270270
}, {
271271
summary: "kitchen sink separately",
272-
args: []string{"root-disk=8G", "mem=2T", "cpu-cores=4096", "cpu-power=9001", "arch=arm", "container=lxc", "tags=foo,bar"},
272+
args: []string{"root-disk=8G", "mem=2T", "cpu-cores=4096", "cpu-power=9001", "arch=armhf", "container=lxc", "tags=foo,bar"},
273273
},
274274
}
275275

container/kvm/kvm_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,14 @@ func (s *ConstraintsSuite) TestDefaults(c *gc.C) {
169169
RootDisk: 4,
170170
},
171171
}, {
172-
cons: "arch=arm",
172+
cons: "arch=armhf",
173173
expected: kvm.StartParams{
174174
Memory: kvm.DefaultMemory,
175175
CpuCores: kvm.DefaultCpu,
176176
RootDisk: kvm.DefaultDisk,
177177
},
178178
infoLog: []string{
179-
`arch constraint of "arm" being ignored as not supported`,
179+
`arch constraint of "armhf" being ignored as not supported`,
180180
},
181181
}, {
182182
cons: "container=lxc",
@@ -209,14 +209,14 @@ func (s *ConstraintsSuite) TestDefaults(c *gc.C) {
209209
`tags constraint of "foo,bar" being ignored as not supported`,
210210
},
211211
}, {
212-
cons: "mem=4G cpu-cores=4 root-disk=20G arch=arm cpu-power=100 container=lxc tags=foo,bar",
212+
cons: "mem=4G cpu-cores=4 root-disk=20G arch=armhf cpu-power=100 container=lxc tags=foo,bar",
213213
expected: kvm.StartParams{
214214
Memory: 4 * 1024,
215215
CpuCores: 4,
216216
RootDisk: 20,
217217
},
218218
infoLog: []string{
219-
`arch constraint of "arm" being ignored as not supported`,
219+
`arch constraint of "armhf" being ignored as not supported`,
220220
`container constraint of "lxc" being ignored as not supported`,
221221
`cpu-power constraint of 100 being ignored as not supported`,
222222
`tags constraint of "foo,bar" being ignored as not supported`,

environs/instances/instancetype_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ var hvm = "hvm"
2525
var instanceTypes = []InstanceType{
2626
{
2727
Name: "m1.small",
28-
Arches: []string{"amd64", "arm"},
28+
Arches: []string{"amd64", "armhf"},
2929
CpuCores: 1,
3030
CpuPower: CpuPower(100),
3131
Mem: 1740,
3232
Cost: 60,
3333
RootDisk: 8192,
3434
}, {
3535
Name: "m1.medium",
36-
Arches: []string{"amd64", "arm"},
36+
Arches: []string{"amd64", "armhf"},
3737
CpuCores: 1,
3838
CpuPower: CpuPower(200),
3939
Mem: 3840,
@@ -58,7 +58,7 @@ var instanceTypes = []InstanceType{
5858
},
5959
{
6060
Name: "t1.micro",
61-
Arches: []string{"amd64", "arm"},
61+
Arches: []string{"amd64", "armhf"},
6262
CpuCores: 1,
6363
CpuPower: CpuPower(20),
6464
Mem: 613,
@@ -67,7 +67,7 @@ var instanceTypes = []InstanceType{
6767
},
6868
{
6969
Name: "c1.medium",
70-
Arches: []string{"amd64", "arm"},
70+
Arches: []string{"amd64", "armhf"},
7171
CpuCores: 2,
7272
CpuPower: CpuPower(500),
7373
Mem: 1740,
@@ -135,9 +135,9 @@ var getInstanceTypesTest = []struct {
135135
},
136136
}, {
137137
about: "arches filtered by constraint",
138-
cons: "cpu-power=100 arch=arm",
138+
cons: "cpu-power=100 arch=armhf",
139139
expectedItypes: []string{"m1.small", "m1.medium", "c1.medium"},
140-
arches: []string{"arm"},
140+
arches: []string{"armhf"},
141141
},
142142
{
143143
about: "enough memory for mongodb if mem not specified",
@@ -165,7 +165,7 @@ var getInstanceTypesTest = []struct {
165165
about: "mem specified and match found",
166166
cons: "mem=4G arch=amd64",
167167
itypesToUse: []InstanceType{
168-
{Id: "4", Name: "it-4", Arches: []string{"arm"}, Mem: 8096},
168+
{Id: "4", Name: "it-4", Arches: []string{"armhf"}, Mem: 8096},
169169
{Id: "3", Name: "it-3", Arches: []string{"amd64"}, Mem: 4096},
170170
{Id: "2", Name: "it-2", Arches: []string{"amd64"}, Mem: 2048},
171171
{Id: "1", Name: "it-1", Arches: []string{"amd64"}, Mem: 512},
@@ -243,22 +243,22 @@ var instanceTypeMatchTests = []struct {
243243
itype string
244244
arches []string
245245
}{
246-
{"", "m1.small", []string{"amd64", "arm"}},
246+
{"", "m1.small", []string{"amd64", "armhf"}},
247247
{"", "m1.large", []string{"amd64"}},
248-
{"cpu-power=100", "m1.small", []string{"amd64", "arm"}},
248+
{"cpu-power=100", "m1.small", []string{"amd64", "armhf"}},
249249
{"arch=amd64", "m1.small", []string{"amd64"}},
250250
{"cpu-cores=3", "m1.xlarge", []string{"amd64"}},
251-
{"cpu-power=", "t1.micro", []string{"amd64", "arm"}},
252-
{"cpu-power=500", "c1.medium", []string{"amd64", "arm"}},
251+
{"cpu-power=", "t1.micro", []string{"amd64", "armhf"}},
252+
{"cpu-power=500", "c1.medium", []string{"amd64", "armhf"}},
253253
{"cpu-power=2000", "c1.xlarge", []string{"amd64"}},
254254
{"cpu-power=2001", "cc1.4xlarge", []string{"amd64"}},
255-
{"mem=2G", "m1.medium", []string{"amd64", "arm"}},
255+
{"mem=2G", "m1.medium", []string{"amd64", "armhf"}},
256256

257257
{"arch=i386", "m1.small", nil},
258258
{"cpu-power=100", "t1.micro", nil},
259259
{"cpu-power=9001", "cc2.8xlarge", nil},
260260
{"mem=1G", "t1.micro", nil},
261-
{"arch=arm", "c1.xlarge", nil},
261+
{"arch=armhf", "c1.xlarge", nil},
262262
}
263263

264264
func (s *instanceTypeSuite) TestMatch(c *gc.C) {

environs/manual/init_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (s *initialisationSuite) TestDetectionError(c *gc.C) {
4848
defer installFakeSSH(c, manual.DetectionScript, []string{scriptResponse, "non-empty-stderr"}, 0)()
4949
hc, _, err = manual.DetectSeriesAndHardwareCharacteristics("hostname")
5050
c.Assert(err, gc.IsNil)
51-
c.Assert(hc.String(), gc.Equals, "arch=arm cpu-cores=1 mem=4M")
51+
c.Assert(hc.String(), gc.Equals, "arch=armhf cpu-cores=1 mem=4M")
5252
}
5353

5454
func (s *initialisationSuite) TestDetectHardwareCharacteristics(c *gc.C) {
@@ -59,7 +59,7 @@ func (s *initialisationSuite) TestDetectHardwareCharacteristics(c *gc.C) {
5959
}{{
6060
"Single CPU socket, single core, no hyper-threading",
6161
[]string{"edgy", "armv4", "MemTotal: 4096 kB", "processor: 0"},
62-
"arch=arm cpu-cores=1 mem=4M",
62+
"arch=armhf cpu-cores=1 mem=4M",
6363
}, {
6464
"Single CPU socket, single core, hyper-threading",
6565
[]string{
@@ -71,7 +71,7 @@ func (s *initialisationSuite) TestDetectHardwareCharacteristics(c *gc.C) {
7171
"physical id: 0",
7272
"cpu cores: 1",
7373
},
74-
"arch=arm cpu-cores=1 mem=4M",
74+
"arch=armhf cpu-cores=1 mem=4M",
7575
}, {
7676
"Single CPU socket, dual-core, no hyper-threading",
7777
[]string{
@@ -83,7 +83,7 @@ func (s *initialisationSuite) TestDetectHardwareCharacteristics(c *gc.C) {
8383
"physical id: 0",
8484
"cpu cores: 2",
8585
},
86-
"arch=arm cpu-cores=2 mem=4M",
86+
"arch=armhf cpu-cores=2 mem=4M",
8787
}, {
8888
"Dual CPU socket, each single-core, hyper-threading",
8989
[]string{
@@ -101,7 +101,7 @@ func (s *initialisationSuite) TestDetectHardwareCharacteristics(c *gc.C) {
101101
"physical id: 1",
102102
"cpu cores: 1",
103103
},
104-
"arch=arm cpu-cores=2 mem=4M",
104+
"arch=armhf cpu-cores=2 mem=4M",
105105
}}
106106
for i, test := range tests {
107107
c.Logf("test %d: %s", i, test.summary)

environs/testing/tools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ var BootstrapToolsTests = []BootstrapToolsTest{
381381
Available: VAll,
382382
CliVersion: V100p64,
383383
DefaultSeries: "precise",
384-
Arch: "arm",
384+
Arch: "armhf",
385385
Err: noToolsMessage,
386386
}, {
387387
Info: "released cli: specific bad major 1",

instance/instance_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ var parseHardwareTests = []struct {
4949
summary: "set arch i386",
5050
args: []string{"arch=i386"},
5151
}, {
52-
summary: "set arch arm",
53-
args: []string{"arch=arm"},
52+
summary: "set arch armhf",
53+
args: []string{"arch=armhf"},
5454
}, {
5555
summary: "set nonsense arch 1",
5656
args: []string{"arch=cheese"},
@@ -65,7 +65,7 @@ var parseHardwareTests = []struct {
6565
err: `bad "arch" characteristic: already set`,
6666
}, {
6767
summary: "double set arch separately",
68-
args: []string{"arch=arm", "arch="},
68+
args: []string{"arch=armhf", "arch="},
6969
err: `bad "arch" characteristic: already set`,
7070
},
7171

@@ -223,7 +223,7 @@ var parseHardwareTests = []struct {
223223
args: []string{" root-disk=4G mem=2T arch=i386 cpu-cores=4096 cpu-power=9001"},
224224
}, {
225225
summary: "kitchen sink separately",
226-
args: []string{"root-disk=4G", "mem=2T", "cpu-cores=4096", "cpu-power=9001", "arch=arm"},
226+
args: []string{"root-disk=4G", "mem=2T", "cpu-cores=4096", "cpu-power=9001", "arch=armhf"},
227227
},
228228
}
229229

juju/arch/arch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
const (
1414
AMD64 = "amd64"
1515
I386 = "i386"
16-
ARM = "arm"
16+
ARM = "armhf"
1717
ARM64 = "arm64"
1818
PPC64 = "ppc64"
1919
)
@@ -35,7 +35,7 @@ var archREs = []struct {
3535
}{
3636
{regexp.MustCompile("amd64|x86_64"), AMD64},
3737
{regexp.MustCompile("i?[3-9]86"), I386},
38-
{regexp.MustCompile("armv.*"), ARM},
38+
{regexp.MustCompile("arm|armv.*"), ARM},
3939
{regexp.MustCompile("aarch64"), ARM64},
4040
{regexp.MustCompile("ppc64el|ppc64le"), PPC64},
4141
}

juju/arch/arch_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ func (s *archSuite) TestNormaliseArch(c *gc.C) {
3333
{"386", "i386"},
3434
{"i386", "i386"},
3535
{"i486", "i386"},
36-
{"armv", "arm"},
37-
{"armv7", "arm"},
36+
{"arm", "armhf"},
37+
{"armv", "armhf"},
38+
{"armv7", "armhf"},
3839
{"aarch64", "arm64"},
3940
{"ppc64el", "ppc64"},
4041
{"ppc64le", "ppc64"},

provider/joyent/environ.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (env *joyentEnviron) MetadataLookupParams(region string) (*simplestreams.Me
157157
Series: config.PreferredSeries(env.Ecfg()),
158158
Region: region,
159159
Endpoint: env.Ecfg().sdcUrl(),
160-
Architectures: []string{"amd64", "arm"},
160+
Architectures: []string{"amd64", "armhf"},
161161
}, nil
162162
}
163163

provider/joyent/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (p joyentProvider) MetadataLookupParams(region string) (*simplestreams.Meta
114114
}
115115
return &simplestreams.MetadataLookupParams{
116116
Region: region,
117-
Architectures: []string{"amd64", "arm"},
117+
Architectures: []string{"amd64", "armhf"},
118118
}, nil
119119
}
120120

state/api/params/params_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ var marshalTestCases = []struct {
5858
Life: params.Dying,
5959
OwnerTag: "test-owner",
6060
MinUnits: 42,
61-
Constraints: constraints.MustParse("arch=arm mem=1024M"),
61+
Constraints: constraints.MustParse("arch=armhf mem=1024M"),
6262
Config: charm.Settings{
6363
"hello": "goodbye",
6464
"foo": false,
6565
},
6666
},
6767
},
68-
json: `["service","change",{"CharmURL": "cs:quantal/name","Name":"Benji","Exposed":true,"Life":"dying","OwnerTag":"test-owner","MinUnits":42,"Constraints":{"arch":"arm", "mem": 1024},"Config": {"hello":"goodbye","foo":false}}]`,
68+
json: `["service","change",{"CharmURL": "cs:quantal/name","Name":"Benji","Exposed":true,"Life":"dying","OwnerTag":"test-owner","MinUnits":42,"Constraints":{"arch":"armhf", "mem": 1024},"Config": {"hello":"goodbye","foo":false}}]`,
6969
}, {
7070
about: "UnitInfo Delta",
7171
value: params.Delta{

0 commit comments

Comments
 (0)