Пример #1
0
func (sm startMissingMachine) step(c *C, ctx *context) {
	m, err := ctx.st.Machine(sm.machineId)
	c.Assert(err, IsNil)
	cons, err := m.Constraints()
	c.Assert(err, IsNil)
	_, hc := testing.StartInstanceWithConstraints(c, ctx.conn.Environ, m.Id(), cons)
	err = m.SetProvisioned("i-missing", "fake_nonce", hc)
	c.Assert(err, IsNil)
}
Пример #2
0
func (s *localServerSuite) TestStartInstanceHardwareCharacteristics(c *C) {
	err := environs.Bootstrap(s.Env, constraints.Value{})
	c.Assert(err, IsNil)
	_, hc := testing.StartInstanceWithConstraints(c, s.Env, "100", constraints.MustParse("mem=1024"))
	c.Check(*hc.Arch, Equals, "amd64")
	c.Check(*hc.Mem, Equals, uint64(2048))
	c.Check(*hc.CpuCores, Equals, uint64(1))
	c.Assert(hc.CpuPower, IsNil)
}
Пример #3
0
func (sam startAliveMachine) step(c *C, ctx *context) {
	m, err := ctx.st.Machine(sam.machineId)
	c.Assert(err, IsNil)
	pinger, err := m.SetAgentAlive()
	c.Assert(err, IsNil)
	ctx.st.StartSync()
	err = m.WaitAgentAlive(coretesting.LongWait)
	c.Assert(err, IsNil)
	agentAlive, err := m.AgentAlive()
	c.Assert(err, IsNil)
	c.Assert(agentAlive, Equals, true)
	cons, err := m.Constraints()
	c.Assert(err, IsNil)
	inst, hc := testing.StartInstanceWithConstraints(c, ctx.conn.Environ, m.Id(), cons)
	err = m.SetProvisioned(inst.Id(), "fake_nonce", hc)
	c.Assert(err, IsNil)
	ctx.pingers[m.Id()] = pinger
}