Skip to content
Merged
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,13 +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

keyring = os_properties.ubuntu? && !os_properties.on_docker? ? '--keyring /home/ubuntu/.gnupg/pubring.kbx' : ''
is_ubuntu = os_properties.ubuntu?
keyring = is_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 os_properties.ubuntu?
its('exit_status') { should eq 0 } unless is_ubuntu
its('stdout') { should match /3B789C72/ }
its('stdout') { should match /Amazon CloudWatch Agent/ }
end
Expand Down
Loading