
This patch aim to update our specs test in order to work with the rspec-puppet release 2.0.0, in the mean time, we update rspec syntax order to be prepared for rspec 3.x move. In details: * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0 * Use shared_examples "a Puppet::Error" for puppet::error tests * * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) * * Fix spec tests for rspec-puppet 2.0.0 * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper) Change-Id: I172439c6ed185bb38b325b2524cab1475cdc7504
104 lines
2.2 KiB
Ruby
104 lines
2.2 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::db::mysql' do
|
|
|
|
let :pre_condition do
|
|
'include mysql::server'
|
|
end
|
|
|
|
let :required_params do
|
|
{ :password => "qwerty" }
|
|
end
|
|
|
|
context 'on a Debian osfamily' do
|
|
let :facts do
|
|
{ :osfamily => "Debian" }
|
|
end
|
|
|
|
context 'with only required parameters' do
|
|
let :params do
|
|
required_params
|
|
end
|
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
|
|
:user => 'nova',
|
|
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
|
|
:charset => 'utf8'
|
|
)}
|
|
end
|
|
|
|
context 'when overriding charset' do
|
|
let :params do
|
|
{ :charset => 'latin1' }.merge(required_params)
|
|
end
|
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
|
|
end
|
|
end
|
|
|
|
context 'on a RedHat osfamily' do
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
|
|
context 'with only required parameters' do
|
|
let :params do
|
|
required_params
|
|
end
|
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
|
|
:user => 'nova',
|
|
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
|
|
:charset => 'utf8'
|
|
)}
|
|
end
|
|
|
|
context 'when overriding charset' do
|
|
let :params do
|
|
{ :charset => 'latin1' }.merge(required_params)
|
|
end
|
|
|
|
it { is_expected.to contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
|
|
end
|
|
end
|
|
|
|
describe "overriding allowed_hosts param to array" do
|
|
let :facts do
|
|
{ :osfamily => "Debian" }
|
|
end
|
|
let :params do
|
|
{
|
|
:password => 'novapass',
|
|
:allowed_hosts => ['127.0.0.1','%']
|
|
}
|
|
end
|
|
|
|
end
|
|
|
|
describe "overriding allowed_hosts param to string" do
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
let :params do
|
|
{
|
|
:password => 'novapass2',
|
|
:allowed_hosts => '192.168.1.1'
|
|
}
|
|
end
|
|
|
|
end
|
|
|
|
describe "overriding allowed_hosts param equals to host param " do
|
|
let :facts do
|
|
{ :osfamily => 'RedHat' }
|
|
end
|
|
let :params do
|
|
{
|
|
:password => 'novapass2',
|
|
:allowed_hosts => '127.0.0.1'
|
|
}
|
|
end
|
|
|
|
end
|
|
end
|