Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +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?
keyring = (ubuntu2004 || ubuntu2204) && !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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@
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?
elsif ubuntu
mysql_packages.concat %w(libmysqlclient-dev libmysqlclient21)
else
describe "unsupported OS" do
pending "support for #{os.name}-#{os.release} needs to be implemented"
end
end

ubuntu = os_properties.ubuntu?

mysql_packages.each do |pkg|
describe package(pkg) do
it { should be_installed }
Expand Down
20 changes: 16 additions & 4 deletions test/environments/kitchen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +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"],
Expand Down
Loading