From aa836ef19e557efa50be2038db40e50d9fafe74c Mon Sep 17 00:00:00 2001 From: Xuanqi He Date: Tue, 10 Oct 2023 00:26:35 -0400 Subject: [PATCH] Change the mocked munge key content to a correct binary as we do in the config and update logic --- .../recipes/test/mock_munge_key.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cookbooks/aws-parallelcluster-slurm/recipes/test/mock_munge_key.rb b/cookbooks/aws-parallelcluster-slurm/recipes/test/mock_munge_key.rb index 2c256be359..5b79ad6b69 100644 --- a/cookbooks/aws-parallelcluster-slurm/recipes/test/mock_munge_key.rb +++ b/cookbooks/aws-parallelcluster-slurm/recipes/test/mock_munge_key.rb @@ -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