Skip to content

Commit

Permalink
Delete dupicate check on redhat_on_docker?, add checking of only if h…
Browse files Browse the repository at this point in the history
…eadnode
  • Loading branch information
hehe7318 committed Oct 3, 2023
1 parent 5f47cf4 commit b5fd54c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cookbooks/aws-parallelcluster-slurm/test/controls/munge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
end

control 'tag:config_munge_check_munge_key_exists' do
only_if { node['cluster']['scheduler'] == 'slurm' && !os_properties.redhat_on_docker? }
only_if { instance.head_node? && node['cluster']['scheduler'] == 'slurm' && !os_properties.redhat_on_docker? }

title 'Check if the munge key exists'
describe file('/etc/munge/munge.key') do
Expand All @@ -89,23 +89,23 @@
its('owner') { should eq node['cluster']['munge']['user'] }
its('group') { should eq node['cluster']['munge']['group'] }
end
end unless os_properties.redhat_on_docker?
end

control 'tag:config_munge_check_munge_key_content' do
only_if { node['cluster']['scheduler'] == 'slurm' && !os_properties.redhat_on_docker? }
only_if { instance.head_node? && 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?
end

control 'tag:config_munge_check_munge_key_error_messages' do
only_if { node['cluster']['scheduler'] == 'slurm' && !os_properties.redhat_on_docker? }
only_if { instance.head_node? && 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/ }
end
end unless os_properties.redhat_on_docker?
end

0 comments on commit b5fd54c

Please sign in to comment.