Run discover_hosts after computes are added, before running Tempest

Change-Id: If1b300bdb4e1d9a5e1be2361c29816d75d368b91
This commit is contained in:
Samuel Cassiba 2018-02-23 13:57:44 -08:00
parent bf4b77133a
commit 10e64092dd
2 changed files with 17 additions and 0 deletions

View File

@ -165,6 +165,9 @@ end
# merge all config options and secrets to be used in the nova.conf.erb
integration_test_conf_options = merge_config_options 'integration-test'
nova_user = node['openstack']['compute']['user']
nova_group = node['openstack']['compute']['group']
# create the keystone.conf from attributes
template '/opt/tempest/etc/tempest.conf' do
source 'openstack-service.conf.erb'
@ -184,6 +187,14 @@ directory '/opt/tempest/logs' do
action :create
end
# execute discover_hosts again before running tempest
execute 'discover_hosts' do
user nova_user
group nova_group
command 'nova-manage cell_v2 discover_hosts'
action :run
end
# delete all secrets saved in the attribute
# node['openstack']['identity']['conf_secrets'] after creating the keystone.conf
ruby_block "delete all attributes in node['openstack']['integration-test']['conf_secrets']" do

View File

@ -162,6 +162,12 @@ describe 'openstack-integration-test::setup' do
'uri_v3 = http://127.0.0.1:5000/v3'
)
end
it 'discovers compute hosts' do
expect(chef_run).to run_execute('discover_hosts')
.with(user: 'nova',
group: 'nova')
end
end
describe 'tempest.conf with HTTPS' do