Commit 9caef0ac authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Check proper setup of chef-client.timer and chef-client.service

parent be0a1c49
......@@ -2,7 +2,7 @@
# Cookbook Name:: sys
# Serverspec integration tests for sys::chef
#
# Copyright 2020 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
# Copyright 2020-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
#
# Authors:
# Christopher Huhn <C.Huhn@gsi.de>
......@@ -39,7 +39,20 @@ context 'chef-client config' do
end
end
describe service 'chef-client.timer' do
it { should be_running }
it { should be_enabled }
context 'not on Stretch', if: os[:release].to_i >= 10 || os[:family] != 'debian' do
# this check fails on Stretch:
describe service 'chef-client.timer' do
it { should be_running }
it { should be_enabled }
end
end
describe service 'chef-client.service' do
it { should_not be_running } # oneshot servive
it { should_not be_enabled } # triggered by timer
end
describe command 'systemctl status chef-client.service' do
# chef should not be running in daemon mode:
its(:stdout) { should_not match %r{/usr/bin/chef-client\s(.*\s)?-d\s} }
end
Supports Markdown
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