OLD | NEW |
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 "path/filepath" | 7 "path/filepath" |
8 "reflect" | 8 "reflect" |
9 "time" | 9 "time" |
10 | 10 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 m1, err := s.State.Machine(id1) | 293 m1, err := s.State.Machine(id1) |
294 c.Assert(err, gc.IsNil) | 294 c.Assert(err, gc.IsNil) |
295 w := m1.Watch() | 295 w := m1.Watch() |
296 defer w.Stop() | 296 defer w.Stop() |
297 for _ = range w.Changes() { | 297 for _ = range w.Changes() { |
298 err = m1.Refresh() | 298 err = m1.Refresh() |
299 c.Assert(err, gc.IsNil) | 299 c.Assert(err, gc.IsNil) |
300 if _, err := m1.InstanceId(); err == nil { | 300 if _, err := m1.InstanceId(); err == nil { |
301 break | 301 break |
302 } else { | 302 } else { |
303 » » » c.Check(err, gc.FitsTypeOf, (*state.NotProvisionedError)
(nil)) | 303 » » » c.Check(err, jc.Satisfies, state.IsNotProvisionedError) |
304 } | 304 } |
305 } | 305 } |
306 err = units[0].OpenPort("tcp", 999) | 306 err = units[0].OpenPort("tcp", 999) |
307 c.Assert(err, gc.IsNil) | 307 c.Assert(err, gc.IsNil) |
308 | 308 |
309 c.Check(opRecvTimeout(c, s.State, op, dummy.OpOpenPorts{}), gc.NotNil) | 309 c.Check(opRecvTimeout(c, s.State, op, dummy.OpOpenPorts{}), gc.NotNil) |
310 | 310 |
311 err = a.Stop() | 311 err = a.Stop() |
312 c.Assert(err, gc.IsNil) | 312 c.Assert(err, gc.IsNil) |
313 | 313 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 case <-time.After(15 * time.Second): | 478 case <-time.After(15 * time.Second): |
479 c.Fatalf("time out wating for operation") | 479 c.Fatalf("time out wating for operation") |
480 } | 480 } |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
484 func (s *MachineSuite) TestOpenAPIState(c *gc.C) { | 484 func (s *MachineSuite) TestOpenAPIState(c *gc.C) { |
485 m, _, _ := s.primeAgent(c, state.JobHostUnits) | 485 m, _, _ := s.primeAgent(c, state.JobHostUnits) |
486 s.testOpenAPIState(c, m, s.newAgent(c, m), initialMachinePassword) | 486 s.testOpenAPIState(c, m, s.newAgent(c, m), initialMachinePassword) |
487 } | 487 } |
OLD | NEW |