[thedac, trivial] Add test_ctxt_consistent_auths
This commit is contained in:
parent
7ef334e0d7
commit
55d8adff84
|
@ -200,3 +200,27 @@ class MonContextTest(CharmTestCase):
|
|||
'use_syslog': 'false'
|
||||
}
|
||||
self.assertEqual(expect, mon_ctxt())
|
||||
|
||||
def test_ctxt_consistent_auths(self):
|
||||
self.socket.gethostname.return_value = '10.0.0.10'
|
||||
mon_ctxt = context.MonContext()
|
||||
addresses = ['10.5.4.1', '10.5.4.2', '10.5.4.3']
|
||||
auths = ['cephx', 'cephx', 'cephx']
|
||||
|
||||
def _relation_get(attr, unit, rid):
|
||||
if attr == 'ceph-public-address':
|
||||
return addresses.pop()
|
||||
elif attr == 'auth':
|
||||
return auths.pop()
|
||||
self.relation_get.side_effect = _relation_get
|
||||
self.relation_ids.return_value = ['mon:6']
|
||||
self.related_units.return_value = ['ceph/0', 'ceph/1', 'ceph/2']
|
||||
expect = {
|
||||
'auth_supported': 'cephx',
|
||||
'embedded_webserver': False,
|
||||
'hostname': '10.0.0.10',
|
||||
'mon_hosts': '10.5.4.1:6789 10.5.4.2:6789 10.5.4.3:6789',
|
||||
'old_auth': False,
|
||||
'use_syslog': 'false'
|
||||
}
|
||||
self.assertEqual(expect, mon_ctxt())
|
||||
|
|
Loading…
Reference in New Issue