Skip to content

Commit

Permalink
add checks on system-probe.yaml in CWS spec
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Jan 25, 2024
1 parent 0461c8c commit b9a8072
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/security-agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,33 @@
end
end

it 'system-probe.yaml is created' do
expect(chef_run).to create_template('/etc/datadog-agent/system-probe.yaml')
end

it 'security-agent.yaml is created' do
expect(chef_run).to create_template('/etc/datadog-agent/security-agent.yaml')
end

it 'system-probe.yaml contains expected YAML configuration' do
expected_yaml = <<-EOF
runtime_security_config:
enabled: true
activity_dump:
enabled: true
system_probe_config:
enabled: false
bpf_debug: false
debug_port: 0
enable_conntrack: false
sysprobe_socket: '/opt/datadog-agent/run/sysprobe.sock'
EOF

expect(chef_run).to(render_file('/etc/datadog-agent/system-probe.yaml').with_content { |content|
expect(YAML.safe_load(content).to_json).to be_json_eql(YAML.safe_load(expected_yaml).to_json)
})
end

it 'security-agent.yaml contains expected YAML configuration' do
expected_yaml = <<-EOF
compliance_config:
Expand Down

0 comments on commit b9a8072

Please sign in to comment.