Ejemplo n.º 1
0
 def test_identity_changed_no_leader(self, mock_log):
     self.is_elected_leader.return_value = False
     hooks.identity_changed(relation_id='identity-service:0',
                            remote_unit='unit/0')
     self.assertFalse(self.add_service_to_keystone.called)
     self.log.assert_called_with(
         'Deferring identity_changed() to service leader.')
 def test_identity_changed_no_leader(self, mock_log):
     self.is_elected_leader.return_value = False
     hooks.identity_changed(
         relation_id='identity-service:0',
         remote_unit='unit/0')
     self.assertFalse(self.add_service_to_keystone.called)
     self.log.assert_called_with(
         'Deferring identity_changed() to service leader.')
Ejemplo n.º 3
0
 def test_identity_changed_leader(self, mock_send_notifications,
                                  mock_hashlib, mock_ensure_ssl_cert_master,
                                  mock_log):
     self.is_db_initialised.return_value = True
     self.is_db_ready.return_value = True
     mock_ensure_ssl_cert_master.return_value = False
     hooks.identity_changed(
         relation_id='identity-service:0',
         remote_unit='unit/0')
     self.add_service_to_keystone.assert_called_with(
         'identity-service:0',
         'unit/0')
 def test_identity_changed_leader_no_neutron(self, mock_send_notifications,
                                             mock_hashlib,
                                             mock_ensure_ssl_cert_master,
                                             mock_log,
                                             mock_is_db_initialised):
     mock_is_db_initialised.return_value = True
     self.is_db_ready.return_value = True
     self.is_service_present.return_value = False
     mock_ensure_ssl_cert_master.return_value = False
     hooks.identity_changed(relation_id='identity-service:0',
                            remote_unit='unit/0')
     self.assertFalse(self.delete_service_entry.called)
Ejemplo n.º 5
0
 def test_identity_changed_leader_no_neutron(self, mock_send_notifications,
                                             mock_hashlib,
                                             mock_ensure_ssl_cert_master,
                                             mock_log,
                                             mock_is_db_initialised):
     mock_is_db_initialised.return_value = True
     self.is_db_ready.return_value = True
     self.is_service_present.return_value = False
     mock_ensure_ssl_cert_master.return_value = False
     hooks.identity_changed(
         relation_id='identity-service:0',
         remote_unit='unit/0')
     self.assertFalse(self.delete_service_entry.called)
Ejemplo n.º 6
0
 def test_identity_changed_leader_no_neutron(self, mock_send_notifications,
                                             mock_log,
                                             mock_is_db_initialised):
     self.expect_ha.return_value = False
     mock_is_db_initialised.return_value = True
     self.is_db_ready.return_value = True
     self.is_service_present.return_value = False
     self.relation_get.return_value = {
         'public_url': 'http://dummy.local',
         'admin_url': 'http://dummy.local',
         'internal_url': 'http://dummy.local',
     }
     hooks.identity_changed(relation_id='identity-service:0',
                            remote_unit='unit/0')
     self.assertFalse(self.delete_service_entry.called)
Ejemplo n.º 7
0
 def test_identity_changed_leader(self, mock_send_notifications, mock_log,
                                  mock_is_db_initialised):
     self.expect_ha.return_value = False
     mock_is_db_initialised.return_value = True
     self.is_db_ready.return_value = True
     self.is_service_present.return_value = True
     self.relation_get.return_value = {
         'public_url': 'http://dummy.local',
         'admin_url': 'http://dummy.local',
         'internal_url': 'http://dummy.local',
     }
     hooks.identity_changed(relation_id='identity-service:0',
                            remote_unit='unit/0')
     self.add_service_to_keystone.assert_called_with(
         'identity-service:0', 'unit/0')
     self.delete_service_entry.assert_called_with('quantum', 'network')
 def test_identity_changed_leader_no_neutron(self, mock_send_notifications,
                                             mock_log,
                                             mock_is_db_initialised):
     self.expect_ha.return_value = False
     mock_is_db_initialised.return_value = True
     self.is_db_ready.return_value = True
     self.is_service_present.return_value = False
     self.relation_get.return_value = {
         'public_url': 'http://dummy.local',
         'admin_url': 'http://dummy.local',
         'internal_url': 'http://dummy.local',
     }
     hooks.identity_changed(
         relation_id='identity-service:0',
         remote_unit='unit/0')
     self.assertFalse(self.delete_service_entry.called)
 def test_identity_changed_leader(self, mock_send_notifications,
                                  mock_log, mock_is_db_initialised):
     self.expect_ha.return_value = False
     mock_is_db_initialised.return_value = True
     self.is_db_ready.return_value = True
     self.is_service_present.return_value = True
     self.relation_get.return_value = {
         'public_url': 'http://dummy.local',
         'admin_url': 'http://dummy.local',
         'internal_url': 'http://dummy.local',
     }
     hooks.identity_changed(
         relation_id='identity-service:0',
         remote_unit='unit/0')
     self.add_service_to_keystone.assert_called_with(
         'identity-service:0',
         'unit/0')
     self.delete_service_entry.assert_called_with(
         'quantum',
         'network')