From 9747b23719d0e154e9cd6774d960b267fcbd8200 Mon Sep 17 00:00:00 2001 From: Himani Anil Deshpande Date: Wed, 19 Mar 2025 15:17:42 -0400 Subject: [PATCH 1/2] Adding Ubuntu24 for kitchen tests for storage --- .../test/controls/cloudwatch_spec.rb | 3 ++- .../test/controls/sticky_bits_spec.rb | 2 +- .../test/controls/mysql_client_spec.rb | 2 +- test/environments/kitchen.rb | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb index 0d1f4783f1..db3a32909d 100644 --- a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb +++ b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb @@ -22,7 +22,8 @@ # In Ubuntu >20.04 due to environment variable the keyring is placed under home of the user ubuntu with the permission of root ubuntu2004 = os_properties.ubuntu2004? ubuntu2204 = os_properties.ubuntu2204? - keyring = (ubuntu2004 || ubuntu2204) && !os_properties.on_docker? ? '--keyring /home/ubuntu/.gnupg/pubring.kbx' : '' + ubuntu2404 = os_properties.ubuntu2404? + keyring = (ubuntu2004 || ubuntu2204 || ubuntu2404) && !os_properties.on_docker? ? '--keyring /home/ubuntu/.gnupg/pubring.kbx' : '' sudo = os_properties.redhat_on_docker? ? '' : 'sudo' describe bash("#{sudo} gpg --list-keys #{keyring}") do # Don't check exit status for Ubuntu20 because it returns 2 when executed in the validate phase of a created AMI diff --git a/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb b/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb index c72f192973..85fe91d98c 100644 --- a/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb @@ -1,7 +1,7 @@ control 'tag:config_sticky_bits_configured' do title 'Check sticky bits configuration' - if (os_properties.ubuntu2004? || os_properties.ubuntu2204?) && !os_properties.on_docker? + if (os_properties.ubuntu2004? || os_properties.ubuntu2204? || os_properties.ubuntu2404?) && !os_properties.on_docker? # This test passes on Mac but doesn't work as GitHub action. describe kernel_parameter('fs.protected_regular') do its('value') { should eq 0 } diff --git a/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb b/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb index bbe1ddf088..e010338b1c 100644 --- a/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb +++ b/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb @@ -19,7 +19,7 @@ if os_properties.alinux2? || os_properties.centos7? mysql_packages.concat %w(mysql-community-libs-compat) end - elsif os_properties.ubuntu2004? || os_properties.ubuntu2204? + elsif os_properties.ubuntu2004? || os_properties.ubuntu2204? || os_properties.ubuntu2404? mysql_packages.concat %w(libmysqlclient-dev libmysqlclient21) else describe "unsupported OS" do diff --git a/test/environments/kitchen.rb b/test/environments/kitchen.rb index ec880d60b6..2889ae4d2c 100644 --- a/test/environments/kitchen.rb +++ b/test/environments/kitchen.rb @@ -9,24 +9,28 @@ 'ebs_mount-vol_array/centos7' => '', 'ebs_mount-vol_array/ubuntu2004' => '', 'ebs_mount-vol_array/ubuntu2204' => '', + 'ebs_mount-vol_array/ubuntu2404' => '', 'ebs_mount-vol_array/rocky8' => '', 'ebs_unmount-vol_array/alinux2' => '', 'ebs_unmount-vol_array/rhel8' => '', 'ebs_unmount-vol_array/centos7' => '', 'ebs_unmount-vol_array/ubuntu2004' => '', 'ebs_unmount-vol_array/ubuntu2204' => '', + 'ebs_unmount-vol_array/ubuntu2404' => '', 'ebs_unmount-vol_array/rocky8' => '', 'raid_mount-raid_vol_array/alinux2' => '', 'raid_mount-raid_vol_array/rhel8' => '', 'raid_mount-raid_vol_array/centos7' => '', 'raid_mount-raid_vol_array/ubuntu2004' => '', 'raid_mount-raid_vol_array/ubuntu2204' => '', + 'raid_mount-raid_vol_array/ubuntu2404' => '', 'raid_mount-raid_vol_array/rocky8' => '', 'raid_unmount-raid_vol_array/alinux2' => '', 'raid_unmount-raid_vol_array/rhel8' => '', 'raid_unmount-raid_vol_array/centos7' => '', 'raid_unmount-raid_vol_array/ubuntu2004' => '', 'raid_unmount-raid_vol_array/ubuntu2204' => '', + 'raid_unmount-raid_vol_array/ubuntu2404' => '', 'raid_unmount-raid_vol_array/rocky8' => '', 'lustre_mount-fsx_fs_id_array' => ["fs-0ab11b3ade43091fe"], 'lustre_mount-fsx_dns_name_array' => ["fs-0ab11b3ade43091fe.fsx.us-west-2.amazonaws.com"], From ed877b9bf6298daa6e0f421298ba5ee5f97465af Mon Sep 17 00:00:00 2001 From: Himani Anil Deshpande Date: Wed, 19 Mar 2025 16:10:53 -0400 Subject: [PATCH 2/2] Adding Rocky9, rhel9 and al2023 --- .../test/controls/cloudwatch_spec.rb | 8 +++----- .../test/controls/sticky_bits_spec.rb | 2 +- .../test/controls/mysql_client_spec.rb | 5 ++--- test/environments/kitchen.rb | 16 ++++++++++++---- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb index db3a32909d..d88b2e2c2f 100644 --- a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb +++ b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb @@ -20,15 +20,13 @@ describe 'Check the presence of the cloudwatch package gpg key' # In Ubuntu >20.04 due to environment variable the keyring is placed under home of the user ubuntu with the permission of root - ubuntu2004 = os_properties.ubuntu2004? - ubuntu2204 = os_properties.ubuntu2204? - ubuntu2404 = os_properties.ubuntu2404? - keyring = (ubuntu2004 || ubuntu2204 || ubuntu2404) && !os_properties.on_docker? ? '--keyring /home/ubuntu/.gnupg/pubring.kbx' : '' + + keyring = os_properties.ubuntu? && !os_properties.on_docker? ? '--keyring /home/ubuntu/.gnupg/pubring.kbx' : '' sudo = os_properties.redhat_on_docker? ? '' : 'sudo' describe bash("#{sudo} gpg --list-keys #{keyring}") do # Don't check exit status for Ubuntu20 because it returns 2 when executed in the validate phase of a created AMI # os_properties cannot be used in the describe block level. It can be used within an it{} block - its('exit_status') { should eq 0 } unless ubuntu2004 || ubuntu2204 + its('exit_status') { should eq 0 } unless os_properties.ubuntu? its('stdout') { should match /3B789C72/ } its('stdout') { should match /Amazon CloudWatch Agent/ } end diff --git a/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb b/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb index 85fe91d98c..1068082914 100644 --- a/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/test/controls/sticky_bits_spec.rb @@ -1,7 +1,7 @@ control 'tag:config_sticky_bits_configured' do title 'Check sticky bits configuration' - if (os_properties.ubuntu2004? || os_properties.ubuntu2204? || os_properties.ubuntu2404?) && !os_properties.on_docker? + if os_properties.ubuntu? && !os_properties.on_docker? # This test passes on Mac but doesn't work as GitHub action. describe kernel_parameter('fs.protected_regular') do its('value') { should eq 0 } diff --git a/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb b/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb index e010338b1c..bd50750ec8 100644 --- a/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb +++ b/cookbooks/aws-parallelcluster-slurm/test/controls/mysql_client_spec.rb @@ -13,13 +13,14 @@ title "MySql client is installed" mysql_packages = [] + ubuntu = os_properties.ubuntu? if os.redhat? mysql_packages.concat %w(mysql-community-client-plugins mysql-community-common mysql-community-devel mysql-community-libs) if os_properties.alinux2? || os_properties.centos7? mysql_packages.concat %w(mysql-community-libs-compat) end - elsif os_properties.ubuntu2004? || os_properties.ubuntu2204? || os_properties.ubuntu2404? + elsif ubuntu mysql_packages.concat %w(libmysqlclient-dev libmysqlclient21) else describe "unsupported OS" do @@ -27,8 +28,6 @@ end end - ubuntu = os_properties.ubuntu? - mysql_packages.each do |pkg| describe package(pkg) do it { should be_installed } diff --git a/test/environments/kitchen.rb b/test/environments/kitchen.rb index 2889ae4d2c..d8702b5cdf 100644 --- a/test/environments/kitchen.rb +++ b/test/environments/kitchen.rb @@ -5,33 +5,41 @@ name 'kitchen' default_attributes 'kitchen_hooks' => { 'ebs_mount-vol_array/alinux2' => '', + 'ebs_mount-vol_array/alinux2023' => '', 'ebs_mount-vol_array/rhel8' => '', - 'ebs_mount-vol_array/centos7' => '', + 'ebs_mount-vol_array/rhel9' => '', 'ebs_mount-vol_array/ubuntu2004' => '', 'ebs_mount-vol_array/ubuntu2204' => '', 'ebs_mount-vol_array/ubuntu2404' => '', 'ebs_mount-vol_array/rocky8' => '', + 'ebs_mount-vol_array/rocky9' => '', 'ebs_unmount-vol_array/alinux2' => '', + 'ebs_unmount-vol_array/alinux2023' => '', 'ebs_unmount-vol_array/rhel8' => '', - 'ebs_unmount-vol_array/centos7' => '', + 'ebs_unmount-vol_array/rhel9' => '', 'ebs_unmount-vol_array/ubuntu2004' => '', 'ebs_unmount-vol_array/ubuntu2204' => '', 'ebs_unmount-vol_array/ubuntu2404' => '', 'ebs_unmount-vol_array/rocky8' => '', + 'ebs_unmount-vol_array/rocky9' => '', 'raid_mount-raid_vol_array/alinux2' => '', + 'raid_mount-raid_vol_array/alinux2023' => '', 'raid_mount-raid_vol_array/rhel8' => '', - 'raid_mount-raid_vol_array/centos7' => '', + 'raid_mount-raid_vol_array/rhel9' => '', 'raid_mount-raid_vol_array/ubuntu2004' => '', 'raid_mount-raid_vol_array/ubuntu2204' => '', 'raid_mount-raid_vol_array/ubuntu2404' => '', 'raid_mount-raid_vol_array/rocky8' => '', + 'raid_mount-raid_vol_array/rocky9' => '', 'raid_unmount-raid_vol_array/alinux2' => '', + 'raid_unmount-raid_vol_array/alinux2023' => '', 'raid_unmount-raid_vol_array/rhel8' => '', - 'raid_unmount-raid_vol_array/centos7' => '', + 'raid_unmount-raid_vol_array/rhel9' => '', 'raid_unmount-raid_vol_array/ubuntu2004' => '', 'raid_unmount-raid_vol_array/ubuntu2204' => '', 'raid_unmount-raid_vol_array/ubuntu2404' => '', 'raid_unmount-raid_vol_array/rocky8' => '', + 'raid_unmount-raid_vol_array/rocky9' => '', 'lustre_mount-fsx_fs_id_array' => ["fs-0ab11b3ade43091fe"], 'lustre_mount-fsx_dns_name_array' => ["fs-0ab11b3ade43091fe.fsx.us-west-2.amazonaws.com"], 'lustre_mount-fsx_mount_name_array' => ["qz5b7bev"],