Switch tests to use rspec-puppet-facts
This change updates the default tests to use rspec-puppet-facts to do testing with each of the supported operating systems. Change-Id: I53420e4ad7c143a8b2be932c8f2f9d62b465e792
This commit is contained in:
parent
c4807e6cfa
commit
2221ccce57
@ -3,58 +3,71 @@ require 'spec_helper'
|
|||||||
describe '{{cookiecutter.project_name}}::db::mysql' do
|
describe '{{cookiecutter.project_name}}::db::mysql' do
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
[
|
'include mysql::server'
|
||||||
'include mysql::server',
|
|
||||||
'include {{cookiecutter.project_name}}::db::sync'
|
|
||||||
]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
let :facts do
|
let :required_params do
|
||||||
{ :osfamily => 'Debian' }
|
{ :password => 'fooboozoo_default_password', }
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
shared_examples_for '{{cookiecutter.project_name}}-db-mysql' do
|
||||||
{
|
context 'with only required params' do
|
||||||
'password' => 'fooboozoo_default_password',
|
let :params do
|
||||||
}
|
required_params
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_openstacklib__db__mysql('{{cookiecutter.project_name}}').with(
|
||||||
|
:user => '{{cookiecutter.project_name}}',
|
||||||
|
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
||||||
|
:dbname => '{{cookiecutter.project_name}}',
|
||||||
|
:host => '127.0.0.1',
|
||||||
|
:charset => 'utf8',
|
||||||
|
:collate => 'utf8_general_ci',
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'overriding allowed_hosts param to array' do
|
||||||
|
let :params do
|
||||||
|
{ :allowed_hosts => ['127.0.0.1','%'] }.merge(required_params)
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_openstacklib__db__mysql('{{cookiecutter.project_name}}').with(
|
||||||
|
:user => '{{cookiecutter.project_name}}',
|
||||||
|
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
||||||
|
:dbname => '{{cookiecutter.project_name}}',
|
||||||
|
:host => '127.0.0.1',
|
||||||
|
:charset => 'utf8',
|
||||||
|
:collate => 'utf8_general_ci',
|
||||||
|
:allowed_hosts => ['127.0.0.1','%']
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'overriding allowed_hosts param to string' do
|
||||||
|
let :params do
|
||||||
|
{ :allowed_hosts => '192.168.1.1' }.merge(required_params)
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_openstacklib__db__mysql('{{cookiecutter.project_name}}').with(
|
||||||
|
:user => '{{cookiecutter.project_name}}',
|
||||||
|
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
||||||
|
:dbname => '{{cookiecutter.project_name}}',
|
||||||
|
:host => '127.0.0.1',
|
||||||
|
:charset => 'utf8',
|
||||||
|
:collate => 'utf8_general_ci',
|
||||||
|
:allowed_hosts => '192.168.1.1'
|
||||||
|
)}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'with only required params' do
|
on_supported_os({
|
||||||
it { is_expected.to contain_openstacklib__db__mysql('{{cookiecutter.project_name}}').with(
|
:supported_os => OSDefaults.get_supported_os
|
||||||
:user => '{{cookiecutter.project_name}}',
|
}).each do |os,facts|
|
||||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
context "on #{os}" do
|
||||||
:dbname => '{{cookiecutter.project_name}}',
|
let (:facts) do
|
||||||
:host => '127.0.0.1',
|
facts.merge!(OSDefaults.get_facts())
|
||||||
:charset => 'utf8',
|
end
|
||||||
:collate => 'utf8_general_ci',
|
|
||||||
)}
|
it_behaves_like '{{cookiecutter.project_name}}-db-mysql'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "overriding allowed_hosts param to array" do
|
|
||||||
before { params.merge!( :allowed_hosts => ['127.0.0.1','%'] ) }
|
|
||||||
|
|
||||||
it { is_expected.to contain_openstacklib__db__mysql('{{cookiecutter.project_name}}').with(
|
|
||||||
:user => '{{cookiecutter.project_name}}',
|
|
||||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
|
||||||
:dbname => '{{cookiecutter.project_name}}',
|
|
||||||
:host => '127.0.0.1',
|
|
||||||
:charset => 'utf8',
|
|
||||||
:collate => 'utf8_general_ci',
|
|
||||||
:allowed_hosts => ['127.0.0.1','%']
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
describe "overriding allowed_hosts param to string" do
|
|
||||||
before { params.merge!( :allowed_hosts => '192.168.1.1' ) }
|
|
||||||
|
|
||||||
it { is_expected.to contain_openstacklib__db__mysql('{{cookiecutter.project_name}}').with(
|
|
||||||
:user => '{{cookiecutter.project_name}}',
|
|
||||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
|
||||||
:dbname => '{{cookiecutter.project_name}}',
|
|
||||||
:host => '127.0.0.1',
|
|
||||||
:charset => 'utf8',
|
|
||||||
:collate => 'utf8_general_ci',
|
|
||||||
:allowed_hosts => '192.168.1.1'
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -2,26 +2,18 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe '{{cookiecutter.project_name}}::db::postgresql' do
|
describe '{{cookiecutter.project_name}}::db::postgresql' do
|
||||||
|
|
||||||
let :req_params do
|
|
||||||
{ :password => 'pw' }
|
|
||||||
end
|
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
'include postgresql::server'
|
'include postgresql::server'
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on a RedHat osfamily' do
|
let :required_params do
|
||||||
let :facts do
|
{ :password => 'pw' }
|
||||||
{
|
end
|
||||||
:osfamily => 'RedHat',
|
|
||||||
:operatingsystemrelease => '7.0',
|
|
||||||
:concat_basedir => '/var/lib/puppet/concat'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
|
shared_examples_for '{{cookiecutter.project_name}}-db-postgresql' do
|
||||||
context 'with only required parameters' do
|
context 'with only required parameters' do
|
||||||
let :params do
|
let :params do
|
||||||
req_params
|
required_params
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_postgresql__server__db('{{cookiecutter.project_name}}').with(
|
it { is_expected.to contain_postgresql__server__db('{{cookiecutter.project_name}}').with(
|
||||||
@ -29,30 +21,17 @@ describe '{{cookiecutter.project_name}}::db::postgresql' do
|
|||||||
:password => 'md5c530c33636c58ae83ca933f39319273e'
|
:password => 'md5c530c33636c58ae83ca933f39319273e'
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on a Debian osfamily' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
{
|
}).each do |os,facts|
|
||||||
:operatingsystemrelease => '7.8',
|
context "on #{os}" do
|
||||||
:operatingsystem => 'Debian',
|
let (:facts) do
|
||||||
:osfamily => 'Debian',
|
facts.merge!(OSDefaults.get_facts({ :concat_basedir => '/var/lib/puppet/concat' }))
|
||||||
:concat_basedir => '/var/lib/puppet/concat'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with only required parameters' do
|
|
||||||
let :params do
|
|
||||||
req_params
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_postgresql__server__db('{{cookiecutter.project_name}}').with(
|
it_behaves_like '{{cookiecutter.project_name}}-db-postgresql'
|
||||||
:user => '{{cookiecutter.project_name}}',
|
|
||||||
:password => 'md5c530c33636c58ae83ca933f39319273e'
|
|
||||||
)}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -71,17 +71,7 @@ describe '{{cookiecutter.project_name}}::db' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
shared_examples_for '{{cookiecutter.project_name}}::db on Debian' do
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({
|
|
||||||
:osfamily => 'Debian',
|
|
||||||
:operatingsystem => 'Debian',
|
|
||||||
:operatingsystemrelease => 'jessie',
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures '{{cookiecutter.project_name}}::db'
|
|
||||||
|
|
||||||
context 'using pymysql driver' do
|
context 'using pymysql driver' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :database_connection => 'mysql+pymysql://{{cookiecutter.project_name}}:{{cookiecutter.project_name}}@localhost/{{cookiecutter.project_name}}', }
|
{ :database_connection => 'mysql+pymysql://{{cookiecutter.project_name}}:{{cookiecutter.project_name}}@localhost/{{cookiecutter.project_name}}', }
|
||||||
@ -97,16 +87,7 @@ describe '{{cookiecutter.project_name}}::db' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Redhat platforms' do
|
shared_examples_for '{{cookiecutter.project_name}}::db on RedHat' do
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({
|
|
||||||
:osfamily => 'RedHat',
|
|
||||||
:operatingsystemrelease => '7.1',
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures '{{cookiecutter.project_name}}::db'
|
|
||||||
|
|
||||||
context 'using pymysql driver' do
|
context 'using pymysql driver' do
|
||||||
let :params do
|
let :params do
|
||||||
{ :database_connection => 'mysql+pymysql://{{cookiecutter.project_name}}:{{cookiecutter.project_name}}@localhost/{{cookiecutter.project_name}}', }
|
{ :database_connection => 'mysql+pymysql://{{cookiecutter.project_name}}:{{cookiecutter.project_name}}@localhost/{{cookiecutter.project_name}}', }
|
||||||
@ -118,4 +99,16 @@ describe '{{cookiecutter.project_name}}::db' do
|
|||||||
end
|
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
|
||||||
|
|
||||||
|
it_configures '{{cookiecutter.project_name}}::db'
|
||||||
|
it_configures "{{cookiecutter.project_name}}::db on #{facts[:osfamily]}"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,116 +5,124 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe '{{cookiecutter.project_name}}::keystone::auth' do
|
describe '{{cookiecutter.project_name}}::keystone::auth' do
|
||||||
|
shared_examples_for '{{cookiecutter.project_name}}-keystone-auth' do
|
||||||
|
context 'with default class parameters' do
|
||||||
|
let :params do
|
||||||
|
{ :password => '{{cookiecutter.project_name}}_password',
|
||||||
|
:tenant => 'foobar' }
|
||||||
|
end
|
||||||
|
|
||||||
let :facts do
|
it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}').with(
|
||||||
{ :osfamily => 'Debian' }
|
:ensure => 'present',
|
||||||
end
|
:password => '{{cookiecutter.project_name}}_password',
|
||||||
|
) }
|
||||||
|
|
||||||
describe 'with default class parameters' do
|
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@foobar').with(
|
||||||
let :params do
|
:ensure => 'present',
|
||||||
{ :password => '{{cookiecutter.project_name}}_password',
|
:roles => ['admin']
|
||||||
:tenant => 'foobar' }
|
)}
|
||||||
|
|
||||||
|
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:description => '{{cookiecutter.project_name}} FIXME Service'
|
||||||
|
) }
|
||||||
|
|
||||||
|
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}::FIXME').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:public_url => 'http://127.0.0.1:FIXME',
|
||||||
|
:admin_url => 'http://127.0.0.1:FIXME',
|
||||||
|
:internal_url => 'http://127.0.0.1:FIXME',
|
||||||
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}').with(
|
context 'when overriding URL parameters' do
|
||||||
:ensure => 'present',
|
let :params do
|
||||||
:password => '{{cookiecutter.project_name}}_password',
|
{ :password => '{{cookiecutter.project_name}}_password',
|
||||||
) }
|
:public_url => 'https://10.10.10.10:80',
|
||||||
|
:internal_url => 'http://10.10.10.11:81',
|
||||||
|
:admin_url => 'http://10.10.10.12:81', }
|
||||||
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@foobar').with(
|
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}::FIXME').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:roles => ['admin']
|
|
||||||
)}
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:description => '{{cookiecutter.project_name}} FIXME Service'
|
|
||||||
) }
|
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}::FIXME').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:public_url => 'http://127.0.0.1:FIXME',
|
|
||||||
:admin_url => 'http://127.0.0.1:FIXME',
|
|
||||||
:internal_url => 'http://127.0.0.1:FIXME',
|
|
||||||
) }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when overriding URL parameters' do
|
|
||||||
let :params do
|
|
||||||
{ :password => '{{cookiecutter.project_name}}_password',
|
|
||||||
:public_url => 'https://10.10.10.10:80',
|
:public_url => 'https://10.10.10.10:80',
|
||||||
:internal_url => 'http://10.10.10.11:81',
|
:internal_url => 'http://10.10.10.11:81',
|
||||||
:admin_url => 'http://10.10.10.12:81', }
|
:admin_url => 'http://10.10.10.12:81',
|
||||||
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}::FIXME').with(
|
context 'when overriding auth name' do
|
||||||
:ensure => 'present',
|
let :params do
|
||||||
:public_url => 'https://10.10.10.10:80',
|
{ :password => 'foo',
|
||||||
:internal_url => 'http://10.10.10.11:81',
|
:auth_name => '{{cookiecutter.project_name}}y' }
|
||||||
:admin_url => 'http://10.10.10.12:81',
|
end
|
||||||
) }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when overriding auth name' do
|
it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}y') }
|
||||||
let :params do
|
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}y@services') }
|
||||||
{ :password => 'foo',
|
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}y::FIXME') }
|
||||||
:auth_name => '{{cookiecutter.project_name}}y' }
|
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}y::FIXME') }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}y') }
|
context 'when overriding service name' do
|
||||||
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}y@services') }
|
let :params do
|
||||||
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}y::FIXME') }
|
{ :service_name => '{{cookiecutter.project_name}}_service',
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}y::FIXME') }
|
:auth_name => '{{cookiecutter.project_name}}',
|
||||||
end
|
:password => '{{cookiecutter.project_name}}_password' }
|
||||||
|
end
|
||||||
|
|
||||||
describe 'when overriding service name' do
|
it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}') }
|
||||||
let :params do
|
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@services') }
|
||||||
{ :service_name => '{{cookiecutter.project_name}}_service',
|
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}_service::FIXME') }
|
||||||
:auth_name => '{{cookiecutter.project_name}}',
|
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}_service::FIXME') }
|
||||||
:password => '{{cookiecutter.project_name}}_password' }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_user('{{cookiecutter.project_name}}') }
|
context 'when disabling user configuration' do
|
||||||
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@services') }
|
|
||||||
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}_service::FIXME') }
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/{{cookiecutter.project_name}}_service::FIXME') }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when disabling user configuration' do
|
let :params do
|
||||||
|
{
|
||||||
|
:password => '{{cookiecutter.project_name}}_password',
|
||||||
|
:configure_user => false
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.not_to contain_keystone_user('{{cookiecutter.project_name}}') }
|
||||||
|
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@services') }
|
||||||
|
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:description => '{{cookiecutter.project_name}} FIXME Service'
|
||||||
|
) }
|
||||||
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:password => '{{cookiecutter.project_name}}_password',
|
|
||||||
:configure_user => false
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.not_to contain_keystone_user('{{cookiecutter.project_name}}') }
|
context 'when disabling user and user role configuration' do
|
||||||
it { is_expected.to contain_keystone_user_role('{{cookiecutter.project_name}}@services') }
|
|
||||||
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:description => '{{cookiecutter.project_name}} FIXME Service'
|
|
||||||
) }
|
|
||||||
|
|
||||||
end
|
let :params do
|
||||||
|
{
|
||||||
|
:password => '{{cookiecutter.project_name}}_password',
|
||||||
|
:configure_user => false,
|
||||||
|
:configure_user_role => false
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
describe 'when disabling user and user role configuration' do
|
it { is_expected.not_to contain_keystone_user('{{cookiecutter.project_name}}') }
|
||||||
|
it { is_expected.not_to contain_keystone_user_role('{{cookiecutter.project_name}}@services') }
|
||||||
|
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:description => '{{cookiecutter.project_name}} FIXME Service'
|
||||||
|
) }
|
||||||
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:password => '{{cookiecutter.project_name}}_password',
|
|
||||||
:configure_user => false,
|
|
||||||
:configure_user_role => false
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.not_to contain_keystone_user('{{cookiecutter.project_name}}') }
|
|
||||||
it { is_expected.not_to contain_keystone_user_role('{{cookiecutter.project_name}}@services') }
|
|
||||||
it { is_expected.to contain_keystone_service('{{cookiecutter.project_name}}::FIXME').with(
|
|
||||||
:ensure => 'present',
|
|
||||||
:description => '{{cookiecutter.project_name}} FIXME Service'
|
|
||||||
) }
|
|
||||||
|
|
||||||
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 '{{cookiecutter.project_name}}-keystone-auth'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -128,20 +128,15 @@ describe '{{cookiecutter.project_name}}::logging' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
@default_facts.merge({ :osfamily => 'Debian' })
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts())
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like '{{cookiecutter.project_name}}-logging'
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures '{{cookiecutter.project_name}}-logging'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
|
||||||
let :facts do
|
|
||||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures '{{cookiecutter.project_name}}-logging'
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe '{{cookiecutter.project_name}}::policy' do
|
describe '{{cookiecutter.project_name}}::policy' do
|
||||||
|
shared_examples_for '{{cookiecutter.project_name}}-policies' do
|
||||||
shared_examples_for '{{cookiecutter.project_name}} policies' do
|
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:policy_path => '/etc/{{cookiecutter.project_name}}/policy.json',
|
:policy_path => '/etc/{{cookiecutter.project_name}}/policy.json',
|
||||||
@ -23,19 +22,15 @@ describe '{{cookiecutter.project_name}}::policy' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
on_supported_os({
|
||||||
let :facts do
|
:supported_os => OSDefaults.get_supported_os
|
||||||
{ :osfamily => 'Debian' }
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts())
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like '{{cookiecutter.project_name}}-policies'
|
||||||
end
|
end
|
||||||
|
|
||||||
it_configures '{{cookiecutter.project_name}} policies'
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'on RedHat platforms' do
|
|
||||||
let :facts do
|
|
||||||
{ :osfamily => 'RedHat' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it_configures '{{cookiecutter.project_name}} policies'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user