From 4b6680560679d797e99c50f3813fd2219451e431 Mon Sep 17 00:00:00 2001 From: hanwenli Date: Mon, 17 Nov 2025 09:59:32 -0800 Subject: [PATCH] Fix github system test on Ubuntu22 and 24 --- .../cloudwatch/partial/_cloudwatch_install_package_debian.rb | 2 +- .../test/controls/cloudwatch_spec.rb | 2 +- .../test/libraries/os_properties.rb | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_install_package_debian.rb b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_install_package_debian.rb index 7e00600a2b..20f0fcdfd7 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_install_package_debian.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_install_package_debian.rb @@ -1,7 +1,7 @@ action :cloudwatch_install_package do dpkg_package package_path do source package_path - end + end unless on_docker? end action_class do diff --git a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb index 9e8f90a06e..1ee10f72c7 100644 --- a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb +++ b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb @@ -36,7 +36,7 @@ title "Check if cloudwatch package is installed" describe package('amazon-cloudwatch-agent') do it { should be_installed } - end + end unless os_properties.ubuntu_on_docker? end control 'tag:config_cloudwatch_configured' do diff --git a/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb b/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb index 768d5c9a98..e0745f0933 100644 --- a/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb +++ b/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb @@ -36,6 +36,10 @@ def ubuntu? inspec.os.name == 'ubuntu' end + def ubuntu_on_docker? + on_docker? && ubuntu? + end + def redhat8? redhat? && inspec.os.release.to_i == 8 end