Make tests pass on Puppet 4.x

This commit makes the following changes, mostly to specs to get them
  passing on Puppet 4.x: removes redefinition of $name because it is now
  a reserved word and redundant in Puppet 3.x, cleans up the use of
  Puppet's old behavior of implicitly converting String to Integers
  since Puppet 4.x is pretty strictly typed, sets facts required for
  doing flow control and comparison, fixes implicit use of empty string
  that is assumed to be the same as false by updating tests that inject
  empty string into params to represent a value not being provide by a
  user to false instead.

Closes-bug: #1447620
Change-Id: Ibb651f26f33549dbe564dc88167b8f578a03fd77
This commit is contained in:
Cody Herriges
2015-06-09 12:20:49 -07:00
committed by Cody Herriges
parent e0b04137d9
commit ccac02b917
29 changed files with 264 additions and 108 deletions

View File

@@ -26,6 +26,11 @@ describe 'neutron::agents::dhcp' do
:enable_metadata_network => false }
end
let :default_facts do
{ :operatingsystem => 'default',
:operatingsystemrelease => 'default'
}
end
shared_examples_for 'neutron dhcp agent' do
let :p do
@@ -125,8 +130,8 @@ describe 'neutron::agents::dhcp' do
shared_examples_for 'dnsmasq dhcp_driver' do
it 'installs dnsmasq packages' do
if platform_params.has_key?(:dhcp_agent_package)
is_expected.to contain_package(platform_params[:dnsmasq_base_package]).with_before('Package[neutron-dhcp-agent]')
is_expected.to contain_package(platform_params[:dnsmasq_utils_package]).with_before('Package[neutron-dhcp-agent]')
is_expected.to contain_package(platform_params[:dnsmasq_base_package]).with_before(['Package[neutron-dhcp-agent]'])
is_expected.to contain_package(platform_params[:dnsmasq_utils_package]).with_before(['Package[neutron-dhcp-agent]'])
end
is_expected.to contain_package(platform_params[:dnsmasq_base_package]).with(
:ensure => 'present',
@@ -142,7 +147,7 @@ describe 'neutron::agents::dhcp' do
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
@@ -158,7 +163,7 @@ describe 'neutron::agents::dhcp' do
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do