This creates the role it doesn't by default

This allows integration tests to run.

Partial-Bug: 1433808

Change-Id: Id9cdca2f8718f0f000a82cab1ba8fd70462d6329
This commit is contained in:
JJ Asghar 2015-03-16 15:24:16 -05:00
parent d081433097
commit bd109dbd1b
4 changed files with 42 additions and 3 deletions

View File

@ -1,7 +1,9 @@
source 'https://supermarket.getchef.com'
source 'https://supermarket.chef.io'
metadata
cookbook "openstack-bare-metal",
github: "stackforge/cookbook-openstack-bare-metal"
cookbook "openstack-common",
github: "stackforge/cookbook-openstack-common"
cookbook "openstack-identity",

View File

@ -65,6 +65,17 @@ admin_pass = get_password 'user', node['openstack']['identity']['ad
action :create_user
end
openstack_identity_register "Create tempest role #{i}" do
auth_uri auth_uri
bootstrap_token bootstrap_token
tenant_name node['openstack']['integration-test'][user]['tenant_name']
user_name node['openstack']['integration-test'][user]['user_name']
user_pass node['openstack']['integration-test'][user]['password']
role_name 'Member'
action :create_role
end
openstack_identity_register "Grant 'member' Role to tempest user for tempest tenant ##{i}" do
auth_uri auth_uri
bootstrap_token bootstrap_token

View File

@ -43,6 +43,19 @@ describe 'openstack-integration-test::setup' do
)
end
it 'creates member role to tempest_user1 for tempest_tenant1' do
expect(chef_run).to create_role_openstack_identity_register(
'Create tempest role 1'
).with(
auth_uri: 'http://127.0.0.1:35357/v2.0',
bootstrap_token: 'bootstrap-token',
tenant_name: 'tempest_tenant1',
user_name: 'tempest_user1',
user_pass: 'tempest_user1_pass',
role_name: 'Member'
)
end
it 'grants member role to tempest_user1 for tempest_tenant1' do
expect(chef_run).to grant_role_openstack_identity_register(
"Grant 'member' Role to tempest user for tempest tenant #1"
@ -78,6 +91,19 @@ describe 'openstack-integration-test::setup' do
)
end
it 'creates member role to tempest_user2 for tempest_tenant2' do
expect(chef_run).to create_role_openstack_identity_register(
'Create tempest role 2'
).with(
auth_uri: 'http://127.0.0.1:35357/v2.0',
bootstrap_token: 'bootstrap-token',
tenant_name: 'tempest_tenant2',
user_name: 'tempest_user2',
user_pass: 'tempest_user2_pass',
role_name: 'Member'
)
end
it 'grants member role to tempest_user2 for tempest_tenant2' do
expect(chef_run).to grant_role_openstack_identity_register(
"Grant 'member' Role to tempest user for tempest tenant #2"

View File

@ -9,12 +9,12 @@ require 'chef/application'
LOG_LEVEL = :fatal
REDHAT_OPTS = {
platform: 'redhat',
version: '6.3',
version: '7.0',
log_level: LOG_LEVEL
}
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '12.04',
version: '14.04',
log_level: LOG_LEVEL
}