Merge "Update tempest installation"

This commit is contained in:
Zuul 2019-11-25 14:52:33 +00:00 committed by Gerrit Code Review
commit 73be54e7f9
3 changed files with 81 additions and 19 deletions

View File

@ -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']['default_domain_id'] = 'default'
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_ssh_user'] = node['openstack']['integration-test']['ssh_user']
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_router_id'] = ''
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']['build_interval'] = 3
conf['volume']['build_timeout'] = 400

View File

@ -45,9 +45,7 @@ admin_pass = get_password 'user', admin_user
admin_project = node['openstack']['identity']['admin_project']
admin_domain = node['openstack']['identity']['admin_domain_name']
admin_project_domain_name = node['openstack']['identity']['admin_project_domain']
# TODO(ramereth): commenting this out until
# https://github.com/fog/fog-openstack/pull/494 gets merged and released.
# endpoint_type = node['openstack']['identity']['endpoint_type']
endpoint_type = node['openstack']['identity']['endpoint_type']
connection_params = {
openstack_auth_url: auth_url,
@ -55,7 +53,7 @@ connection_params = {
openstack_api_key: admin_pass,
openstack_project_name: admin_project,
openstack_domain_name: admin_domain,
# openstack_endpoint_type: endpoint_type,
openstack_endpoint_type: endpoint_type,
}
%w(user1 user2).each_with_index do |user|
@ -89,19 +87,33 @@ include_recipe 'openstack-common'
tempest_path = '/opt/tempest'
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
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
action :nothing
command "#{venv_path}/bin/pip install ."
command "#{venv_path}/bin/pip install #{constraint} tempest==#{tempest_ver}"
cwd tempest_path
end
git tempest_path do
repository 'https://github.com/openstack/tempest'
reference '17.2.0'
repository 'https://opendev.org/openstack/tempest'
reference tempest_ver
depth 1
action :sync
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_alt'] = node['openstack']['integration-test']['image2']['id']
conf['identity']['uri_v3'] = identity_endpoint.to_s
# conf['identity']['v3_endpoint_type'] = endpoint_type
conf['identity']['v3_endpoint_type'] = endpoint_type
end
node.default['openstack']['integration-test']['conf_secrets'].tap do |conf_secrets|

View File

@ -17,7 +17,7 @@ describe 'openstack-integration-test::setup' do
openstack_api_key: 'admin',
openstack_project_name: 'admin',
openstack_domain_name: 'default',
# openstack_endpoint_type: 'internalURL',
openstack_endpoint_type: 'internalURL',
}
it 'installs tempest dependencies' do
@ -92,13 +92,13 @@ describe 'openstack-integration-test::setup' do
end
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
it do
expect(chef_run).to nothing_execute('install tempest')
.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'
)
end
@ -107,8 +107,8 @@ describe 'openstack-integration-test::setup' do
expect(chef_run).to sync_git(
'/opt/tempest'
).with(
repository: 'https://github.com/openstack/tempest',
reference: '17.2.0',
repository: 'https://opendev.org/openstack/tempest',
reference: '22.1.0',
depth: 1
)
end
@ -174,11 +174,11 @@ describe 'openstack-integration-test::setup' do
)
end
# it 'has an endpoint type matching the default value' do
# expect(chef_run).to render_file(file.name).with_content(
# 'endpoint_type = internalURL'
# )
# end
it 'has a v3 endpoint type matching the default value' do
expect(chef_run).to render_file(file.name).with_content(
'v3_endpoint_type = internalURL'
)
end
it 'discovers compute hosts' do
expect(chef_run).to run_execute('discover_hosts')