Utilise ['openstack']['region'] from cookbook-openstack-common

- Set ['openstack']['block-storage']['region'] to equal ['openstack']['region']
- Add tests for endpoint creation, to confirm region is set.
- Add test to override the endpoint and confirm it is used.

Change-Id: I2e88e8ff7d5fa8f5d0d611e916eff65ddff8e85e
Addresses: blueprint uniform-region
This commit is contained in:
Andy McCrae
2014-02-20 15:16:34 +00:00
parent 1046b36710
commit 39c61d04e6
2 changed files with 33 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ default['openstack']['block-storage']['lock_path'] = '/var/lock/cinder'
# Default notification_driver
default['openstack']['block-storage']['notification_driver'] = 'cinder.openstack.common.notifier.rpc_notifier'
# Availability zone/region for the OpenStack Block-Storage service
default['openstack']['block-storage']['region'] = 'RegionOne'
default['openstack']['block-storage']['region'] = node['openstack']['region']
default['openstack']['block-storage']['scheduler_role'] = 'os-block-storage-scheduler'
# Template strings to be used to generate resource names

View File

@@ -31,6 +31,22 @@ describe 'openstack-block-storage::identity_registration' do
)
end
it 'overrides cinder volume service region' do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set['openstack']['block-storage']['region'] = 'serviceRegion'
end
@chef_run.converge 'openstack-block-storage::identity_registration'
resource = @chef_run.find_resource(
'openstack-identity_register',
'Register Cinder Volume Service'
).to_hash
expect(resource).to include(
endpoint_region: 'serviceRegion',
action: [:create_service]
)
end
it 'registers cinder volume endpoint' do
resource = @chef_run.find_resource(
'openstack-identity_register',
@@ -51,6 +67,22 @@ describe 'openstack-block-storage::identity_registration' do
)
end
it 'overrides cinder volume endpoint region' do
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set['openstack']['block-storage']['region'] = 'volumeRegion'
end
@chef_run.converge 'openstack-block-storage::identity_registration'
resource = @chef_run.find_resource(
'openstack-identity_register',
'Register Cinder Volume Endpoint'
).to_hash
expect(resource).to include(
endpoint_region: 'volumeRegion',
action: [:create_endpoint]
)
end
it 'registers service user' do
resource = @chef_run.find_resource(
'openstack-identity_register',