mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
add apache cookbook to integration tests
This commit is contained in:
parent
a3eda1fcee
commit
03856d6941
4 changed files with 43 additions and 3 deletions
|
@ -4,7 +4,9 @@ maintainer 'Chef Software, Inc.'
|
|||
maintainer_email 'support@chef.io'
|
||||
description 'This cookbook prepares the test operating systems'
|
||||
version '1.0.0'
|
||||
|
||||
depends 'apt'
|
||||
depends 'yum'
|
||||
depends 'runit'
|
||||
depends 'postgresql'
|
||||
depends 'httpd', '~> 0.2'
|
||||
|
|
14
test/integration/cookbooks/os_prepare/recipes/apache.rb
Normal file
14
test/integration/cookbooks/os_prepare/recipes/apache.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
# encoding: utf-8
|
||||
# author: Christoph Hartmann
|
||||
|
||||
# install apache service
|
||||
case node['platform']
|
||||
when 'ubuntu', 'centos', 'amazon', 'fedora'
|
||||
|
||||
return if node['platform_version'] == "15.10"
|
||||
|
||||
httpd_service 'default' do
|
||||
action :create
|
||||
end
|
||||
|
||||
end
|
|
@ -4,12 +4,21 @@
|
|||
#
|
||||
# prepare all operating systems with the required configuration
|
||||
|
||||
include_recipe('os_prepare::apt')
|
||||
|
||||
# basic tests
|
||||
include_recipe('os_prepare::file')
|
||||
include_recipe('os_prepare::mount')
|
||||
include_recipe('os_prepare::json_yaml_csv_ini')
|
||||
include_recipe('os_prepare::service')
|
||||
include_recipe('os_prepare::package')
|
||||
include_recipe('os_prepare::registry_key')
|
||||
include_recipe('os_prepare::service')
|
||||
|
||||
# configure repos, eg. nginx
|
||||
include_recipe('os_prepare::apt')
|
||||
|
||||
# application configuration
|
||||
include_recipe('os_prepare::postgres')
|
||||
include_recipe('os_prepare::auditctl')
|
||||
include_recipe('os_prepare::apache')
|
||||
|
||||
# config file parsing
|
||||
include_recipe('os_prepare::json_yaml_csv_ini')
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
# encoding: utf-8
|
||||
|
||||
if os.linux?
|
||||
|
||||
# direct access to params of apache conf
|
||||
describe apache_conf do
|
||||
its('LogLevel') { should eq 'warn' }
|
||||
its('MaxKeepAliveRequests') { should eq '100' }
|
||||
end
|
||||
|
||||
# only read one param
|
||||
describe apache_conf.params('LogLevel') do
|
||||
it { should include 'warn' }
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue