Exemple #1
0
    def test_compute_joined_neutron(self, auth_config, _util_config,
                                    _canonical_url):
        _util_config.return_value = None
        self.is_relation_made.return_value = False
        self.network_manager.return_value = 'neutron'
        self.is_leader = True
        self.keystone_ca_cert_b64.return_value = 'foocert64'
        self.unit_get.return_value = 'nova-cc-host1'
        self.serial_console_settings.return_value = {
            'enable_serial_console': 'false',
            'serial_console_base_url': 'ws://controller:6803',
        }
        _canonical_url.return_value = 'http://nova-cc-host1'
        auth_config.return_value = FAKE_KS_AUTH_CFG
        hooks.compute_joined()

        self.relation_set.assert_called_with(
            relation_id=None,
            ca_cert='foocert64',
            region='RegionOne',
            volume_service='cinder',
            ec2_host='nova-cc-host1',
            network_manager='neutron',
            enable_serial_console='false',
            serial_console_base_url='ws://controller:6803',
            **FAKE_KS_AUTH_CFG)
Exemple #2
0
    def test_compute_joined_neutron_api_rel(self, auth_config, napi,
                                            _util_config, _canonical_url):
        def mock_NeutronAPIContext():
            return {
                'neutron_plugin': 'bob',
                'neutron_security_groups': 'yes',
                'neutron_url': 'http://nova-cc-host1:9696',
            }

        _util_config.return_value = None
        napi.return_value = mock_NeutronAPIContext
        self.is_relation_made.return_value = True
        self.network_manager.return_value = 'neutron'
        self.is_elected_leader = True
        self.keystone_ca_cert_b64.return_value = 'foocert64'
        self.unit_get.return_value = 'nova-cc-host1'
        _canonical_url.return_value = 'http://nova-cc-host1'
        auth_config.return_value = FAKE_KS_AUTH_CFG
        hooks.compute_joined()
        self.relation_set.assert_called_with(
            relation_id=None,
            quantum_url='http://nova-cc-host1:9696',
            ca_cert='foocert64',
            quantum_port=9696,
            quantum_host='nova-cc-host1',
            quantum_security_groups='yes',
            region='RegionOne',
            volume_service='cinder',
            ec2_host='nova-cc-host1',
            quantum_plugin='bob',
            network_manager='neutron',
            **FAKE_KS_AUTH_CFG)
 def test_compute_joined_neutron_api_rel(self, auth_config, napi,
                                         _util_config, _canonical_url):
     def mock_NeutronAPIContext():
         return {
             'neutron_plugin': 'bob',
             'neutron_security_groups': 'yes',
             'neutron_url': 'http://nova-cc-host1:9696',
         }
     _util_config.return_value = None
     napi.return_value = mock_NeutronAPIContext
     self.is_relation_made.return_value = True
     self.network_manager.return_value = 'neutron'
     self.is_elected_leader = True
     self.keystone_ca_cert_b64.return_value = 'foocert64'
     self.unit_get.return_value = 'nova-cc-host1'
     _canonical_url.return_value = 'http://nova-cc-host1'
     self.api_port.return_value = '9696'
     self.neutron_plugin.return_value = 'nvp'
     auth_config.return_value = FAKE_KS_AUTH_CFG
     hooks.compute_joined()
     self.relation_set.assert_called_with(
         relation_id=None,
         quantum_url='http://nova-cc-host1:9696',
         ca_cert='foocert64',
         quantum_port=9696,
         quantum_host='nova-cc-host1',
         quantum_security_groups='yes',
         region='RegionOne',
         volume_service='cinder',
         ec2_host='nova-cc-host1',
         quantum_plugin='bob',
         network_manager='neutron', **FAKE_KS_AUTH_CFG)
    def test_compute_joined_neutron(self, auth_config, _util_config,
                                    _canonical_url):
        _util_config.return_value = None
        self.is_relation_made.return_value = False
        self.network_manager.return_value = 'neutron'
        self.is_elected_leader = True
        self.keystone_ca_cert_b64.return_value = 'foocert64'
        self.volume_service.return_value = 'cinder'
        self.unit_get.return_value = 'nova-cc-host1'
        _canonical_url.return_value = 'http://nova-cc-host1'
        self.api_port.return_value = '9696'
        self.neutron_plugin.return_value = 'nvp'
        auth_config.return_value = FAKE_KS_AUTH_CFG
        hooks.compute_joined()

        self.relation_set.assert_called_with(
            relation_id=None,
            quantum_url='http://nova-cc-host1:9696',
            ca_cert='foocert64',
            quantum_port=9696,
            quantum_host='nova-cc-host1',
            quantum_security_groups='no',
            region='RegionOne',
            volume_service='cinder',
            ec2_host='nova-cc-host1',
            quantum_plugin='nvp',
            network_manager='neutron',
            **FAKE_KS_AUTH_CFG)
    def test_compute_joined_neutron(self, auth_config, _util_config,
                                    _canonical_url):
        _util_config.return_value = None
        self.is_relation_made.return_value = False
        self.network_manager.return_value = 'neutron'
        self.is_elected_leader = True
        self.keystone_ca_cert_b64.return_value = 'foocert64'
        self.unit_get.return_value = 'nova-cc-host1'
        _canonical_url.return_value = 'http://nova-cc-host1'
        auth_config.return_value = FAKE_KS_AUTH_CFG
        hooks.compute_joined()

        self.relation_set.assert_called_with(
            relation_id=None,
            ca_cert='foocert64',
            region='RegionOne',
            volume_service='cinder',
            ec2_host='nova-cc-host1',
            network_manager='neutron', **FAKE_KS_AUTH_CFG)
    def test_compute_joined_neutron(self, auth_config):
        self.network_manager.return_value = 'neutron'
        self.eligible_leader = True
        self.keystone_ca_cert_b64.return_value = 'foocert64'
        self.volume_service.return_value = 'cinder'
        self.unit_get.return_value = 'nova-cc-host1'
        self.canonical_url.return_value = 'http://nova-cc-host1'
        self.api_port.return_value = '9696'
        self.neutron_plugin.return_value = 'nvp'
        auth_config.return_value = FAKE_KS_AUTH_CFG
        hooks.compute_joined()

        self.relation_set.assert_called_with(
            relation_id=None,
            quantum_url='http://nova-cc-host1:9696',
            ca_cert='foocert64',
            quantum_security_groups='no',
            region='RegionOne',
            volume_service='cinder',
            ec2_host='nova-cc-host1',
            quantum_plugin='nvp',
            network_manager='neutron', **FAKE_KS_AUTH_CFG)