Skip to content

Commit

Permalink
Change the mocked munge key content to a correct binary as we do in t…
Browse files Browse the repository at this point in the history
…he config and update logic
  • Loading branch information
hehe7318 committed Oct 10, 2023
1 parent 5f50e76 commit aa836ef
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions cookbooks/aws-parallelcluster-slurm/recipes/test/mock_munge_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
mode '0700'
end

file "#{munge_dir}/.munge.key" do
mode '0600'
content 'munge-key'
owner node['cluster']['munge']['user']
group node['cluster']['munge']['group']
bash "mock_munge_key" do
user 'root'
group 'root'
code <<-MOCK_KEY
set -e
munge_directory=#{munge_dir}
encoded_key='lWXJDxgGhJxIVqLdbaycUICm12u0gHtcDFslGGxJlyLoVIQJFuskDfkK8wjvQfhT5pkeyuxA+vjgg9R+E+ftPVTsVLHaf4bx3RmEfe30bZo79Yg+GhTRJRzV401/VaTlVEGFwMcJhmVKrXX/MbfnIdMwWNgCL8swUELbFOI4CG0='
decoded_key=$(echo $encoded_key | base64 -d)
echo "${decoded_key}" > ${munge_directory}/.munge.key
chmod 0600 ${munge_directory}/.munge.key
MOCK_KEY
end
end

0 comments on commit aa836ef

Please sign in to comment.