49 lines
1.2 KiB
Ruby
49 lines
1.2 KiB
Ruby
# encoding: UTF-8
|
|
|
|
require_relative 'spec_helper'
|
|
|
|
describe 'openstack-bare-metal::identity_registration' do
|
|
describe 'ubuntu' do
|
|
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
|
let(:node) { runner.node }
|
|
let(:chef_run) { runner.converge(described_recipe) }
|
|
|
|
include_context 'bare-metal-stubs'
|
|
|
|
connection_params = {
|
|
openstack_auth_url: 'http://127.0.0.1:5000/v3/auth/tokens',
|
|
openstack_username: 'admin',
|
|
openstack_api_key: 'admin_test_pass',
|
|
openstack_project_name: 'admin',
|
|
openstack_domain_name: 'default',
|
|
}
|
|
service_name = 'baremetal'
|
|
service_project = 'ironic'
|
|
service_user = 'ironic'
|
|
|
|
it "registers #{service_name} service" do
|
|
expect(chef_run).to create_openstack_service(
|
|
service_project
|
|
).with(
|
|
connection_params: connection_params
|
|
)
|
|
end
|
|
|
|
it "registers #{service_name} endpoint" do
|
|
expect(chef_run).to create_openstack_endpoint(
|
|
service_name
|
|
).with(
|
|
connection_params: connection_params
|
|
)
|
|
end
|
|
|
|
it "registers #{service_name} user" do
|
|
expect(chef_run).to create_openstack_user(
|
|
service_user
|
|
).with(
|
|
connection_params: connection_params
|
|
)
|
|
end
|
|
end
|
|
end
|