Use new common specific_endpoint routines
Now that admin_endpoint, public_endpoint, and internal_endpoint in the common library are working, these are the changes to use them in the openstack-block-storge recipes. Change-Id: Ief4b9d011f55236270a4dc18f2b1f3f769d0a493 Partial-Bug: 1412919
This commit is contained in:
		@@ -56,6 +56,102 @@ describe 'openstack-block-storage::identity_registration' do
 | 
			
		||||
        )
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it 'with different admin URL' do
 | 
			
		||||
        admin_url = 'https://admin.host:123/admin_path'
 | 
			
		||||
        general_url = 'http://general.host:456/general_path'
 | 
			
		||||
 | 
			
		||||
        # Set the general endpoint
 | 
			
		||||
        node.set['openstack']['endpoints']['block-storage-api']['uri'] = general_url
 | 
			
		||||
        # Set the admin endpoint override
 | 
			
		||||
        node.set['openstack']['endpoints']['admin']['block-storage-api']['uri'] = admin_url
 | 
			
		||||
 | 
			
		||||
        expect(chef_run).to create_endpoint_openstack_identity_register(
 | 
			
		||||
          'Register Cinder V2 Volume Endpoint'
 | 
			
		||||
        ).with(
 | 
			
		||||
          auth_uri: 'http://127.0.0.1:35357/v2.0',
 | 
			
		||||
          bootstrap_token: 'bootstrap-token',
 | 
			
		||||
          service_name: 'cinderv2',
 | 
			
		||||
          service_type: 'volumev2',
 | 
			
		||||
          service_description: 'Cinder Volume Service V2',
 | 
			
		||||
          endpoint_region: 'RegionOne',
 | 
			
		||||
          endpoint_adminurl: admin_url,
 | 
			
		||||
          endpoint_internalurl: general_url,
 | 
			
		||||
          endpoint_publicurl: general_url
 | 
			
		||||
        )
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it 'with different public URL' do
 | 
			
		||||
        public_url = 'https://public.host:789/public_path'
 | 
			
		||||
        general_url = 'http://general.host:456/general_path'
 | 
			
		||||
 | 
			
		||||
        # Set the general endpoint
 | 
			
		||||
        node.set['openstack']['endpoints']['block-storage-api']['uri'] = general_url
 | 
			
		||||
        # Set the public endpoint override
 | 
			
		||||
        node.set['openstack']['endpoints']['public']['block-storage-api']['uri'] = public_url
 | 
			
		||||
 | 
			
		||||
        expect(chef_run).to create_endpoint_openstack_identity_register(
 | 
			
		||||
          'Register Cinder V2 Volume Endpoint'
 | 
			
		||||
        ).with(
 | 
			
		||||
          auth_uri: 'http://127.0.0.1:35357/v2.0',
 | 
			
		||||
          bootstrap_token: 'bootstrap-token',
 | 
			
		||||
          service_name: 'cinderv2',
 | 
			
		||||
          service_type: 'volumev2',
 | 
			
		||||
          service_description: 'Cinder Volume Service V2',
 | 
			
		||||
          endpoint_region: 'RegionOne',
 | 
			
		||||
          endpoint_adminurl: general_url,
 | 
			
		||||
          endpoint_internalurl: general_url,
 | 
			
		||||
          endpoint_publicurl: public_url
 | 
			
		||||
        )
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it 'with different internal URL' do
 | 
			
		||||
        internal_url = 'http://internal.host:456/internal_path'
 | 
			
		||||
        general_url = 'http://general.host:456/general_path'
 | 
			
		||||
 | 
			
		||||
        # Set the general endpoint
 | 
			
		||||
        node.set['openstack']['endpoints']['block-storage-api']['uri'] = general_url
 | 
			
		||||
        # Set the internal endpoint override
 | 
			
		||||
        node.set['openstack']['endpoints']['internal']['block-storage-api']['uri'] = internal_url
 | 
			
		||||
 | 
			
		||||
        expect(chef_run).to create_endpoint_openstack_identity_register(
 | 
			
		||||
          'Register Cinder V2 Volume Endpoint'
 | 
			
		||||
        ).with(
 | 
			
		||||
          auth_uri: 'http://127.0.0.1:35357/v2.0',
 | 
			
		||||
          bootstrap_token: 'bootstrap-token',
 | 
			
		||||
          service_name: 'cinderv2',
 | 
			
		||||
          service_type: 'volumev2',
 | 
			
		||||
          service_description: 'Cinder Volume Service V2',
 | 
			
		||||
          endpoint_region: 'RegionOne',
 | 
			
		||||
          endpoint_adminurl: general_url,
 | 
			
		||||
          endpoint_internalurl: internal_url,
 | 
			
		||||
          endpoint_publicurl: general_url
 | 
			
		||||
        )
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it 'with all different URLs' do
 | 
			
		||||
        admin_url = 'https://admin.host:123/admin_path'
 | 
			
		||||
        internal_url = 'http://internal.host:456/internal_path'
 | 
			
		||||
        public_url = 'https://public.host:789/public_path'
 | 
			
		||||
 | 
			
		||||
        node.set['openstack']['endpoints']['internal']['block-storage-api']['uri'] = internal_url
 | 
			
		||||
        node.set['openstack']['endpoints']['admin']['block-storage-api']['uri'] = admin_url
 | 
			
		||||
        node.set['openstack']['endpoints']['public']['block-storage-api']['uri'] = public_url
 | 
			
		||||
 | 
			
		||||
        expect(chef_run).to create_endpoint_openstack_identity_register(
 | 
			
		||||
          'Register Cinder V2 Volume Endpoint'
 | 
			
		||||
        ).with(
 | 
			
		||||
          auth_uri: 'http://127.0.0.1:35357/v2.0',
 | 
			
		||||
          bootstrap_token: 'bootstrap-token',
 | 
			
		||||
          service_name: 'cinderv2',
 | 
			
		||||
          service_type: 'volumev2',
 | 
			
		||||
          service_description: 'Cinder Volume Service V2',
 | 
			
		||||
          endpoint_region: 'RegionOne',
 | 
			
		||||
          endpoint_adminurl: admin_url,
 | 
			
		||||
          endpoint_internalurl: internal_url,
 | 
			
		||||
          endpoint_publicurl: public_url
 | 
			
		||||
        )
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it 'with custom region override' do
 | 
			
		||||
        node.set['openstack']['block-storage']['region'] = 'volumeRegion'
 | 
			
		||||
        expect(chef_run).to create_endpoint_openstack_identity_register(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user