|
395 | 395 | {
|
396 | 396 | title: 'should set worker_processes',
|
397 | 397 | attr: 'worker_processes',
|
398 |
| - value: '4', |
| 398 | + value: 4, |
399 | 399 | match: 'worker_processes 4;'
|
400 | 400 | },
|
401 | 401 | {
|
|
407 | 407 | {
|
408 | 408 | title: 'should set worker_rlimit_nofile',
|
409 | 409 | attr: 'worker_rlimit_nofile',
|
410 |
| - value: '10000', |
| 410 | + value: 10000, |
411 | 411 | match: 'worker_rlimit_nofile 10000;'
|
412 | 412 | },
|
413 | 413 | {
|
|
464 | 464 | {
|
465 | 465 | title: 'should set worker_connections',
|
466 | 466 | attr: 'worker_connections',
|
467 |
| - value: '100', |
| 467 | + value: 100, |
468 | 468 | match: ' worker_connections 100;'
|
469 | 469 | },
|
470 | 470 | {
|
|
503 | 503 | value: 'eventport',
|
504 | 504 | match: %r{\s*use\s+eventport;}
|
505 | 505 | },
|
506 |
| - { |
507 |
| - title: 'should not set events_use', |
508 |
| - attr: 'events_use', |
509 |
| - value: false, |
510 |
| - notmatch: %r{use } |
511 |
| - }, |
512 | 506 | {
|
513 | 507 | title: 'should set access_log',
|
514 | 508 | attr: 'http_access_log',
|
|
686 | 680 | value: '/path/to/proxy.cache',
|
687 | 681 | match: %r{\s+proxy_cache_path\s+/path/to/proxy.cache levels=1 keys_zone=d2:100m max_size=500m inactive=20m;}
|
688 | 682 | },
|
689 |
| - { |
690 |
| - title: 'should not set proxy_cache_path', |
691 |
| - attr: 'proxy_cache_path', |
692 |
| - value: false, |
693 |
| - notmatch: %r{proxy_cache_path} |
694 |
| - }, |
695 | 683 | {
|
696 | 684 | title: 'should set fastcgi_cache_path',
|
697 | 685 | attr: 'fastcgi_cache_path',
|
698 | 686 | value: '/path/to/proxy.cache',
|
699 | 687 | match: %r{\s*fastcgi_cache_path\s+/path/to/proxy.cache levels=1 keys_zone=d3:100m max_size=500m inactive=20m;}
|
700 | 688 | },
|
701 |
| - { |
702 |
| - title: 'should not set fastcgi_cache_path', |
703 |
| - attr: 'fastcgi_cache_path', |
704 |
| - value: false, |
705 |
| - notmatch: %r{fastcgi_cache_path} |
706 |
| - }, |
707 | 689 | {
|
708 | 690 | title: 'should set fastcgi_cache_use_stale',
|
709 | 691 | attr: 'fastcgi_cache_use_stale',
|
710 | 692 | value: 'invalid_header',
|
711 | 693 | match: ' fastcgi_cache_use_stale invalid_header;'
|
712 | 694 | },
|
713 |
| - { |
714 |
| - title: 'should not set fastcgi_cache_use_stale', |
715 |
| - attr: 'fastcgi_cache_use_stale', |
716 |
| - value: false, |
717 |
| - notmatch: %r{fastcgi_cache_use_stale} |
718 |
| - }, |
719 | 695 | {
|
720 | 696 | title: 'should contain ordered appended directives from hash',
|
721 | 697 | attr: 'http_cfg_prepend',
|
|
906 | 882 | end
|
907 | 883 |
|
908 | 884 | context 'when proxy_cache_path is /path/to/proxy.cache and loader_files is 1000' do
|
909 |
| - let(:params) { { conf_dir: '/path/to/nginx', proxy_cache_path: '/path/to/proxy.cache', proxy_cache_loader_files: '1000' } } |
| 885 | + let(:params) do |
| 886 | + { |
| 887 | + conf_dir: '/path/to/nginx', |
| 888 | + proxy_cache_path: '/path/to/proxy.cache', |
| 889 | + proxy_cache_loader_files: 1000 |
| 890 | + } |
| 891 | + end |
910 | 892 | it { is_expected.to contain_file('/path/to/nginx/nginx.conf').with_content(%r{\s+proxy_cache_path\s+/path/to/proxy.cache levels=1 keys_zone=d2:100m max_size=500m inactive=20m loader_files=1000;}) }
|
911 | 893 | end
|
912 | 894 |
|
|
1085 | 1067 | it { is_expected.to contain_file('/etc/nginx/nginx.conf').with_content %r{^user www-data;} }
|
1086 | 1068 | end
|
1087 | 1069 |
|
1088 |
| - context 'when nginx_error_log_severity = invalid' do |
1089 |
| - let(:params) { { nginx_error_log_severity: 'invalid' } } |
1090 |
| - |
1091 |
| - it { expect { is_expected.to contain_class('nginx::config') }.to raise_error(Puppet::Error, %r{\$nginx_error_log_severity must be debug, info, notice, warn, error, crit, alert or emerg}) } |
1092 |
| - end |
1093 |
| - |
1094 | 1070 | context 'when log_dir is non-default' do
|
1095 | 1071 | let(:params) { { log_dir: '/foo/bar' } }
|
1096 | 1072 |
|
|
0 commit comments