|
6 | 6 | let(:params) { {} }
|
7 | 7 |
|
8 | 8 | # rubocop:disable RSpec/MultipleMemoizedHelpers
|
9 |
| - on_supported_os.each do |os, facts| |
| 9 | + on_supported_os.each do |os, os_facts| |
10 | 10 | context "on #{os}" do
|
11 |
| - let(:facts) { facts.merge(concat_basedir: '/dne') } |
| 11 | + let(:facts) { os_facts.merge(concat_basedir: '/dne') } |
12 | 12 | let(:package) { 'unbound' }
|
13 | 13 | let(:conf_file) { "#{conf_dir}/unbound.conf" }
|
14 | 14 | let(:conf_d_dir) { "#{conf_dir}/conf.d" }
|
|
18 | 18 |
|
19 | 19 | pidfile = nil
|
20 | 20 |
|
21 |
| - case facts[:os]['family'] |
| 21 | + case os_facts[:os]['family'] |
22 | 22 | when 'Debian'
|
23 | 23 | pidfile = '/run/unbound.pid'
|
24 | 24 | let(:service) { 'unbound' }
|
|
54 | 54 | it { is_expected.to compile.with_all_deps }
|
55 | 55 | it { is_expected.to contain_class('unbound') }
|
56 | 56 |
|
57 |
| - it { is_expected.to contain_package(package) } if facts[:os]['family'] != 'OpenBSD' |
| 57 | + it { is_expected.to contain_package(package) } if os_facts[:os]['family'] != 'OpenBSD' |
58 | 58 | it { is_expected.to contain_service(service) }
|
59 | 59 | it { is_expected.to contain_concat(conf_file) }
|
60 | 60 | it { is_expected.to contain_file(conf_dir) }
|
61 | 61 | it { is_expected.to contain_file(conf_d_dir) }
|
62 | 62 | it { is_expected.to contain_file(keys_d_dir) }
|
63 | 63 | it { is_expected.to contain_file(hints_file) }
|
64 | 64 |
|
65 |
| - context 'on Linux', if: facts[:kernel] == 'Linux' do |
| 65 | + context 'on Linux', if: os_facts[:kernel] == 'Linux' do |
66 | 66 | it { is_expected.to contain_systemd__timer('roothints.timer') }
|
67 | 67 | end
|
68 | 68 |
|
|
118 | 118 | end
|
119 | 119 |
|
120 | 120 | context 'with access control configured' do
|
121 |
| - let(:facts) { facts.merge(unbound_version: '1.6.1') } |
| 121 | + let(:facts) { os_facts.merge(unbound_version: '1.6.1') } |
122 | 122 | let :params do
|
123 | 123 | {
|
124 | 124 | access_control: {
|
|
227 | 227 | end
|
228 | 228 |
|
229 | 229 | context 'subnetcache' do
|
230 |
| - let(:facts) { facts.merge(unbound_version: '1.6.1') } |
| 230 | + let(:facts) { os_facts.merge(unbound_version: '1.6.1') } |
231 | 231 |
|
232 | 232 | before { params.merge!(module_config: %w[subnetcache]) }
|
233 | 233 |
|
|
249 | 249 | end
|
250 | 250 |
|
251 | 251 | context 'subnetcache send-client-subnet' do
|
252 |
| - let(:facts) { facts.merge(unbound_version: '1.6.1') } |
| 252 | + let(:facts) { os_facts.merge(unbound_version: '1.6.1') } |
253 | 253 |
|
254 | 254 | before do
|
255 | 255 | params.merge!(
|
|
407 | 407 | end
|
408 | 408 |
|
409 | 409 | context 'ipsecmod disable' do
|
410 |
| - let(:facts) { facts.merge(unbound_version: '1.6.4') } |
| 410 | + let(:facts) { os_facts.merge(unbound_version: '1.6.4') } |
411 | 411 |
|
412 | 412 | before do
|
413 | 413 | params.merge!(
|
|
437 | 437 | end
|
438 | 438 |
|
439 | 439 | context 'ipsecmod default' do
|
440 |
| - let(:facts) { facts.merge(unbound_version: '1.6.4') } |
| 440 | + let(:facts) { os_facts.merge(unbound_version: '1.6.4') } |
441 | 441 |
|
442 | 442 | before do
|
443 | 443 | params.merge!(
|
|
466 | 466 | end
|
467 | 467 |
|
468 | 468 | context 'ipsecmod ipsecmod-hook' do
|
469 |
| - let(:facts) { facts.merge(unbound_version: '1.6.4') } |
| 469 | + let(:facts) { os_facts.merge(unbound_version: '1.6.4') } |
470 | 470 |
|
471 | 471 | before do
|
472 | 472 | params.merge!(
|
|
495 | 495 | end
|
496 | 496 |
|
497 | 497 | context 'ipsecmod ipsecmod_strict' do
|
498 |
| - let(:facts) { facts.merge(unbound_version: '1.6.4') } |
| 498 | + let(:facts) { os_facts.merge(unbound_version: '1.6.4') } |
499 | 499 |
|
500 | 500 | before do
|
501 | 501 | params.merge!(
|
|
525 | 525 | end
|
526 | 526 |
|
527 | 527 | context 'ipsecmod ipsecmod_max_ttl' do
|
528 |
| - let(:facts) { facts.merge(unbound_version: '1.6.4') } |
| 528 | + let(:facts) { os_facts.merge(unbound_version: '1.6.4') } |
529 | 529 |
|
530 | 530 | before do
|
531 | 531 | params.merge!(
|
|
555 | 555 | end
|
556 | 556 |
|
557 | 557 | context 'ipsecmod ipsecmod-ignore-bogus' do
|
558 |
| - let(:facts) { facts.merge(unbound_version: '1.6.4') } |
| 558 | + let(:facts) { os_facts.merge(unbound_version: '1.6.4') } |
559 | 559 |
|
560 | 560 | before do
|
561 | 561 | params.merge!(
|
|
585 | 585 | end
|
586 | 586 |
|
587 | 587 | context 'ipsecmod ipsecmod-whitelist' do
|
588 |
| - let(:facts) { facts.merge(unbound_version: '1.6.4') } |
| 588 | + let(:facts) { os_facts.merge(unbound_version: '1.6.4') } |
589 | 589 |
|
590 | 590 | before do
|
591 | 591 | params.merge!(
|
|
893 | 893 | end
|
894 | 894 |
|
895 | 895 | context 'custom log_identity passed to class' do
|
896 |
| - let(:facts) { facts.merge(unbound_version: '1.6.1') } |
| 896 | + let(:facts) { os_facts.merge(unbound_version: '1.6.1') } |
897 | 897 | let(:params) { { log_identity: 'bind' } }
|
898 | 898 |
|
899 | 899 | it do
|
|
924 | 924 | end
|
925 | 925 |
|
926 | 926 | context 'custom log_replies passed to class' do
|
927 |
| - let(:facts) { facts.merge(unbound_version: '1.6.1') } |
| 927 | + let(:facts) { os_facts.merge(unbound_version: '1.6.1') } |
928 | 928 | let(:params) { { log_replies: true } }
|
929 | 929 |
|
930 | 930 | it do
|
|
951 | 951 |
|
952 | 952 | it { is_expected.to contain_service(service).with_restart("#{control_path} reload") }
|
953 | 953 |
|
954 |
| - case facts[:os]['family'] |
| 954 | + case os_facts[:os]['family'] |
955 | 955 | when 'FreeBSD'
|
956 | 956 | it { is_expected.to contain_exec('unbound-control-setup').with_command('/usr/local/sbin/unbound-control-setup -d /usr/local/etc/unbound') }
|
957 | 957 | when 'OpenBSD'
|
|
0 commit comments