Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3909)

Delta Between Two Patch Sets: cmd/jujud/machine_test.go

Issue 10447045: Add machine instance metadata to state (Closed)
Left Patch Set: Created 11 years, 9 months ago
Right Patch Set: Add machine instance metadata to state Created 11 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package main 4 package main
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 . "launchpad.net/gocheck" 8 . "launchpad.net/gocheck"
9 "launchpad.net/juju-core/charm" 9 "launchpad.net/juju-core/charm"
10 "launchpad.net/juju-core/cmd" 10 "launchpad.net/juju-core/cmd"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Wait for the instance id to show up in the state. 251 // Wait for the instance id to show up in the state.
252 id1, err := units[0].AssignedMachineId() 252 id1, err := units[0].AssignedMachineId()
253 c.Assert(err, IsNil) 253 c.Assert(err, IsNil)
254 m1, err := s.State.Machine(id1) 254 m1, err := s.State.Machine(id1)
255 c.Assert(err, IsNil) 255 c.Assert(err, IsNil)
256 w := m1.Watch() 256 w := m1.Watch()
257 defer w.Stop() 257 defer w.Stop()
258 for _ = range w.Changes() { 258 for _ = range w.Changes() {
259 err = m1.Refresh() 259 err = m1.Refresh()
260 c.Assert(err, IsNil) 260 c.Assert(err, IsNil)
261 » » if _, ok := m1.InstanceId(); ok { 261 » » if _, err := m1.InstanceId(); err == nil {
262 break 262 break
263 } else {
264 c.Check(err, FitsTypeOf, (*state.NotProvisionedError)(ni l))
263 } 265 }
264 } 266 }
265 err = units[0].OpenPort("tcp", 999) 267 err = units[0].OpenPort("tcp", 999)
266 c.Assert(err, IsNil) 268 c.Assert(err, IsNil)
267 269
268 c.Check(opRecvTimeout(c, s.State, op, dummy.OpOpenPorts{}), NotNil) 270 c.Check(opRecvTimeout(c, s.State, op, dummy.OpOpenPorts{}), NotNil)
269 271
270 err = a.Stop() 272 err = a.Stop()
271 c.Assert(err, IsNil) 273 c.Assert(err, IsNil)
272 274
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 c.Fatalf("time out wating for operation") 393 c.Fatalf("time out wating for operation")
392 } 394 }
393 } 395 }
394 panic("not reached") 396 panic("not reached")
395 } 397 }
396 398
397 func (s *MachineSuite) TestOpenAPIState(c *C) { 399 func (s *MachineSuite) TestOpenAPIState(c *C) {
398 m, _, _ := s.primeAgent(c, state.JobHostUnits) 400 m, _, _ := s.primeAgent(c, state.JobHostUnits)
399 s.testOpenAPIState(c, m, s.newAgent(c, m)) 401 s.testOpenAPIState(c, m, s.newAgent(c, m))
400 } 402 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b