Skip to content

Commit

Permalink
Add only if condition in the slurm munge key kitchen tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hehe7318 committed Oct 3, 2023
1 parent 4c7d871 commit 5f47cf4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@
end

control 'tag:config_munge_check_munge_key_exists' do
title 'Check if the munge key exists'
only_if { node['cluster']['scheduler'] == 'slurm' && !os_properties.redhat_on_docker? }

title 'Check if the munge key exists'
describe file('/etc/munge/munge.key') do
it { should exist }
its('mode') { should cmp '0600' }
Expand All @@ -91,16 +92,18 @@
end unless os_properties.redhat_on_docker?

control 'tag:config_munge_check_munge_key_content' do
title 'Check if the munge key content is not empty'
only_if { node['cluster']['scheduler'] == 'slurm' && !os_properties.redhat_on_docker? }

title 'Check if the munge key content is not empty'
describe file('/etc/munge/munge.key') do
its('content') { should_not be_empty }
end
end unless os_properties.redhat_on_docker?

control 'tag:config_munge_check_munge_key_error_messages' do
title 'Check for error messages related to munge key'
only_if { node['cluster']['scheduler'] == 'slurm' && !os_properties.redhat_on_docker? }

title 'Check for error messages related to munge key'
describe file('/var/log/chef-client.log') do
its('content') { should_not match /Error fetching munge key/ }
its('content') { should_not match /Error decoding the munge key/ }
Expand Down

0 comments on commit 5f47cf4

Please sign in to comment.