From 240197fe3b12759bf6b913dda8956f1158e3ff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Can=C3=A9vet?= Date: Wed, 7 May 2014 16:35:31 +0200 Subject: [PATCH] Fix module usage with strict_variables --- .travis.yml | 1 + manifests/mod.pp | 2 ++ manifests/mod/proxy_html.pp | 1 + manifests/package.pp | 2 +- manifests/params.pp | 2 ++ manifests/vhost.pp | 2 ++ spec/classes/apache_spec.rb | 20 +++++++++++++++++ spec/classes/dev_spec.rb | 4 ++++ spec/classes/mod/auth_kerb_spec.rb | 15 +++++++++++++ spec/classes/mod/authnz_ldap_spec.rb | 11 ++++++++++ spec/classes/mod/dav_svn_spec.rb | 15 +++++++++++++ spec/classes/mod/deflate_spec.rb | 12 +++++++++++ spec/classes/mod/dev_spec.rb | 11 ++++++---- spec/classes/mod/dir_spec.rb | 15 +++++++++++++ spec/classes/mod/event_spec.rb | 15 +++++++++++++ spec/classes/mod/fastcgi_spec.rb | 11 ++++++++++ spec/classes/mod/fcgid_spec.rb | 15 ++++++++++++- spec/classes/mod/info_spec.rb | 20 +++++++++++++++++ spec/classes/mod/itk_spec.rb | 11 ++++++++++ spec/classes/mod/mime_magic_spec.rb | 16 ++++++++++++++ spec/classes/mod/mime_spec.rb | 9 ++++++++ spec/classes/mod/pagespeed_spec.rb | 11 ++++++++++ spec/classes/mod/passenger_spec.rb | 21 ++++++++++++++++++ spec/classes/mod/perl_spec.rb | 15 +++++++++++++ spec/classes/mod/peruser_spec.rb | 6 ++++++ spec/classes/mod/php_spec.rb | 15 +++++++++++++ spec/classes/mod/prefork_spec.rb | 15 +++++++++++++ spec/classes/mod/proxy_html_spec.rb | 22 ++++++++++++++++--- spec/classes/mod/python_spec.rb | 15 +++++++++++++ spec/classes/mod/rpaf_spec.rb | 11 ++++++++++ spec/classes/mod/speling_spec.rb | 11 ++++++++++ spec/classes/mod/ssl_spec.rb | 19 +++++++++++++++++ spec/classes/mod/status_spec.rb | 32 ++++++++++++++++++++++++++++ spec/classes/mod/suphp_spec.rb | 11 ++++++++++ spec/classes/mod/worker_spec.rb | 15 +++++++++++++ spec/classes/mod/wsgi_spec.rb | 15 +++++++++++++ spec/classes/params_spec.rb | 5 +++++ spec/classes/service_spec.rb | 13 +++++++++++ spec/defines/mod_spec.rb | 13 +++++++++++ spec/defines/vhost_spec.rb | 18 ++++++++++++++++ spec/spec_helper.rb | 16 ++++++++++++++ 41 files changed, 500 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7269dd139..1d00b8eb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ env: - PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" - PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" - PUPPET_GEM_VERSION="~> 3.0" + - PUPPET_GEM_VERSION="~> 3.5.0" STRICT_VARIABLES="yes" matrix: fast_finish: true exclude: diff --git a/manifests/mod.pp b/manifests/mod.pp index 69a081912..aa5ea3f3b 100644 --- a/manifests/mod.pp +++ b/manifests/mod.pp @@ -53,6 +53,8 @@ $_package = $package } elsif $mod_package { $_package = $mod_package + } else { + $_package = undef } if $_package and ! defined(Package[$_package]) { # note: FreeBSD/ports uses apxs tool to activate modules; apxs clutters diff --git a/manifests/mod/proxy_html.pp b/manifests/mod/proxy_html.pp index 69894f21c..549eb117f 100644 --- a/manifests/mod/proxy_html.pp +++ b/manifests/mod/proxy_html.pp @@ -6,6 +6,7 @@ case $::osfamily { /RedHat|FreeBSD/: { ::apache::mod { 'xml2enc': } + $loadfiles = undef } 'Debian': { $gnu_path = $::hardwaremodel ? { diff --git a/manifests/package.pp b/manifests/package.pp index b86167a39..a4e4015c5 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -1,7 +1,7 @@ class apache::package ( $ensure = 'present', $mpm_module = $::apache::params::mpm_module, -) { +) inherits ::apache::params { case $::osfamily { 'freebsd' : { $all_mpms = [ diff --git a/manifests/params.pp b/manifests/params.pp index f9e98623b..d272afb31 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -39,7 +39,9 @@ $conf_dir = "${httpd_dir}/conf" $confd_dir = "${httpd_dir}/conf.d" $mod_dir = "${httpd_dir}/conf.d" + $mod_enable_dir = undef $vhost_dir = "${httpd_dir}/conf.d" + $vhost_enable_dir = undef $conf_file = 'httpd.conf' $ports_file = "${conf_dir}/ports.conf" $logroot = '/var/log/httpd' diff --git a/manifests/vhost.pp b/manifests/vhost.pp index acb1bb50a..40edad7e2 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -327,6 +327,7 @@ $listen_addr_port = "${ip}:${port}" $nvh_addr_port = "${ip}:${port}" } else { + $listen_addr_port = undef $nvh_addr_port = $ip if ! $servername and ! $ip_based { fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters for name-based vhosts") @@ -337,6 +338,7 @@ $listen_addr_port = $port $nvh_addr_port = "${vhost_name}:${port}" } else { + $listen_addr_port = undef $nvh_addr_port = $name if ! $servername { fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters, and/or 'servername' parameter") diff --git a/spec/classes/apache_spec.rb b/spec/classes/apache_spec.rb index 5bf9851d4..f32fec808 100644 --- a/spec/classes/apache_spec.rb +++ b/spec/classes/apache_spec.rb @@ -4,8 +4,13 @@ context "on a Debian OS" do let :facts do { + :id => 'root', + :kernel => 'Linux', + :lsbdistcodename => 'squeeze', :osfamily => 'Debian', + :operatingsystem => 'Debian', :operatingsystemrelease => '6', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', :concat_basedir => '/dne', } end @@ -165,6 +170,7 @@ context "13.10" do let :facts do super().merge({ + :lsbdistrelease => '13.10', :operatingsystemrelease => '13.10' }) end @@ -173,6 +179,7 @@ context "12.04" do let :facts do super().merge({ + :lsbdistrelease => '12.04', :operatingsystemrelease => '12.04' }) end @@ -181,6 +188,7 @@ context "13.04" do let :facts do super().merge({ + :lsbdistrelease => '13.04', :operatingsystemrelease => '13.04' }) end @@ -191,9 +199,13 @@ context "on a RedHat 5 OS" do let :facts do { + :id => 'root', + :kernel => 'Linux', :osfamily => 'RedHat', + :operatingsystem => 'RedHat', :operatingsystemrelease => '5', :concat_basedir => '/dne', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -444,9 +456,13 @@ context "on a FreeBSD OS" do let :facts do { + :id => 'root', + :kernel => 'FreeBSD', :osfamily => 'FreeBSD', + :operatingsystem => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -516,9 +532,13 @@ context 'on all OSes' do let :facts do { + :id => 'root', + :kernel => 'Linux', :osfamily => 'RedHat', + :operatingsystem => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end context 'default vhost defaults' do diff --git a/spec/classes/dev_spec.rb b/spec/classes/dev_spec.rb index e3d7dee39..eceadca4a 100644 --- a/spec/classes/dev_spec.rb +++ b/spec/classes/dev_spec.rb @@ -4,7 +4,9 @@ context "on a Debian OS" do let :facts do { + :lsbdistcodename => 'squeeze', :osfamily => 'Debian', + :operatingsystem => 'Debian', :operatingsystemrelease => '6', } end @@ -17,6 +19,7 @@ let :facts do { :osfamily => 'RedHat', + :operatingsystem => 'RedHat', :operatingsystemrelease => '6', } end @@ -30,6 +33,7 @@ let :facts do { :osfamily => 'FreeBSD', + :operatingsystem => 'FreeBSD', :operatingsystemrelease => '9', } end diff --git a/spec/classes/mod/auth_kerb_spec.rb b/spec/classes/mod/auth_kerb_spec.rb index 670270d22..6e2c16b7e 100644 --- a/spec/classes/mod/auth_kerb_spec.rb +++ b/spec/classes/mod/auth_kerb_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::auth_kerb', :type => :class do let :pre_condition do 'include apache' @@ -5,8 +7,13 @@ context "on a Debian OS", :compile do let :facts do { + :id => 'root', + :kernel => 'Linux', + :lsbdistcodename => 'squeeze', :osfamily => 'Debian', + :operatingsystem => 'Debian', :operatingsystemrelease => '6', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', :concat_basedir => '/dne', } end @@ -17,8 +24,12 @@ context "on a RedHat OS", :compile do let :facts do { + :id => 'root', + :kernel => 'Linux', :osfamily => 'RedHat', + :operatingsystem => 'RedHat', :operatingsystemrelease => '6', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', :concat_basedir => '/dne', } end @@ -29,8 +40,12 @@ context "on a FreeBSD OS", :compile do let :facts do { + :id => 'root', + :kernel => 'FreeBSD', :osfamily => 'FreeBSD', + :operatingsystem => 'FreeBSD', :operatingsystemrelease => '9', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', :concat_basedir => '/dne', } end diff --git a/spec/classes/mod/authnz_ldap_spec.rb b/spec/classes/mod/authnz_ldap_spec.rb index c8e832d95..d9ca5398b 100644 --- a/spec/classes/mod/authnz_ldap_spec.rb +++ b/spec/classes/mod/authnz_ldap_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::authnz_ldap', :type => :class do let :pre_condition do 'include apache' @@ -6,9 +8,14 @@ context "on a Debian OS" do let :facts do { + :lsbdistcodename => 'squeeze', :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :id => 'root', + :kernel => 'Linux', + :operatingsystem => 'Debian', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -38,6 +45,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :id => 'root', + :kernel => 'Linux', + :operatingsystem => 'RedHat', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/dav_svn_spec.rb b/spec/classes/mod/dav_svn_spec.rb index fe11bb8cb..4898cdece 100644 --- a/spec/classes/mod/dav_svn_spec.rb +++ b/spec/classes/mod/dav_svn_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::dav_svn', :type => :class do let :pre_condition do 'include apache' @@ -5,9 +7,14 @@ context "on a Debian OS" do let :facts do { + :lsbdistcodename => 'squeeze', :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -20,6 +27,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -32,6 +43,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/deflate_spec.rb b/spec/classes/mod/deflate_spec.rb index 405d1a42b..f8eb88101 100644 --- a/spec/classes/mod/deflate_spec.rb +++ b/spec/classes/mod/deflate_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + # This function is called inside the OS specific contexts def general_deflate_specs it { should contain_apache__mod("deflate") } @@ -24,8 +26,12 @@ def general_deflate_specs context "On a Debian OS with default params" do let :facts do { + :id => 'root', + :lsbdistcodename => 'squeeze', :osfamily => 'Debian', + :operatingsystem => 'Debian', :operatingsystemrelease => '6', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', :concat_basedir => '/dne', } end @@ -46,8 +52,11 @@ def general_deflate_specs context "on a RedHat OS with default params" do let :facts do { + :id => 'root', :osfamily => 'RedHat', + :operatingsystem => 'RedHat', :operatingsystemrelease => '6', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', :concat_basedir => '/dne', } end @@ -61,8 +70,11 @@ def general_deflate_specs context "On a FreeBSD OS with default params" do let :facts do { + :id => 'root', :osfamily => 'FreeBSD', + :operatingsystem => 'FreeBSD', :operatingsystemrelease => '9', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', :concat_basedir => '/dne', } end diff --git a/spec/classes/mod/dev_spec.rb b/spec/classes/mod/dev_spec.rb index b72217aad..0de62afcb 100644 --- a/spec/classes/mod/dev_spec.rb +++ b/spec/classes/mod/dev_spec.rb @@ -1,10 +1,11 @@ require 'spec_helper' + describe 'apache::mod::dev', :type => :class do [ - ['RedHat', '6'], - ['Debian', '6'], - ['FreeBSD', '9'], - ].each do |osfamily, operatingsystemrelease| + ['RedHat', '6', 'Santiago'], + ['Debian', '6', 'squeeze'], + ['FreeBSD', '9', 'FreeBSD'], + ].each do |osfamily, operatingsystemrelease, lsbdistcodename| if osfamily == 'FreeBSD' let :pre_condition do 'include apache::package' @@ -13,7 +14,9 @@ context "on a #{osfamily} OS" do let :facts do { + :lsbdistcodename => lsbdistcodename, :osfamily => osfamily, + :operatingsystem => osfamily, :operatingsystemrelease => operatingsystemrelease, } end diff --git a/spec/classes/mod/dir_spec.rb b/spec/classes/mod/dir_spec.rb index b195eda0f..8bcdc0b6b 100644 --- a/spec/classes/mod/dir_spec.rb +++ b/spec/classes/mod/dir_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::dir', :type => :class do let :pre_condition do 'class { "apache": @@ -10,6 +12,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', + :lsbdistcodename => 'squeeze', } end context "passing no parameters" do @@ -37,6 +44,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'Redhat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end context "passing no parameters" do @@ -64,6 +75,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end context "passing no parameters" do diff --git a/spec/classes/mod/event_spec.rb b/spec/classes/mod/event_spec.rb index 6ae471ff3..850bd5c55 100644 --- a/spec/classes/mod/event_spec.rb +++ b/spec/classes/mod/event_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::event', :type => :class do let :pre_condition do 'class { "apache": mpm_module => false, }' @@ -8,6 +10,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -17,9 +23,14 @@ context "on a Debian OS" do let :facts do { + :lsbdistcodename => 'squeeze', :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -62,6 +73,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end diff --git a/spec/classes/mod/fastcgi_spec.rb b/spec/classes/mod/fastcgi_spec.rb index 8138bbab7..98ad2e870 100644 --- a/spec/classes/mod/fastcgi_spec.rb +++ b/spec/classes/mod/fastcgi_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::fastcgi', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -22,6 +29,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/fcgid_spec.rb b/spec/classes/mod/fcgid_spec.rb index df5da582e..16719415d 100644 --- a/spec/classes/mod/fcgid_spec.rb +++ b/spec/classes/mod/fcgid_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'apache::mod::fcgid' do +describe 'apache::mod::fcgid', :type => :class do let :pre_condition do 'include apache' end @@ -11,6 +11,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -24,6 +29,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -63,6 +72,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end diff --git a/spec/classes/mod/info_spec.rb b/spec/classes/mod/info_spec.rb index 21d253e98..ed078c519 100644 --- a/spec/classes/mod/info_spec.rb +++ b/spec/classes/mod/info_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + # This function is called inside the OS specific contexts def general_info_specs it { should contain_apache__mod("info") } @@ -25,6 +27,11 @@ def general_info_specs :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -47,6 +54,10 @@ def general_info_specs :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -62,6 +73,10 @@ def general_info_specs :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -80,6 +95,11 @@ def general_info_specs :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do diff --git a/spec/classes/mod/itk_spec.rb b/spec/classes/mod/itk_spec.rb index d431c5c76..d9fe2e3d1 100644 --- a/spec/classes/mod/itk_spec.rb +++ b/spec/classes/mod/itk_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::itk', :type => :class do let :pre_condition do 'class { "apache": mpm_module => false, }' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -49,6 +56,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/mime_magic_spec.rb b/spec/classes/mod/mime_magic_spec.rb index d10d8345b..e9984ecba 100644 --- a/spec/classes/mod/mime_magic_spec.rb +++ b/spec/classes/mod/mime_magic_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + # This function is called inside the OS specific contexts def general_mime_magic_specs it { should contain_apache__mod("mime_magic") } @@ -14,6 +16,11 @@ def general_mime_magic_specs :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -54,6 +61,10 @@ def general_mime_magic_specs :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -75,6 +86,11 @@ def general_mime_magic_specs :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end diff --git a/spec/classes/mod/mime_spec.rb b/spec/classes/mod/mime_spec.rb index 835a5a900..2b6154fb8 100644 --- a/spec/classes/mod/mime_spec.rb +++ b/spec/classes/mod/mime_spec.rb @@ -16,6 +16,11 @@ def general_mime_specs :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -31,6 +36,10 @@ def general_mime_specs :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end diff --git a/spec/classes/mod/pagespeed_spec.rb b/spec/classes/mod/pagespeed_spec.rb index 7480a2b52..9439f719e 100644 --- a/spec/classes/mod/pagespeed_spec.rb +++ b/spec/classes/mod/pagespeed_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::pagespeed', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -22,6 +29,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/passenger_spec.rb b/spec/classes/mod/passenger_spec.rb index 1821e0c71..3bf7d2995 100644 --- a/spec/classes/mod/passenger_spec.rb +++ b/spec/classes/mod/passenger_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::passenger', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -119,6 +126,8 @@ :operatingsystem => 'Ubuntu', :lsbdistrelease => '12.04', :concat_basedir => '/dne', + :id => 'root', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -135,6 +144,8 @@ :operatingsystem => 'Ubuntu', :lsbdistrelease => '14.04', :concat_basedir => '/dne', + :id => 'root', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -151,6 +162,8 @@ :operatingsystem => 'Debian', :lsbdistcodename => 'wheezy', :concat_basedir => '/dne', + :id => 'root', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -166,6 +179,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -200,6 +217,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/perl_spec.rb b/spec/classes/mod/perl_spec.rb index 3cb7a3e67..f674318e2 100644 --- a/spec/classes/mod/perl_spec.rb +++ b/spec/classes/mod/perl_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::perl', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -20,6 +27,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -32,6 +43,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/peruser_spec.rb b/spec/classes/mod/peruser_spec.rb index 062905ccc..e1ee004e9 100644 --- a/spec/classes/mod/peruser_spec.rb +++ b/spec/classes/mod/peruser_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::peruser', :type => :class do let :pre_condition do 'class { "apache": mpm_module => false, }' @@ -8,6 +10,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/php_spec.rb b/spec/classes/mod/php_spec.rb index e228dd781..cba128a82 100644 --- a/spec/classes/mod/php_spec.rb +++ b/spec/classes/mod/php_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::php', :type => :class do describe "on a Debian OS" do let :facts do @@ -5,6 +7,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end context "with mpm_module => prefork" do @@ -33,6 +40,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end context "with default params" do @@ -101,6 +112,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end context "with mpm_module => prefork" do diff --git a/spec/classes/mod/prefork_spec.rb b/spec/classes/mod/prefork_spec.rb index 9ef49d78f..847aecf9c 100644 --- a/spec/classes/mod/prefork_spec.rb +++ b/spec/classes/mod/prefork_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::prefork', :type => :class do let :pre_condition do 'class { "apache": mpm_module => false, }' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -49,6 +56,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -90,6 +101,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/proxy_html_spec.rb b/spec/classes/mod/proxy_html_spec.rb index 000a24e2f..77e1ab15d 100644 --- a/spec/classes/mod/proxy_html_spec.rb +++ b/spec/classes/mod/proxy_html_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::proxy_html', :type => :class do let :pre_condition do [ @@ -14,9 +16,15 @@ end let :facts do { - :osfamily => 'Debian', - :concat_basedir => '/dne', - :architecture => 'i386' + :osfamily => 'Debian', + :concat_basedir => '/dne', + :architecture => 'i386', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', + :hardwaremodel => 'i386', } end @@ -48,6 +56,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -60,6 +72,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/python_spec.rb b/spec/classes/mod/python_spec.rb index 9042d0f1b..d2d1fca7b 100644 --- a/spec/classes/mod/python_spec.rb +++ b/spec/classes/mod/python_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::python', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -20,6 +27,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -32,6 +43,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/rpaf_spec.rb b/spec/classes/mod/rpaf_spec.rb index d9c9015ab..949dd5702 100644 --- a/spec/classes/mod/rpaf_spec.rb +++ b/spec/classes/mod/rpaf_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::rpaf', :type => :class do let :pre_condition do [ @@ -10,6 +12,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -45,6 +52,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/speling_spec.rb b/spec/classes/mod/speling_spec.rb index 987291a3f..e7e6e1d64 100644 --- a/spec/classes/mod/speling_spec.rb +++ b/spec/classes/mod/speling_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::speling', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_apache__mod('speling') } @@ -19,6 +26,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_apache__mod('speling') } diff --git a/spec/classes/mod/ssl_spec.rb b/spec/classes/mod/ssl_spec.rb index 45005a191..11e7964de 100644 --- a/spec/classes/mod/ssl_spec.rb +++ b/spec/classes/mod/ssl_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::ssl', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,10 @@ :osfamily => 'Magic', :operatingsystemrelease => '0', :concat_basedir => '/dne', + :operatingsystem => 'Magic', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { expect { subject }.to raise_error(Puppet::Error, /Unsupported osfamily:/) } @@ -19,6 +25,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class('apache::params') } @@ -32,6 +42,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class('apache::params') } @@ -45,6 +60,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class('apache::params') } diff --git a/spec/classes/mod/status_spec.rb b/spec/classes/mod/status_spec.rb index 0a0658879..5023bc7bf 100644 --- a/spec/classes/mod/status_spec.rb +++ b/spec/classes/mod/status_spec.rb @@ -31,6 +31,11 @@ def status_conf_spec(allow_from, extended_status) :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -56,6 +61,10 @@ def status_conf_spec(allow_from, extended_status) :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -73,6 +82,11 @@ def status_conf_spec(allow_from, extended_status) :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do @@ -92,6 +106,11 @@ def status_conf_spec(allow_from, extended_status) :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do @@ -110,6 +129,10 @@ def status_conf_spec(allow_from, extended_status) :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do @@ -130,6 +153,11 @@ def status_conf_spec(allow_from, extended_status) :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do @@ -150,6 +178,10 @@ def status_conf_spec(allow_from, extended_status) :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do diff --git a/spec/classes/mod/suphp_spec.rb b/spec/classes/mod/suphp_spec.rb index 382314d9a..cb91997ac 100644 --- a/spec/classes/mod/suphp_spec.rb +++ b/spec/classes/mod/suphp_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::suphp', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -19,6 +26,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/worker_spec.rb b/spec/classes/mod/worker_spec.rb index a8176c570..3c9c1cf24 100644 --- a/spec/classes/mod/worker_spec.rb +++ b/spec/classes/mod/worker_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::worker', :type => :class do let :pre_condition do 'class { "apache": mpm_module => false, }' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -49,6 +56,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -90,6 +101,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/mod/wsgi_spec.rb b/spec/classes/mod/wsgi_spec.rb index 44917cb88..d4c391a29 100644 --- a/spec/classes/mod/wsgi_spec.rb +++ b/spec/classes/mod/wsgi_spec.rb @@ -1,3 +1,5 @@ +require 'spec_helper' + describe 'apache::mod::wsgi', :type => :class do let :pre_condition do 'include apache' @@ -8,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -20,6 +27,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } @@ -45,6 +56,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_class("apache::params") } diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb index de1108af0..eaa178c41 100644 --- a/spec/classes/params_spec.rb +++ b/spec/classes/params_spec.rb @@ -7,6 +7,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_apache__params } diff --git a/spec/classes/service_spec.rb b/spec/classes/service_spec.rb index 5419a6816..2cd075357 100644 --- a/spec/classes/service_spec.rb +++ b/spec/classes/service_spec.rb @@ -10,6 +10,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_service("httpd").with( @@ -86,6 +91,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '5', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_service("httpd").with( @@ -102,6 +111,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end it { should contain_service("httpd").with( diff --git a/spec/defines/mod_spec.rb b/spec/defines/mod_spec.rb index bbc5f0bdc..e6d521409 100644 --- a/spec/defines/mod_spec.rb +++ b/spec/defines/mod_spec.rb @@ -10,6 +10,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -48,6 +52,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end @@ -83,6 +92,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index fde65d1f2..4037b3011 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -20,6 +20,10 @@ :osfamily => 'RedHat', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :operatingsystem => 'RedHat', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do default_params end @@ -33,6 +37,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do default_params end @@ -55,6 +64,10 @@ :osfamily => 'FreeBSD', :operatingsystemrelease => '9', :concat_basedir => '/dne', + :operatingsystem => 'FreeBSD', + :id => 'root', + :kernel => 'FreeBSD', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end let :params do default_params end @@ -73,6 +86,11 @@ :osfamily => 'Debian', :operatingsystemrelease => '6', :concat_basedir => '/dne', + :lsbdistcodename => 'squeeze', + :operatingsystem => 'Debian', + :id => 'root', + :kernel => 'Linux', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', } end describe 'basic assumptions' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f880d274d..65379ee38 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,22 @@ RSpec.configure do |c| c.treat_symbols_as_metadata_keys_with_true_values = true + + c.before :each do + # Ensure that we don't accidentally cache facts and environment + # between test cases. + Facter::Util::Loader.any_instance.stubs(:load_all) + Facter.clear + Facter.clear_messages + + # Store any environment variables away to be restored later + @old_env = {} + ENV.each_key {|k| @old_env[k] = ENV[k]} + + if ENV['STRICT_VARIABLES'] == 'yes' + Puppet.settings[:strict_variables]=true + end + end end shared_examples :compile, :compile => true do