fuel-library/tests/noop/spec/hosts/keystone/workloads_collector_add_spe...

47 lines
1.6 KiB
Ruby

# ROLE: primary-controller
require 'spec_helper'
require 'shared-examples'
manifest = 'keystone/workloads_collector_add.pp'
describe manifest do
shared_examples 'catalog' do
management_vip= Noop.hiera('management_vip')
let(:ssl_hash) { Noop.hiera_hash 'use_ssl', {} }
let(:admin_auth_protocol) {
Noop.puppet_function 'get_ssl_property',ssl_hash,{},'keystone','admin',
'protocol','http'
}
let(:admin_auth_address) {
Noop.puppet_function 'get_ssl_property',ssl_hash,{},'keystone','admin',
'hostname',[Noop.hiera('service_endpoint', ''), management_vip]
}
let(:admin_url) { "#{admin_auth_protocol}://#{admin_auth_address}:35357" }
it 'should have explicit ordering between LB classes and particular actions' do
expect(graph).to ensure_transitive_dependency("Haproxy_backend_status[keystone-public]",
"Class[openstack::workloads_collector]")
expect(graph).to ensure_transitive_dependency("Haproxy_backend_status[keystone-admin]",
"Class[openstack::workloads_collector]")
end
it {
if Noop.hiera('external_lb', false)
url = admin_url
provider = 'http'
else
url = 'http://' + Noop.hiera('service_endpoint').to_s + ':10000/;csv'
provider = Puppet::Type.type(:haproxy_backend_status).defaultprovider.name
end
should contain_haproxy_backend_status('keystone-admin').with(
:url => url,
:provider => provider
)
}
end
test_ubuntu_and_centos manifest
end