2016-12-08 00:08:58 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'neutron::plugins::ml2::vpp' do
|
|
|
|
let :pre_condition do
|
2019-12-08 23:12:32 +01:00
|
|
|
"class { 'neutron::keystone::authtoken':
|
2016-12-08 00:08:58 -05:00
|
|
|
password => 'passw0rd',
|
|
|
|
}
|
|
|
|
class { 'neutron::server': }
|
|
|
|
class { 'neutron':
|
|
|
|
core_plugin => 'neutron.plugins.ml2.plugin.Ml2Plugin' }"
|
|
|
|
end
|
|
|
|
|
|
|
|
let :default_params do
|
|
|
|
{
|
2017-03-28 18:02:55 +08:00
|
|
|
:etcd_host => '127.0.0.1',
|
|
|
|
:etcd_port => 4001,
|
2016-12-08 00:08:58 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2018-11-28 17:43:42 +01:00
|
|
|
shared_examples 'neutron plugin vpp ml2' do
|
2016-12-08 00:08:58 -05:00
|
|
|
before do
|
|
|
|
params.merge!(default_params)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'configures ml2_vpp settings' do
|
2018-11-28 17:43:42 +01:00
|
|
|
should contain_neutron_plugin_ml2('ml2_vpp/etcd_host').with_value(params[:etcd_host])
|
|
|
|
should contain_neutron_plugin_ml2('ml2_vpp/etcd_port').with_value(params[:etcd_port])
|
|
|
|
should contain_neutron_plugin_ml2('ml2_vpp/etcd_user').with_value('<SERVICE DEFAULT>')
|
|
|
|
should contain_neutron_plugin_ml2('ml2_vpp/etcd_pass').with_value('<SERVICE DEFAULT>').with_secret(true)
|
2016-12-08 00:08:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when enabling etcd authentication' do
|
|
|
|
before :each do
|
|
|
|
params.merge!(:etcd_user => 'admin',
|
|
|
|
:etcd_pass => 'password' )
|
|
|
|
end
|
|
|
|
it 'should configure etcd username and password' do
|
2018-11-28 17:43:42 +01:00
|
|
|
should contain_neutron_plugin_ml2('ml2_vpp/etcd_user').with_value('admin')
|
|
|
|
should contain_neutron_plugin_ml2('ml2_vpp/etcd_pass').with_value('password').with_secret(true)
|
2016-12-08 00:08:58 -05:00
|
|
|
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())
|
|
|
|
end
|
|
|
|
|
2018-11-28 17:43:42 +01:00
|
|
|
it_behaves_like 'neutron plugin vpp ml2'
|
2016-12-08 00:08:58 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|