示例#1
0
 def test_bootstrap_source_no_bootstrap(self):
     """Ensure the config option of no-bootstrap is set to continue"""
     self.test_config.set('no-bootstrap', False)
     ceph_hooks.bootstrap_source_relation_changed()
     self.status_set.assert_called_once_with(
         'blocked', 'Cannot join the '
         'bootstrap-source relation '
         'when no-bootstrap is False')
 def test_bootstrap_source_good_path(self):
     """Tests the good path where all is setup and relations established"""
     self.test_relation.set({'monitor-secret': 'abcd',
                             'fsid': '1234'})
     ceph_hooks.bootstrap_source_relation_changed()
     self.leader_set.assert_called_with({'fsid': '1234',
                                         'monitor-secret': 'abcd'})
     self.mon_relation.assert_called_once_with()
 def test_bootstrap_source_no_bootstrap(self):
     """Ensure the config option of no-bootstrap is set to continue"""
     self.test_config.set('no-bootstrap', False)
     ceph_hooks.bootstrap_source_relation_changed()
     self.status_set.assert_called_once_with('blocked',
                                             'Cannot join the '
                                             'bootstrap-source relation '
                                             'when no-bootstrap is False')
示例#4
0
 def test_bootstrap_source_good_path(self):
     """Tests the good path where all is setup and relations established"""
     self.test_relation.set({'monitor-secret': 'abcd',
                             'fsid': '1234'})
     ceph_hooks.bootstrap_source_relation_changed()
     self.leader_set.assert_called_with({'fsid': '1234',
                                         'monitor-secret': 'abcd'})
     self.mon_relation.assert_called_once_with()
示例#5
0
 def test_bootstrap_source_relation_data_not_ready(self):
     """Ensures no bootstrapping done if relation data not present"""
     ceph_hooks.bootstrap_source_relation_changed()
     expected_calls = []
     relid = 'bootstrap-source:0'
     for unit in ('ceph/0', 'ceph/1', 'ceph/2'):
         expected_calls.append(call('monitor-secret', unit, relid))
         expected_calls.append(call('fsid', unit, relid))
     self.relation_get.has_calls(expected_calls)
     self.assertEqual(self.leader_set.call_count, 0)
     self.assertEqual(self.mon_relation.call_count, 0)
 def test_bootstrap_source_relation_data_not_ready(self):
     """Ensures no bootstrapping done if relation data not present"""
     ceph_hooks.bootstrap_source_relation_changed()
     expected_calls = []
     relid = 'bootstrap-source:0'
     for unit in ('ceph/0', 'ceph/1', 'ceph/2'):
         expected_calls.append(call('monitor-secret', unit, relid))
         expected_calls.append(call('fsid', unit, relid))
     self.relation_get.has_calls(expected_calls)
     self.assertEqual(self.leader_set.call_count, 0)
     self.assertEqual(self.mon_relation.call_count, 0)
示例#7
0
 def test_bootstrap_source_not_leader(self):
     """Ensure the processing is deferred to the leader"""
     self.is_leader.return_value = False
     ceph_hooks.bootstrap_source_relation_changed()
     self.assertEqual(self.leader_set.call_count, 0)
 def test_bootstrap_source_not_leader(self):
     """Ensure the processing is deferred to the leader"""
     self.is_leader.return_value = False
     ceph_hooks.bootstrap_source_relation_changed()
     self.assertEqual(self.leader_set.call_count, 0)