Fix 'RedHat' misspelled as 'Redhat'
In tests, osfamily 'RedHat' was misspelled as 'Redhat', so no tests were
running for this OS.
Fixing this typo also means that the File[] resource test is no longer
valid, since it is now a Augeas[] resource. Updated test accordingly.
Also added 'systemd env' test for Debian, since I am at it.
This change increases resource coverage from 75% to 81.82%, which means
we should be on the right track.
To reduce confusion, I will submit tests for Change
82cadd3a28
in a separate change.
Change-Id: I9c9d8f6463efb09465092601a113b5e56d920883
This commit is contained in:
parent
82cadd3a28
commit
3efd8af87a
@ -6,7 +6,7 @@
|
|||||||
class ovn::params {
|
class ovn::params {
|
||||||
include openstacklib::defaults
|
include openstacklib::defaults
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'Redhat': {
|
'RedHat': {
|
||||||
$ovn_northd_package_name = 'openvswitch-ovn-central'
|
$ovn_northd_package_name = 'openvswitch-ovn-central'
|
||||||
$ovn_controller_package_name = 'openvswitch-ovn-host'
|
$ovn_controller_package_name = 'openvswitch-ovn-host'
|
||||||
$ovn_northd_service_name = 'ovn-northd'
|
$ovn_northd_service_name = 'ovn-northd'
|
||||||
|
@ -111,13 +111,13 @@ describe 'ovn::controller' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
it_behaves_like 'ovn controller'
|
it_behaves_like 'ovn controller'
|
||||||
when 'Redhat'
|
when 'RedHat'
|
||||||
let :platform_params do
|
let :platform_params do
|
||||||
{
|
{
|
||||||
:ovn_controller_package_name => 'openvswitch-ovn-host',
|
:ovn_controller_package_name => 'openvswitch-ovn-host',
|
||||||
:ovn_controller_service_name => 'ovn-controller',
|
:ovn_controller_service_name => 'ovn-controller',
|
||||||
:ovn_controller_service_status => true,
|
:ovn_controller_service_status => true,
|
||||||
:ovn_controller_service_pattern => 'undef'
|
:ovn_controller_service_pattern => nil
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it_behaves_like 'ovn controller'
|
it_behaves_like 'ovn controller'
|
||||||
|
@ -4,14 +4,11 @@ describe 'ovn::northd' do
|
|||||||
|
|
||||||
shared_examples_for 'systemd env' do
|
shared_examples_for 'systemd env' do
|
||||||
it 'creates systemd conf' do
|
it 'creates systemd conf' do
|
||||||
is_expected.to contain_file('/etc/sysconfig/ovn-northd').with(
|
is_expected.to contain_augeas('config-ovn-northd').with({
|
||||||
:ensure => 'file',
|
:context => platform_params[:ovn_northd_context],
|
||||||
:mode => '0644',
|
:changes => "set " + platform_params[:ovn_northd_option_name] +
|
||||||
:owner => 'root',
|
" '\"--db-nb-addr=0.0.0.0 --db-sb-addr=0.0.0.0 --db-nb-create-insecure-remote=yes --db-sb-create-insecure-remote=yes \"'",
|
||||||
:group => 'root',
|
})
|
||||||
:content => "OVN_NORTHD_OPTS=--db-nb-addr=0.0.0.0 --db-sb-addr=0.0.0.0 --db-nb-create-insecure-remote=yes --db-sb-create-insecure-remote=yes",
|
|
||||||
:before => 'Service[northd]',
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -55,17 +52,22 @@ describe 'ovn::northd' do
|
|||||||
:ovn_northd_package_name => 'ovn-central',
|
:ovn_northd_package_name => 'ovn-central',
|
||||||
:ovn_northd_service_name => 'ovn-central',
|
:ovn_northd_service_name => 'ovn-central',
|
||||||
:ovn_northd_service_status => false,
|
:ovn_northd_service_status => false,
|
||||||
:ovn_northd_service_pattern => 'ovn-northd'
|
:ovn_northd_service_pattern => 'ovn-northd',
|
||||||
|
:ovn_northd_context => '/files/etc/default/ovn-central',
|
||||||
|
:ovn_northd_option_name => 'OVN_CTL_OPTS'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it_behaves_like 'ovn northd'
|
it_behaves_like 'ovn northd'
|
||||||
when 'Redhat'
|
it_behaves_like 'systemd env'
|
||||||
|
when 'RedHat'
|
||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
{
|
{
|
||||||
:ovn_northd_package_name => 'openvswitch-ovn-central',
|
:ovn_northd_package_name => 'openvswitch-ovn-central',
|
||||||
:ovn_northd_service_name => 'ovn-northd',
|
:ovn_northd_service_name => 'ovn-northd',
|
||||||
:ovn_northd_service_status => true,
|
:ovn_northd_service_status => true,
|
||||||
:ovn_northd_service_pattern => 'undef'
|
:ovn_northd_service_pattern => nil,
|
||||||
|
:ovn_northd_context => '/files/etc/sysconfig/ovn-northd',
|
||||||
|
:ovn_northd_option_name => 'OVN_NORTHD_OPTS'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it_behaves_like 'ovn northd'
|
it_behaves_like 'ovn northd'
|
||||||
|
Loading…
Reference in New Issue
Block a user