Unverified Commit a3e323fd authored by Xorima's avatar Xorima Committed by GitHub
Browse files

Merge branch 'master' into readmeMaintainers

parents 2e37381a 03cf40d8
# OSSEC Cookbook CHANGELOG
## UNRELEASED
- Add distro based authd service name
## v1.1.0 (13-08-2018)
- README Updates:
* Fix broken links
......
......@@ -39,6 +39,7 @@ if node['init_package'] == 'systemd'
end
service 'ossec-authd' do
service_name platform_family?('debian') ? 'ossec-authd' : 'ossec-hids-authd'
supports restart: true
action [:enable, :start]
subscribes :restart, 'template[ossec-authd init]'
......
require 'spec_helper'
require 'json'
describe 'ossec::authd' do
before do
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:exist?).with('/var/ossec/etc/sslmanager.cert').and_return(true)
allow(File).to receive(:exist?).with('/var/ossec/etc/sslmanager.key').and_return(true)
end
cached(:chef_run) do
ChefSpec::ServerRunner.new.converge('ossec::authd')
end
it 'includes ossec::install_server recipe' do
expect(chef_run).to include_recipe('ossec::install_server')
end
it 'includes ossec::common recipe' do
expect(chef_run).to include_recipe('ossec::common')
end
context 'systemd' do
it 'setup ossec-authd.service' do
expect(chef_run).to create_template('ossec-authd init')
end
it 'reload systemctl' do
execute = chef_run.execute('systemctl daemon-reload')
expect(execute).to subscribe_to('template[ossec-authd init]').on(:run).immediately
end
end
it 'enable & start ossec-authd service' do
expect(chef_run).to enable_service('ossec-authd')
expect(chef_run).to start_service('ossec-authd')
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment