
Convert the rest of the tests to leverage rspec-puppet-facts Change-Id: Ic2c20516f73214f790ac9ed9fd4a773ee9d5f6af
67 lines
1.8 KiB
Ruby
67 lines
1.8 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'manila::network::neutron' do
|
|
|
|
let :params do
|
|
{
|
|
:neutron_admin_username => 'neutron',
|
|
:neutron_admin_password => 'password',
|
|
:neutron_admin_tenant_name => 'service',
|
|
:neutron_region_name => 'nova',
|
|
:neutron_ca_certificates_file => '/etc/neutron/ca-certificates',
|
|
}
|
|
end
|
|
|
|
let :default_params do
|
|
{
|
|
:neutron_url => 'http://127.0.0.1:9696',
|
|
:neutron_url_timeout => 30,
|
|
:neutron_admin_tenant_name => 'service',
|
|
:neutron_admin_auth_url => 'http://localhost:5000/v2.0',
|
|
:neutron_api_insecure => false,
|
|
:neutron_auth_strategy => 'keystone',
|
|
:network_plugin_ipv4_enabled => '<SERVICE DEFAULT>',
|
|
:network_plugin_ipv6_enabled => '<SERVICE DEFAULT>',
|
|
}
|
|
end
|
|
|
|
shared_examples_for 'neutron network plugin' do
|
|
let :params_hash do
|
|
default_params.merge(params)
|
|
end
|
|
|
|
it 'configures neutron network plugin' do
|
|
|
|
is_expected.to contain_manila_config("DEFAULT/network_api_class").with_value(
|
|
'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin')
|
|
|
|
params_hash.each_pair do |config,value|
|
|
is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value )
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
|
|
on_supported_os({
|
|
:supported_os => OSDefaults.get_supported_os
|
|
}).each do |os,facts|
|
|
context "on #{os}" do
|
|
let (:facts) do
|
|
facts.merge!(OSDefaults.get_facts({ :fqdn => 'some.host.tld'}))
|
|
end
|
|
context 'with default parameters' do
|
|
before do
|
|
params = {}
|
|
end
|
|
it_configures 'neutron network plugin'
|
|
end
|
|
|
|
context 'with provided parameters' do
|
|
it_configures 'neutron network plugin'
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|