OLD | NEW |
1 package main | 1 package main |
2 | 2 |
3 import ( | 3 import ( |
4 . "launchpad.net/gocheck" | 4 . "launchpad.net/gocheck" |
5 "launchpad.net/juju-core/cmd" | 5 "launchpad.net/juju-core/cmd" |
6 "launchpad.net/juju-core/environs/dummy" | 6 "launchpad.net/juju-core/environs/dummy" |
7 "launchpad.net/juju-core/juju/testing" | 7 "launchpad.net/juju-core/juju/testing" |
8 "reflect" | 8 "reflect" |
9 "time" | 9 "time" |
10 ) | 10 ) |
(...skipping 17 matching lines...) Expand all Loading... |
28 err := ParseAgentCommand(a, []string{"nincompoops"}) | 28 err := ParseAgentCommand(a, []string{"nincompoops"}) |
29 c.Assert(err, ErrorMatches, `unrecognized args: \["nincompoops"\]`) | 29 c.Assert(err, ErrorMatches, `unrecognized args: \["nincompoops"\]`) |
30 } | 30 } |
31 | 31 |
32 func (s *ProvisioningSuite) TestRunStop(c *C) { | 32 func (s *ProvisioningSuite) TestRunStop(c *C) { |
33 op := make(chan dummy.Operation, 200) | 33 op := make(chan dummy.Operation, 200) |
34 dummy.Listen(op) | 34 dummy.Listen(op) |
35 | 35 |
36 a := &ProvisioningAgent{ | 36 a := &ProvisioningAgent{ |
37 Conf: AgentConf{ | 37 Conf: AgentConf{ |
38 » » » JujuDir: "/var/lib/juju", | 38 » » » DataDir: "/var/lib/juju", |
39 StateInfo: *s.StateInfo(c), | 39 StateInfo: *s.StateInfo(c), |
40 }, | 40 }, |
41 } | 41 } |
42 done := make(chan error) | 42 done := make(chan error) |
43 go func() { | 43 go func() { |
44 done <- a.Run(nil) | 44 done <- a.Run(nil) |
45 }() | 45 }() |
46 | 46 |
47 // Check that the provisioner is alive by doing a rudimentary check | 47 // Check that the provisioner is alive by doing a rudimentary check |
48 // that it responds to state changes. | 48 // that it responds to state changes. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return op | 97 return op |
98 } | 98 } |
99 } | 99 } |
100 c.Logf("discarding unknown event %#v", op) | 100 c.Logf("discarding unknown event %#v", op) |
101 case <-time.After(2 * time.Second): | 101 case <-time.After(2 * time.Second): |
102 c.Fatalf("time out wating for operation") | 102 c.Fatalf("time out wating for operation") |
103 } | 103 } |
104 } | 104 } |
105 panic("not reached") | 105 panic("not reached") |
106 } | 106 } |
OLD | NEW |