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

« back to all changes in this revision

Viewing changes to state/apiserver/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:
152
152
func (s *deployerSuite) TestSetPasswords(c *gc.C) {
153
153
        args := params.PasswordChanges{
154
154
                Changes: []params.PasswordChange{
155
 
                        {Tag: "unit-mysql-0", Password: "xxx"},
156
 
                        {Tag: "unit-mysql-1", Password: "yyy"},
157
 
                        {Tag: "unit-logging-0", Password: "zzz"},
158
 
                        {Tag: "unit-fake-42", Password: "abc"},
 
155
                        {Tag: "unit-mysql-0", Password: "xxx-12345678901234567890"},
 
156
                        {Tag: "unit-mysql-1", Password: "yyy-12345678901234567890"},
 
157
                        {Tag: "unit-logging-0", Password: "zzz-12345678901234567890"},
 
158
                        {Tag: "unit-fake-42", Password: "abc-12345678901234567890"},
159
159
                },
160
160
        }
161
161
        results, err := s.deployer.SetPasswords(args)
170
170
        })
171
171
        err = s.principal0.Refresh()
172
172
        c.Assert(err, gc.IsNil)
173
 
        changed := s.principal0.PasswordValid("xxx")
 
173
        changed := s.principal0.PasswordValid("xxx-12345678901234567890")
174
174
        c.Assert(changed, gc.Equals, true)
175
175
        err = s.subordinate0.Refresh()
176
176
        c.Assert(err, gc.IsNil)
177
 
        changed = s.subordinate0.PasswordValid("zzz")
 
177
        changed = s.subordinate0.PasswordValid("zzz-12345678901234567890")
178
178
        c.Assert(changed, gc.Equals, true)
179
179
 
180
180
        // Remove the subordinate and make sure it's detected.
187
187
 
188
188
        results, err = s.deployer.SetPasswords(params.PasswordChanges{
189
189
                Changes: []params.PasswordChange{
190
 
                        {Tag: "unit-logging-0", Password: "blah"},
 
190
                        {Tag: "unit-logging-0", Password: "blah-12345678901234567890"},
191
191
                },
192
192
        })
193
193
        c.Assert(err, gc.IsNil)