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

Side by Side Diff: cmd/jujud/unit_test.go

Issue 8667043: various: unify machine and unit status types (Closed)
Patch Set: various: unify machine and unit status types Created 10 years, 11 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:
View unified diff | Download patch
« no previous file with comments | « cmd/juju/status_test.go ('k') | state/api/params/params.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/agent" 6 "launchpad.net/juju-core/environs/agent"
7 "launchpad.net/juju-core/state" 7 "launchpad.net/juju-core/state"
8 "launchpad.net/juju-core/state/api/params" 8 "launchpad.net/juju-core/state/api/params"
9 "launchpad.net/juju-core/testing" 9 "launchpad.net/juju-core/testing"
10 "time" 10 "time"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 for { 93 for {
94 select { 94 select {
95 case <-timeout: 95 case <-timeout:
96 c.Fatalf("no activity detected") 96 c.Fatalf("no activity detected")
97 case <-time.After(50 * time.Millisecond): 97 case <-time.After(50 * time.Millisecond):
98 err := unit.Refresh() 98 err := unit.Refresh()
99 c.Assert(err, IsNil) 99 c.Assert(err, IsNil)
100 st, info, err := unit.Status() 100 st, info, err := unit.Status()
101 c.Assert(err, IsNil) 101 c.Assert(err, IsNil)
102 switch st { 102 switch st {
103 » » » case params.UnitPending, params.UnitInstalled: 103 » » » case params.StatusPending, params.StatusInstalled:
104 c.Logf("waiting...") 104 c.Logf("waiting...")
105 continue 105 continue
106 » » » case params.UnitStarted: 106 » » » case params.StatusStarted:
107 c.Logf("started!") 107 c.Logf("started!")
108 break waitStarted 108 break waitStarted
109 » » » case params.UnitDown: 109 » » » case params.StatusDown:
110 s.State.StartSync() 110 s.State.StartSync()
111 c.Logf("unit is still down") 111 c.Logf("unit is still down")
112 default: 112 default:
113 c.Fatalf("unexpected status %s %s", st, info) 113 c.Fatalf("unexpected status %s %s", st, info)
114 } 114 }
115 } 115 }
116 } 116 }
117 117
118 // Check no subordinates have been deployed. 118 // Check no subordinates have been deployed.
119 ctx.waitDeployed(c) 119 ctx.waitDeployed(c)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 c.Assert(err, IsNil) 160 c.Assert(err, IsNil)
161 } 161 }
162 162
163 func (s *UnitSuite) TestChangePasswordChanging(c *C) { 163 func (s *UnitSuite) TestChangePasswordChanging(c *C) {
164 unit, _, _ := s.primeAgent(c) 164 unit, _, _ := s.primeAgent(c)
165 newAgent := func() runner { 165 newAgent := func() runner {
166 return s.newAgent(c, unit) 166 return s.newAgent(c, unit)
167 } 167 }
168 s.testAgentPasswordChanging(c, unit, newAgent) 168 s.testAgentPasswordChanging(c, unit, newAgent)
169 } 169 }
OLDNEW
« no previous file with comments | « cmd/juju/status_test.go ('k') | state/api/params/params.go » ('j') | no next file with comments »

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