~fwereade/juju-core/unit-remove-depart-scopes

« back to all changes in this revision

Viewing changes to state/api/deployer/deployer_test.go

  • Committer: William Reade
  • Date: 2013-11-07 17:30:38 UTC
  • mfrom: (2032.1.6 juju-core)
  • Revision ID: fwereade@gmail.com-20131107173038-d0a72q96dujotc0z
merge parent

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
        // Change something other than the lifecycle and make sure it's
116
116
        // not detected.
117
117
        err = s.subordinate.SetPassword("foo")
 
118
        c.Assert(err, gc.ErrorMatches, "password is only 3 bytes long, and is not a valid Agent password")
 
119
        wc.AssertNoChange()
 
120
 
 
121
        err = s.subordinate.SetPassword("foo-12345678901234567890")
118
122
        c.Assert(err, gc.IsNil)
119
123
        wc.AssertNoChange()
120
124
 
212
216
        c.Assert(err, gc.IsNil)
213
217
 
214
218
        // Change the principal's password and verify.
215
 
        err = unit.SetPassword("foobar")
 
219
        err = unit.SetPassword("foobar-12345678901234567890")
216
220
        c.Assert(err, gc.IsNil)
217
221
        err = s.principal.Refresh()
218
222
        c.Assert(err, gc.IsNil)
219
 
        c.Assert(s.principal.PasswordValid("foobar"), gc.Equals, true)
 
223
        c.Assert(s.principal.PasswordValid("foobar-12345678901234567890"), gc.Equals, true)
220
224
 
221
225
        // Then the subordinate.
222
226
        unit, err = s.st.Unit(s.subordinate.Tag())
223
227
        c.Assert(err, gc.IsNil)
224
 
        err = unit.SetPassword("phony")
 
228
        err = unit.SetPassword("phony-12345678901234567890")
225
229
        c.Assert(err, gc.IsNil)
226
230
        err = s.subordinate.Refresh()
227
231
        c.Assert(err, gc.IsNil)
228
 
        c.Assert(s.subordinate.PasswordValid("phony"), gc.Equals, true)
 
232
        c.Assert(s.subordinate.PasswordValid("phony-12345678901234567890"), gc.Equals, true)
229
233
}
230
234
 
231
235
func (s *deployerSuite) TestStateAddresses(c *gc.C) {