~rogpeppe/juju-core/438-local-instance-Addresses

« back to all changes in this revision

Viewing changes to cmd/juju/status_test.go

[r=fwereade],[bug=1234035] Fix upgrade 1.14 -> 1.15

This adds a Tools() API call to provisioner API,
similarly to the upgrader API. Common code factored
out into apiserver/common/tools.go.

SetAgentTools() renamed to SetAgentVersion() in
machine and unit state types. Also renamed a few
types in params to be shorter or better reflect
what are they about. Added DEPRECATE(v1.18) tags
to bits of the API that need cleanup.

Live tested on EC2 - after copying the tools from
/tools/releases/ to /tools/ the upgrade proceeds
and finishes successfully.

https://codereview.appspot.com/14231044/

R=fwereade, jameinel

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        "launchpad.net/juju-core/state/api/params"
24
24
        "launchpad.net/juju-core/state/presence"
25
25
        coretesting "launchpad.net/juju-core/testing"
26
 
        "launchpad.net/juju-core/tools"
27
26
        "launchpad.net/juju-core/version"
28
27
)
29
28
 
254
253
                        },
255
254
                },
256
255
 
257
 
                setTools{"0", &tools.Tools{
258
 
                        Version: version.Binary{
259
 
                                Number: version.MustParse("1.2.3"),
260
 
                                Series: "gutsy",
261
 
                                Arch:   "ppc",
262
 
                        },
263
 
                        URL:    "http://canonical.com/",
264
 
                        Size:   10,
265
 
                        SHA256: "1234",
266
 
                }},
 
256
                setTools{"0", version.MustParseBinary("1.2.3-gutsy-ppc")},
267
257
                expect{
268
258
                        "simulate the MA setting the version",
269
259
                        M{
1316
1306
 
1317
1307
type setTools struct {
1318
1308
        machineId string
1319
 
        tools     *tools.Tools
 
1309
        version   version.Binary
1320
1310
}
1321
1311
 
1322
1312
func (st setTools) step(c *gc.C, ctx *context) {
1323
1313
        m, err := ctx.st.Machine(st.machineId)
1324
1314
        c.Assert(err, gc.IsNil)
1325
 
        err = m.SetAgentTools(st.tools)
 
1315
        err = m.SetAgentVersion(st.version)
1326
1316
        c.Assert(err, gc.IsNil)
1327
1317
}
1328
1318