Update tempest installation
- Adopt for the use of python3 on Ubuntu - Use the endpoint_type attribute - Install recent tempest version - Make sure to install matching requirements - Adjust default tempest.conf to work in our minimal scenario Change-Id: Ib413971c15d11cbb46befda55ffc28f3c16f2a8a
This commit is contained in:
		@@ -20,6 +20,7 @@ default['openstack']['integration-test']['conf'].tap do |conf|
 | 
				
			|||||||
  conf['identity']['alt_project_name']  = node['openstack']['integration-test']['user2']['project_name']
 | 
					  conf['identity']['alt_project_name']  = node['openstack']['integration-test']['user2']['project_name']
 | 
				
			||||||
  conf['identity']['default_domain_id'] = 'default'
 | 
					  conf['identity']['default_domain_id'] = 'default'
 | 
				
			||||||
  conf['identity']['admin_domain_scope'] = false
 | 
					  conf['identity']['admin_domain_scope'] = false
 | 
				
			||||||
 | 
					  conf['validation']['run_validation'] = false
 | 
				
			||||||
  conf['validation']['image_alt_ssh_user'] = node['openstack']['integration-test']['alt_ssh_user']
 | 
					  conf['validation']['image_alt_ssh_user'] = node['openstack']['integration-test']['alt_ssh_user']
 | 
				
			||||||
  conf['validation']['image_ssh_user'] = node['openstack']['integration-test']['ssh_user']
 | 
					  conf['validation']['image_ssh_user'] = node['openstack']['integration-test']['ssh_user']
 | 
				
			||||||
  conf['compute']['flavor_ref'] = node['openstack']['integration-test']['image1']['flavor']
 | 
					  conf['compute']['flavor_ref'] = node['openstack']['integration-test']['image1']['flavor']
 | 
				
			||||||
@@ -58,6 +59,55 @@ default['openstack']['integration-test']['conf'].tap do |conf|
 | 
				
			|||||||
  conf['network']['public_network_id'] = ''
 | 
					  conf['network']['public_network_id'] = ''
 | 
				
			||||||
  conf['network']['public_router_id'] = ''
 | 
					  conf['network']['public_router_id'] = ''
 | 
				
			||||||
  conf['network']['quantum_available'] = false
 | 
					  conf['network']['quantum_available'] = false
 | 
				
			||||||
 | 
					  conf['network-feature-enabled']['api_extensions'] = %w(
 | 
				
			||||||
 | 
					    address-scope
 | 
				
			||||||
 | 
					    agent
 | 
				
			||||||
 | 
					    allowed-address-pairs
 | 
				
			||||||
 | 
					    auto-allocated-topology
 | 
				
			||||||
 | 
					    availability_zone
 | 
				
			||||||
 | 
					    availability_zone_filter
 | 
				
			||||||
 | 
					    binding
 | 
				
			||||||
 | 
					    binding-extended
 | 
				
			||||||
 | 
					    default-subnetpools
 | 
				
			||||||
 | 
					    dhcp_agent_scheduler
 | 
				
			||||||
 | 
					    dvr
 | 
				
			||||||
 | 
					    empty-string-filtering
 | 
				
			||||||
 | 
					    ext-gw-mode
 | 
				
			||||||
 | 
					    external-net
 | 
				
			||||||
 | 
					    extra_dhcp_opt
 | 
				
			||||||
 | 
					    extraroute
 | 
				
			||||||
 | 
					    filter-validation
 | 
				
			||||||
 | 
					    fip-port-details
 | 
				
			||||||
 | 
					    flavors
 | 
				
			||||||
 | 
					    ip-substring-filtering
 | 
				
			||||||
 | 
					    l3-flavors
 | 
				
			||||||
 | 
					    l3-ha
 | 
				
			||||||
 | 
					    l3_agent_scheduler
 | 
				
			||||||
 | 
					    multi-provider
 | 
				
			||||||
 | 
					    net-mtu
 | 
				
			||||||
 | 
					    net-mtu-writable
 | 
				
			||||||
 | 
					    network-ip-availability
 | 
				
			||||||
 | 
					    network_availability_zone
 | 
				
			||||||
 | 
					    pagination
 | 
				
			||||||
 | 
					    port-mac-address-regenerate
 | 
				
			||||||
 | 
					    port-security-groups-filtering
 | 
				
			||||||
 | 
					    project-id
 | 
				
			||||||
 | 
					    provider
 | 
				
			||||||
 | 
					    quota_details
 | 
				
			||||||
 | 
					    quotas
 | 
				
			||||||
 | 
					    rbac-policies
 | 
				
			||||||
 | 
					    revision-if-match
 | 
				
			||||||
 | 
					    router
 | 
				
			||||||
 | 
					    router_availability_zone
 | 
				
			||||||
 | 
					    security-group
 | 
				
			||||||
 | 
					    service-type
 | 
				
			||||||
 | 
					    sorting
 | 
				
			||||||
 | 
					    standard-attr-description
 | 
				
			||||||
 | 
					    standard-attr-revisions
 | 
				
			||||||
 | 
					    standard-attr-tag
 | 
				
			||||||
 | 
					    standard-attr-timestamp
 | 
				
			||||||
 | 
					    subnet-service-types
 | 
				
			||||||
 | 
					    subnet_allocation).join(',')
 | 
				
			||||||
  conf['volume']['catalog_type'] = 'volume'
 | 
					  conf['volume']['catalog_type'] = 'volume'
 | 
				
			||||||
  conf['volume']['build_interval'] = 3
 | 
					  conf['volume']['build_interval'] = 3
 | 
				
			||||||
  conf['volume']['build_timeout'] = 400
 | 
					  conf['volume']['build_timeout'] = 400
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,9 +45,7 @@ admin_pass = get_password 'user', admin_user
 | 
				
			|||||||
