~ubuntu-branches/ubuntu/trusty/juju-core/trusty

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/juju/testing/instance.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-03-24 16:05:44 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20140324160544-g8lsfufby18d5fj4
Tags: 1.17.6-0ubuntu1
* New upstream point release, including fixes for:
  - br0 not bought up by cloud-init with MAAS provider (LP: #1271144).
  - ppc64el enablement for juju/lxc (LP: #1273769).
  - juju userdata should not restart networking (LP: #1248283).
  - error detecting hardware characteristics (LP: #1276909).
  - juju instances not including the default security group (LP: #1129720).
  - juju bootstrap does not honor https_proxy (LP: #1240260).
* d/control,rules: Drop BD on bash-completion, install bash-completion
  direct from upstream source code.
* d/rules: Set HOME prior to generating man pages.
* d/control: Drop alternative dependency on mongodb-server; juju now only
  works on trusty with juju-mongodb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
) (
86
86
        instance.Instance, *instance.HardwareCharacteristics, error,
87
87
) {
 
88
        return StartInstanceWithConstraintsAndNetworks(env, machineId, cons, environs.Networks{})
 
89
}
 
90
 
 
91
// AssertStartInstanceWithNetworks is a test helper function that starts an
 
92
// instance with the given networks, and a plausible but invalid
 
93
// configuration, and returns the result of Environ.StartInstance.
 
94
func AssertStartInstanceWithNetworks(
 
95
        c *gc.C, env environs.Environ, machineId string, cons constraints.Value, nets environs.Networks,
 
96
) (
 
97
        instance.Instance, *instance.HardwareCharacteristics,
 
98
) {
 
99
        inst, hc, err := StartInstanceWithConstraintsAndNetworks(env, machineId, cons, nets)
 
100
        c.Assert(err, gc.IsNil)
 
101
        return inst, hc
 
102
}
 
103
 
 
104
// StartInstanceWithNetworks is a test helper function that starts an instance
 
105
// with the given networks, and a plausible but invalid configuration, and
 
106
// returns the result of Environ.StartInstance.
 
107
func StartInstanceWithConstraintsAndNetworks(
 
108
        env environs.Environ, machineId string, cons constraints.Value,
 
109
        nets environs.Networks,
 
110
) (
 
111
        instance.Instance, *instance.HardwareCharacteristics, error,
 
112
) {
88
113
        series := env.Config().DefaultSeries()
89
114
        agentVersion, ok := env.Config().AgentVersion()
90
115
        if !ok {
98
123
        stateInfo := FakeStateInfo(machineId)
99
124
        apiInfo := FakeAPIInfo(machineId)
100
125
        machineConfig := environs.NewMachineConfig(machineId, machineNonce, stateInfo, apiInfo)
101
 
        return env.StartInstance(cons, possibleTools, machineConfig)
 
126
        return env.StartInstance(environs.StartInstanceParams{
 
127
                Constraints:   cons,
 
128
                Networks:      nets,
 
129
                Tools:         possibleTools,
 
130
                MachineConfig: machineConfig,
 
131
        })
102
132
}