spec fixes

This commit is contained in:
Matthew Haughton 2014-09-21 01:27:35 -04:00
parent 4c5f1e3b2a
commit 00ec3f4e35
7 changed files with 20 additions and 33 deletions

View file

@ -5,3 +5,4 @@ fixtures:
apt: "puppetlabs/apt"
concat: "puppetlabs/concat"
stdlib: "puppetlabs/stdlib"
module_data: "ripienaar/module_data"

View file

@ -12,28 +12,28 @@ nginx::config::types_hash_max_size: 1024
nginx::config::types_hash_bucket_size: 512
nginx::config::names_hash_bucket_size: 64
nginx::config::names_hash_max_size: 512
nginx::config::multi_accept: off
nginx::config::multi_accept: 'off'
nginx::config::events_use: false
nginx::config::sendfile: on
nginx::config::sendfile: 'on'
nginx::config::keepalive_timeout: 65
nginx::config::http_tcp_nodelay: on
nginx::config::http_tcp_nopush: off
nginx::config::gzip: on
nginx::config::server_tokens: on
nginx::config::spdy: off
nginx::config::ssl_stapling: off
nginx::config::proxy_redirect: off
nginx::config::http_tcp_nodelay: 'on'
nginx::config::http_tcp_nopush: 'off'
nginx::config::gzip: 'on'
nginx::config::server_tokens: 'on'
nginx::config::spdy: 'off'
nginx::config::ssl_stapling: 'off'
nginx::config::proxy_redirect: 'off'
nginx::config::proxy_set_header:
- 'Host $host'
- 'X-Real-IP $remote_addr'
- 'X-Forwarded-For $proxy_add_x_forwarded_for'
nginx::config::proxy_cache_path: false
nginx::config::proxy_cache_levels: 1
nginx::config::proxy_cache_levels: '1'
nginx::config::proxy_cache_keys_zone: 'd2:100m'
nginx::config::proxy_cache_max_size: 500m
nginx::config::proxy_cache_inactive: 20m
nginx::config::fastcgi_cache_path: false
nginx::config::fastcgi_cache_levels: 1
nginx::config::fastcgi_cache_levels: '1'
nginx::config::fastcgi_cache_keys_zone: 'd3:100m'
nginx::config::fastcgi_cache_max_size: 500m
nginx::config::fastcgi_cache_inactive: 20m
@ -43,13 +43,13 @@ nginx::config::client_body_temp_path: /var/nginx/client_body_temp
nginx::config::client_body_buffer_size: 128k
nginx::config::client_max_body_size: 10m
nginx::config::proxy_temp_path: /var/nginx/proxy_temp
nginx::config::proxy_connect_timeout: 90
nginx::config::proxy_send_timeout: 90
nginx::config::proxy_read_timeout: 90
nginx::config::proxy_connect_timeout: '90'
nginx::config::proxy_send_timeout: '90'
nginx::config::proxy_read_timeout: '90'
nginx::config::proxy_buffers: '32 4k'
nginx::config::proxy_http_version: 1.0
nginx::config::proxy_http_version: '1.0'
nginx::config::proxy_buffer_size: 8k
nginx::config::proxy_headers_hash_bucket_size: 64
nginx::config::proxy_headers_hash_bucket_size: '64'
nginx::config::logdir: /var/log/nginx
# Service restart after Nginx 0.7.53 could also be just

View file

@ -20,6 +20,7 @@ class nginx::config(
$confd_purge = undef,
$conf_dir = undef,
$conf_template = undef,
$configtest_enable = undef,
$daemon_user = undef,
$events_use = undef,
$fastcgi_cache_inactive = undef,
@ -58,6 +59,7 @@ class nginx::config(
$proxy_send_timeout = undef,
$proxy_set_header = undef,
$proxy_temp_path = undef,
$root_group = undef,
$run_dir = undef,
$sendfile = undef,
$server_tokens = undef,
@ -92,9 +94,6 @@ class nginx::config(
fail('$events_use must be a string or false.')
}
validate_string($multi_accept)
validate_string($package_name)
validate_string($package_ensure)
validate_string($package_source)
validate_array($proxy_set_header)
validate_string($proxy_http_version)
validate_bool($confd_purge)
@ -122,7 +121,6 @@ class nginx::config(
}
validate_bool($configtest_enable)
validate_string($service_restart)
validate_bool($mail)
validate_string($server_tokens)
validate_string($client_max_body_size)
@ -142,17 +140,9 @@ class nginx::config(
validate_string($nginx_error_log)
validate_string($http_access_log)
validate_hash($nginx_upstreams)
validate_hash($nginx_vhosts)
validate_hash($nginx_vhosts_defaults)
validate_hash($nginx_locations)
validate_hash($nginx_mailhosts)
validate_bool($manage_repo)
validate_string($proxy_headers_hash_bucket_size)
validate_bool($super_user)
validate_hash($string_mappings)
validate_hash($geo_mappings)
### END VALIDATIONS ###

View file

@ -54,8 +54,7 @@ define nginx::resource::upstream (
validate_hash($upstream_cfg_prepend)
}
include nginx::params
$root_group = $nginx::params::root_group
$root_group = $nginx::config::root_group
$ensure_real = $ensure ? {
'absent' => absent,

View file

@ -21,7 +21,6 @@ describe 'nginx' do
it { is_expected.to contain_nginx__service.that_subscribes_to('Class[nginx::package]') }
it { is_expected.to contain_nginx__service.that_subscribes_to('Class[nginx::config]') }
it { is_expected.to contain_anchor('nginx::end').that_requires('Class[nginx::service]') }
it { is_expected.to contain_class("nginx::params") }
it { is_expected.to contain_nginx__resource__upstream("upstream1") }
it { is_expected.to contain_nginx__resource__vhost("test2.local") }
it { is_expected.to contain_nginx__resource__vhost("test2.local").with_listen_options('default_server') }

View file

@ -4,7 +4,6 @@ describe 'nginx::package' do
shared_examples 'redhat' do |operatingsystem|
let(:facts) {{ :operatingsystem => operatingsystem, :osfamily => 'RedHat' }}
spec/classes/package_spec.rb
context "using defaults" do
it { is_expected.to contain_package('nginx') }
it { is_expected.to contain_yumrepo('nginx-release').with(

View file

@ -26,7 +26,6 @@ describe 'nginx::resource::map' do
let :pre_condition do
[
'include ::nginx::params',
'include ::nginx::config',
]
end