Skip to content

Commit

Permalink
make apache2 cookbook tests run on ubuntu and amazon linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Requena committed Jul 15, 2013
1 parent 98bc1ef commit 2c96154
Show file tree
Hide file tree
Showing 30 changed files with 298 additions and 33 deletions.
11 changes: 9 additions & 2 deletions apache2/specs/mod_alias_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
describe_recipe 'apache2::mod_alias' do
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end
it 'enables mod_alias' do
link("#{node[:apache][:dir]}/mods-enabled/alias.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/alias.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/alias.load")
end
end
10 changes: 9 additions & 1 deletion apache2/specs/mod_auth_basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
describe_recipe 'apache2::mod_auth_basic' do
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions
before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_auth_basic' do
link("#{node[:apache][:dir]}/mods-enabled/auth_basic.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/auth_basic.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/auth_basic.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_auth_digest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_auth_digest' do
link("#{node[:apache][:dir]}/mods-enabled/auth_digest.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/auth_digest.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/auth_digest.load")
end
end
10 changes: 9 additions & 1 deletion apache2/specs/mod_authn_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
describe_recipe 'apache2::mod_authn_file' do
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions
before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_authn_file' do
link("#{node[:apache][:dir]}/mods-enabled/authn_file.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/authn_file.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/authn_file.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_authnz_ldap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_authnz_ldap' do
link("#{node[:apache][:dir]}/mods-enabled/authnz_ldap.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/authnz_ldap.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/authnz_ldap.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_authz_default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_authz_default' do
link("#{node[:apache][:dir]}/mods-enabled/authz_default.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/authz_default.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/authz_default.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_authz_groupfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_authz_groupfile' do
link("#{node[:apache][:dir]}/mods-enabled/authz_groupfile.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/authz_groupfile.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/authz_groupfile.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_authz_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_authz_host' do
link("#{node[:apache][:dir]}/mods-enabled/authz_host.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/authz_host.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/authz_host.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_authz_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_authz_user' do
link("#{node[:apache][:dir]}/mods-enabled/authz_user.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/authz_user.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/authz_user.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_autoindex_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_autoindex' do
link("#{node[:apache][:dir]}/mods-enabled/autoindex.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/autoindex.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/autoindex.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_cgi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_cgi' do
link("#{node[:apache][:dir]}/mods-enabled/cgi.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/cgi.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/cgi.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_dav_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_dav' do
link("#{node[:apache][:dir]}/mods-enabled/dav.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/dav.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/dav.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_dav_svn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'installs svn dependencies' do
case node[:platform]
when 'centos','redhat','fedora','amazon'
Expand All @@ -15,6 +24,6 @@

it 'enables mod_dav_svn' do
link("#{node[:apache][:dir]}/mods-enabled/dav_svn.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/dav_svn.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/dav_svn.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_deflate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_deflate' do
link("#{node[:apache][:dir]}/mods-enabled/deflate.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/deflate.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/deflate.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_dir_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_dir' do
link("#{node[:apache][:dir]}/mods-enabled/dir.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/dir.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/dir.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_env_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_env' do
link("#{node[:apache][:dir]}/mods-enabled/env.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/env.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/env.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_expires_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_expires' do
link("#{node[:apache][:dir]}/mods-enabled/expires.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/expires.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/expires.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_fcgid_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_fcgid' do
link("#{node[:apache][:dir]}/mods-enabled/fcgid.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/fcgid.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/fcgid.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_headers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_headers' do
link("#{node[:apache][:dir]}/mods-enabled/headers.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/headers.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/headers.load")
end
end
11 changes: 10 additions & 1 deletion apache2/specs/mod_ldap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions

before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
end
end

it 'enables mod_ldap' do
link("#{node[:apache][:dir]}/mods-enabled/ldap.load").must_exist.with(
:link_type, :symbolic).and(:to, "#{node[:apache][:dir]}/mods-available/ldap.load")
:link_type, :symbolic).and(:to, "#{@prefix}/mods-available/ldap.load")
end
end
Loading

0 comments on commit 2c96154

Please sign in to comment.