From b5fd54c1d44663b8f4804113c2fb76d4854c32bd Mon Sep 17 00:00:00 2001 From: Xuanqi He Date: Tue, 3 Oct 2023 13:48:32 -0400 Subject: [PATCH] Delete dupicate check on redhat_on_docker?, add checking of only if headnode --- .../test/controls/munge_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cookbooks/aws-parallelcluster-slurm/test/controls/munge_spec.rb b/cookbooks/aws-parallelcluster-slurm/test/controls/munge_spec.rb index c893cec377..ea07167696 100644 --- a/cookbooks/aws-parallelcluster-slurm/test/controls/munge_spec.rb +++ b/cookbooks/aws-parallelcluster-slurm/test/controls/munge_spec.rb @@ -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 @@ -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