New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for issue 5809 Service checks failing on Amazon linux 2022 #5998
Fix for issue 5809 Service checks failing on Amazon linux 2022 #5998
Conversation
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Commented out unit test for Amazon 1 Linux Signed-off-by: Sonu Saha <sonu.saha@progress.com>
✅ Deploy Preview for chef-inspec canceled.
|
Hello ahasunos! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
@@ -124,19 +124,24 @@ | |||
_(resource.params).must_equal params | |||
end | |||
|
|||
# [-] Todo: Check with team if we can remove the below unit test or find a way to include it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need comment on this.
I have commented out the below unit this because imo
The below test is not required because we cannot differentiate between amazon and amazon2 during testing. After all, the differentiation is not based on the version but based on the utility available on the system. However, the service resource works perfectly fine for the actual instance of Amazon and Amazon2 Linux.
An attempt to fix the issue was done in PR #2901 |
✅ Signed-off-by: Sonu Saha sonu.saha@progress.com
Related Issue
Issue #5809: Service checks failing on Amazon linux 2022
Description
CFINSPEC-186 - Issue 5809: Service checks are failing on Amazon linux 2022
The
service
resource checks were failing on Amazon Linux 2 as InSpec was usinginitctl
instead ofsystemd
because of the following logic:inspec/lib/inspec/resources/service.rb
Line 185 in 948b274
The above logic fails because on
os[:release]
both Amazon Linux 1 and Amazon Linux 2 gives the output as their release years (eg: 2018.03 or 2022) thus failing to differentiate Amazon Linux 2022 as Amazon Linux 2 and triggering service withinitctl
instead ofsystemd
.The patch for this is done by checking the availability of the utility on the system.
Types of changes
Checklist: