|
308 | 308 | )}
|
309 | 309 | end
|
310 | 310 | context 'with skip_ssl_validation set to true' do
|
311 |
| - let(:params) {{ :skip_ssl_validation => true, |
| 311 | + let(:params) {{ :skip_ssl_validation => true, |
312 | 312 | :agent5_enable => true,
|
313 | 313 | }}
|
314 | 314 | it { should contain_concat__fragment('datadog header').with(
|
|
556 | 556 | )}
|
557 | 557 | end
|
558 | 558 | context 'with ganglia_host set to localhost and ganglia_port set to 12345' do
|
559 |
| - let(:params) {{ :ganglia_host => 'testhost', |
| 559 | + let(:params) {{ :ganglia_host => 'testhost', |
560 | 560 | :ganglia_port => '12345',
|
561 | 561 | :agent5_enable => true,
|
562 | 562 | }}
|
|
691 | 691 | )}
|
692 | 692 | end
|
693 | 693 | context 'with service_discovery enabled' do
|
694 |
| - let(:params) {{ :service_discovery_backend => 'docker', |
695 |
| - :sd_config_backend => 'etcd', |
696 |
| - :sd_backend_host => 'localhost', |
697 |
| - :sd_backend_port => '8080', |
| 694 | + let(:params) {{ :service_discovery_backend => 'docker', |
| 695 | + :sd_config_backend => 'etcd', |
| 696 | + :sd_backend_host => 'localhost', |
| 697 | + :sd_backend_port => '8080', |
698 | 698 | :sd_jmx_enable => true,
|
699 | 699 | :agent5_enable => true,
|
700 | 700 | }}
|
|
773 | 773 | )}
|
774 | 774 | end
|
775 | 775 |
|
| 776 | + context 'with data scrubbing disabled' do |
| 777 | + let(:params) {{ |
| 778 | + :process_enabled => true, |
| 779 | + :agent5_enable => true, |
| 780 | + :scrub_args => false |
| 781 | + }} |
| 782 | + it { should contain_concat__fragment('datadog footer').with( |
| 783 | + 'content' => /^process_agent_enabled: true\n/, |
| 784 | + )} |
| 785 | + it { should contain_concat__fragment('datadog process agent footer').with( |
| 786 | + 'content' => /^\[process.config\]\n/, |
| 787 | + )} |
| 788 | + it { should contain_concat__fragment('datadog process agent footer').with( |
| 789 | + 'content' => /^scrub_args: false\n/, |
| 790 | + )} |
| 791 | + it { should contain_concat__fragment('datadog process agent footer').with( |
| 792 | + 'content' => /^custom_sensitive_words: \n/, |
| 793 | + )} |
| 794 | + end |
| 795 | + |
| 796 | + context 'with data scrubbing enabled with custom sensitive_words' do |
| 797 | + let(:params) {{ |
| 798 | + :process_enabled => true, |
| 799 | + :agent5_enable => true, |
| 800 | + :custom_sensitive_words => ['consul_token','dd_key'] |
| 801 | + }} |
| 802 | + it { should contain_concat__fragment('datadog footer').with( |
| 803 | + 'content' => /^process_agent_enabled: true\n/, |
| 804 | + )} |
| 805 | + it { should contain_concat__fragment('datadog process agent footer').with( |
| 806 | + 'content' => /^\[process.config\]\n/, |
| 807 | + )} |
| 808 | + it { should contain_concat__fragment('datadog process agent footer').with( |
| 809 | + 'content' => /^scrub_args: true\n/, |
| 810 | + )} |
| 811 | + it { should contain_concat__fragment('datadog process agent footer').with( |
| 812 | + 'content' => /^custom_sensitive_words: consul_token,dd_key\n/, |
| 813 | + )} |
776 | 814 | end
|
| 815 | + |
| 816 | + end |
777 | 817 | end
|
778 | 818 |
|
779 | 819 | if DEBIAN_OS.include?(operatingsystem)
|
|
848 | 888 | it { should contain_file('/etc/datadog-agent/datadog.yaml').with(
|
849 | 889 | 'content' => /^\ \ enabled: disabled\n/,
|
850 | 890 | )}
|
| 891 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 892 | + 'content' => /^\ \ scrub_args: true\n/, |
| 893 | + )} |
| 894 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 895 | + 'content' => /^\ \ custom_sensitive_words: \[\]\n/, |
| 896 | + )} |
851 | 897 | end
|
852 | 898 | end
|
853 | 899 |
|
|
931 | 977 | )}
|
932 | 978 | end
|
933 | 979 | end
|
| 980 | + |
| 981 | + context 'with data scrubbing custom options' do |
| 982 | + context 'with data scrubbing disabled' do |
| 983 | + let(:params) {{ |
| 984 | + :process_enabled => true, |
| 985 | + :scrub_args => false |
| 986 | + }} |
| 987 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 988 | + 'content' => /^process_config:\n/, |
| 989 | + )} |
| 990 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 991 | + 'content' => /^\ \ enabled: 'true'\n/, |
| 992 | + )} |
| 993 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 994 | + 'content' => /^\ \ scrub_args: false\n/, |
| 995 | + )} |
| 996 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 997 | + 'content' => /^\ \ custom_sensitive_words: \[\]\n/, |
| 998 | + )} |
| 999 | + end |
| 1000 | + |
| 1001 | + context 'with data scrubbing enabled with custom sensitive_words' do |
| 1002 | + let(:params) {{ |
| 1003 | + :process_enabled => true, |
| 1004 | + :custom_sensitive_words => ['consul_token','dd_key'] |
| 1005 | + }} |
| 1006 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 1007 | + 'content' => /^process_config:\n/, |
| 1008 | + )} |
| 1009 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 1010 | + 'content' => /^\ \ enabled: 'true'\n/, |
| 1011 | + )} |
| 1012 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 1013 | + 'content' => /^\ \ scrub_args: true\n/, |
| 1014 | + )} |
| 1015 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 1016 | + 'content' => /^\ \ -\ consul_token\n/, |
| 1017 | + )} |
| 1018 | + it { should contain_file('/etc/datadog-agent/datadog.yaml').with( |
| 1019 | + 'content' => /^\ \ -\ dd_key\n/, |
| 1020 | + )} |
| 1021 | + |
| 1022 | + end |
| 1023 | + end |
934 | 1024 | end
|
935 | 1025 | end
|
936 | 1026 | end
|
|
0 commit comments