admin_project = node['openstack']['identity']['admin_project']
 | 
					admin_project = node['openstack']['identity']['admin_project']
 | 
				
			||||||
admin_domain = node['openstack']['identity']['admin_domain_name']
 | 
					admin_domain = node['openstack']['identity']['admin_domain_name']
 | 
				
			||||||
admin_project_domain_name = node['openstack']['identity']['admin_project_domain']
 | 
					admin_project_domain_name = node['openstack']['identity']['admin_project_domain']
 | 
				
			||||||
# TODO(ramereth): commenting this out until
 | 
					endpoint_type = node['openstack']['identity']['endpoint_type']
 | 
				
			||||||
# https://github.com/fog/fog-openstack/pull/494 gets merged and released.
 | 
					 | 
				
			||||||
# endpoint_type = node['openstack']['identity']['endpoint_type']
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
connection_params = {
 | 
					connection_params = {
 | 
				
			||||||
  openstack_auth_url:      auth_url,
 | 
					  openstack_auth_url:      auth_url,
 | 
				
			||||||
@@ -55,7 +53,7 @@ connection_params = {
 | 
				
			|||||||
  openstack_api_key:       admin_pass,
 | 
					  openstack_api_key:       admin_pass,
 | 
				
			||||||
  openstack_project_name:  admin_project,
 | 
					  openstack_project_name:  admin_project,
 | 
				
			||||||
  openstack_domain_name:   admin_domain,
 | 
					  openstack_domain_name:   admin_domain,
 | 
				
			||||||
  # openstack_endpoint_type: endpoint_type,
 | 
					  openstack_endpoint_type: endpoint_type,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%w(user1 user2).each_with_index do |user|
 | 
					%w(user1 user2).each_with_index do |user|
 | 
				
			||||||
@@ -89,19 +87,33 @@ include_recipe 'openstack-common'
 | 
				
			|||||||
tempest_path = '/opt/tempest'
 | 
					tempest_path = '/opt/tempest'
 | 
				
			||||||
venv_path = '/opt/tempest-venv'
 | 
					venv_path = '/opt/tempest-venv'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
execute "virtualenv #{venv_path}" do
 | 
					case node['platform_family']
 | 
				
			||||||
 | 
					when 'debian'
 | 
				
			||||||
 | 
					  venv_cmd = 'virtualenv -p python3'
 | 
				
			||||||
 | 
					when 'fedora', 'rhel'
 | 
				
			||||||
 | 
					  venv_cmd = 'virtualenv'
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					execute 'create virtualenv for tempest' do
 | 
				
			||||||
 | 
					  command "#{venv_cmd} #{venv_path}"
 | 
				
			||||||
  creates venv_path
 | 
					  creates venv_path
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Note(jh): Make sure to keep the constraint definition in sync with
 | 
				
			||||||
 | 
					# the tempest version
 | 
				
			||||||
 | 
					tempest_ver = '22.1.0'
 | 
				
			||||||
 | 
					constraint = '-c https://opendev.org/openstack/requirements/raw/'\
 | 
				
			||||||
 | 
					  'branch/stable/train/upper-constraints.txt'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
execute 'install tempest' do
 | 
					execute 'install tempest' do
 | 
				
			||||||
  action :nothing
 | 
					  action :nothing
 | 
				
			||||||
  command "#{venv_path}/bin/pip install ."
 | 
					  command "#{venv_path}/bin/pip install #{constraint} tempest==#{tempest_ver}"
 | 
				
			||||||
  cwd tempest_path
 | 
					  cwd tempest_path
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
git tempest_path do
 | 
					git tempest_path do
 | 
				
			||||||
  repository 'https://github.com/openstack/tempest'
 | 
					  repository 'https://opendev.org/openstack/tempest'
 | 
				
			||||||
  reference '17.2.0'
 | 
					  reference tempest_ver
 | 
				
			||||||
  depth 1
 | 
					  depth 1
 | 
				
			||||||
  action :sync
 | 
					  action :sync
 | 
				
			||||||
  notifies :run, 'execute[install tempest]', :immediately
 | 
					  notifies :run, 'execute[install tempest]', :immediately
 | 
				
			||||||
@@ -153,7 +165,7 @@ node.default['openstack']['integration-test']['conf'].tap do |conf|
 | 
				
			|||||||
  conf['compute']['image_ref'] = node['openstack']['integration-test']['image1']['id']
 | 
					  conf['compute']['image_ref'] = node['openstack']['integration-test']['image1']['id']
 | 
				
			||||||
  conf['compute']['image_ref_alt'] = node['openstack']['integration-test']['image2']['id']
 | 
					  conf['compute']['image_ref_alt'] = node['openstack']['integration-test']['image2']['id']
 | 
				
			||||||
  conf['identity']['uri_v3'] = identity_endpoint.to_s
 | 
					  conf['identity']['uri_v3'] = identity_endpoint.to_s
 | 
				
			||||||
  # conf['identity']['v3_endpoint_type'] = endpoint_type
 | 
					  conf['identity']['v3_endpoint_type'] = endpoint_type
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets|
 | 
					node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets|
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@ describe 'openstack-integration-test::setup' do
 | 
				
			|||||||
      openstack_api_key: 'admin',
 | 
					      openstack_api_key: 'admin',
 | 
				
			||||||
      openstack_project_name: 'admin',
 | 
					      openstack_project_name: 'admin',
 | 
				
			||||||
      openstack_domain_name: 'default',
 | 
					      openstack_domain_name: 'default',
 | 
				
			||||||
      # openstack_endpoint_type: 'internalURL',
 | 
					      openstack_endpoint_type: 'internalURL',
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it 'installs tempest dependencies' do
 | 
					    it 'installs tempest dependencies' do
 | 
				
			||||||
@@ -92,13 +92,13 @@ describe 'openstack-integration-test::setup' do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it do
 | 
					    it do
 | 
				
			||||||
      expect(chef_run).to run_execute('virtualenv /opt/tempest-venv').with(creates: '/opt/tempest-venv')
 | 
					      expect(chef_run).to run_execute('create virtualenv for tempest').with(creates: '/opt/tempest-venv')
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it do
 | 
					    it do
 | 
				
			||||||
      expect(chef_run).to nothing_execute('install tempest')
 | 
					      expect(chef_run).to nothing_execute('install tempest')
 | 
				
			||||||
        .with(
 | 
					        .with(
 | 
				
			||||||
          command: '/opt/tempest-venv/bin/pip install .',
 | 
					          command: '/opt/tempest-venv/bin/pip install -c https://opendev.org/openstack/requirements/raw/branch/stable/train/upper-constraints.txt tempest==22.1.0',
 | 
				
			||||||
          cwd: '/opt/tempest'
 | 
					          cwd: '/opt/tempest'
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -107,8 +107,8 @@ describe 'openstack-integration-test::setup' do
 | 
				
			|||||||
      expect(chef_run).to sync_git(
 | 
					      expect(chef_run).to sync_git(
 | 
				
			||||||
        '/opt/tempest'
 | 
					        '/opt/tempest'
 | 
				
			||||||
      ).with(
 | 
					      ).with(
 | 
				
			||||||
        repository: 'https://github.com/openstack/tempest',
 | 
					        repository: 'https://opendev.org/openstack/tempest',
 | 
				
			||||||
        reference: '17.2.0',
 | 
					        reference: '22.1.0',
 | 
				
			||||||
        depth: 1
 | 
					        depth: 1
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -174,11 +174,11 @@ describe 'openstack-integration-test::setup' do
 | 
				
			|||||||
        )
 | 
					        )
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # it 'has an endpoint type matching the default value' do
 | 
					      it 'has a v3 endpoint type matching the default value' do
 | 
				
			||||||
      #   expect(chef_run).to render_file(file.name).with_content(
 | 
					        expect(chef_run).to render_file(file.name).with_content(
 | 
				
			||||||
      #     'endpoint_type = internalURL'
 | 
					          'v3_endpoint_type = internalURL'
 | 
				
			||||||
      #   )
 | 
					        )
 | 
				
			||||||
      # end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      it 'discovers compute hosts' do
 | 
					      it 'discovers compute hosts' do
 | 
				
			||||||
        expect(chef_run).to run_execute('discover_hosts')
 | 
					        expect(chef_run).to run_execute('discover_hosts')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user