puppet-octavia/spec/classes/octavia_ovn_provider_spec.rb
Flavio Fernandes dce599e498 Add Octavia OVN Provider configuration (1 of 2)
This patch enhances Octavia's OVN driver config, so it can connect to
OVN_Northbound DB using TLS.

This is part 1 of 2, where octavia::api::ovn_nb_connection will move
to newly created octavia::provider::ovn::ovn_nb_connection config file.
But that has to be split into 2 parts to avoid breaking the
CI until the THT+pupple-tripleo changes merges [1].

[1]: https://review.opendev.org/#/q/topic:bug/1861886+(status:open+OR+status:merged)

Co-Authored-By: Brent Eagles <beagles@redhat.com>
Related-Bug: #1861886
Change-Id: Id74ef39ff303c9abf8118df203970cd871ed974a
2020-03-18 10:00:11 -04:00

48 lines
1.7 KiB
Ruby

require 'spec_helper'
describe 'octavia::provider::ovn' do
let :params do
{
}
end
shared_examples_for 'octavia-ovn-provider' do
context 'with default parameters' do
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_connection').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_private_key').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_certificate').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_ca_cert').with_value('<SERVICE DEFAULT>') }
end
context 'with specific parameters' do
before do
params.merge!({
:ovn_nb_connection => 'tcp:127.0.0.1:6641',
:ovn_nb_private_key => '/foo.key',
:ovn_nb_certificate => '/foo.pem',
:ovn_nb_ca_cert => '/ca_foo.pem'
})
end
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_connection').with_value('tcp:127.0.0.1:6641') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_private_key').with_value('/foo.key') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_certificate').with_value('/foo.pem') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_ca_cert').with_value('/ca_foo.pem') }
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
it_behaves_like 'octavia-ovn-provider'
end
end
end