diff --git a/azurelinuxagent/ga/cgroupapi.py b/azurelinuxagent/ga/cgroupapi.py index 040333bdde..6f4bf4ab34 100644 --- a/azurelinuxagent/ga/cgroupapi.py +++ b/azurelinuxagent/ga/cgroupapi.py @@ -59,7 +59,8 @@ def cgroups_supported(): distro_version = FlexibleVersion(distro_info[1]) except ValueError: return False - return distro_name.lower() == 'ubuntu' and distro_version.major >= 16 + return (distro_name.lower() == 'ubuntu' and distro_version.major >= 16) or \ + (distro_name.lower() in ('centos', 'redhat') and 8 <= distro_version.major < 9) @staticmethod def track_cgroups(extension_cgroups): diff --git a/tests/ga/test_cgroupapi.py b/tests/ga/test_cgroupapi.py index 6b15af1ebf..ad8ef80c2c 100644 --- a/tests/ga/test_cgroupapi.py +++ b/tests/ga/test_cgroupapi.py @@ -56,17 +56,19 @@ def test_cgroups_should_be_supported_only_on_ubuntu16_centos7dot4_redhat7dot4_an (['ubuntu', '18.10', 'cosmic'], True), (['ubuntu', '20.04', 'focal'], True), (['ubuntu', '20.10', 'groovy'], True), - (['centos', '7.8', 'Source'], False), - (['redhat', '7.8', 'Maipo'], False), - (['redhat', '7.9.1908', 'Core'], False), - (['centos', '8.1', 'Source'], False), - (['redhat', '8.2', 'Maipo'], False), - (['redhat', '8.2.2111', 'Core'], False), (['centos', '7.4', 'Source'], False), (['redhat', '7.4', 'Maipo'], False), (['centos', '7.5', 'Source'], False), (['centos', '7.3', 'Maipo'], False), (['redhat', '7.2', 'Maipo'], False), + (['centos', '7.8', 'Source'], False), + (['redhat', '7.8', 'Maipo'], False), + (['redhat', '7.9.1908', 'Core'], False), + (['centos', '8.1', 'Source'], True), + (['redhat', '8.2', 'Maipo'], True), + (['redhat', '8.2.2111', 'Core'], True), + (['redhat', '9.1', 'Core'], False), + (['centos', '9.1', 'Source'], False), (['bigip', '15.0.1', 'Final'], False), (['gaia', '273.562', 'R80.30'], False), (['debian', '9.1', ''], False), diff --git a/tests_e2e/test_suites/images.yml b/tests_e2e/test_suites/images.yml index 433d0733d9..c254cccd71 100644 --- a/tests_e2e/test_suites/images.yml +++ b/tests_e2e/test_suites/images.yml @@ -12,6 +12,7 @@ image-sets: # - "alma_9" - "centos_79" + - "centos_82" - "debian_9" - "debian_10" - "debian_11" @@ -39,6 +40,8 @@ image-sets: # As of today agent only support and enabled resource governance feature on following distros cgroups-endorsed: + - "centos_82" + - "rhel_82" - "ubuntu_1604" - "ubuntu_1804" - "ubuntu_2004" @@ -78,6 +81,7 @@ images: AzureChinaCloud: [] centos_610: "OpenLogic CentOS 6.10 latest" centos_79: "OpenLogic CentOS 7_9 latest" + centos_82: "OpenLogic CentOS 8_2 latest" debian_8: "credativ Debian 8 latest" debian_9: "credativ Debian 9 latest" debian_10: "Debian debian-10 10 latest" diff --git a/tests_e2e/tests/agent_cgroups/agent_cgroups.py b/tests_e2e/tests/agent_cgroups/agent_cgroups.py index d976c0338e..c0394f6c62 100644 --- a/tests_e2e/tests/agent_cgroups/agent_cgroups.py +++ b/tests_e2e/tests/agent_cgroups/agent_cgroups.py @@ -31,6 +31,9 @@ def __init__(self, context: AgentTestContext): self._ssh_client = self._context.create_ssh_client() def run(self): + log.info("=====Prepare agent=====") + log.info("Restarting agent service to make sure service starts with new configuration that was setup by the cgroupconfigurator") + self._ssh_client.run_command("agent-service restart", use_sudo=True) log.info("=====Validating agent cgroups=====") self._run_remote_test("agent_cgroups-check_cgroups_agent.py") log.info("Successfully Verified that agent present in correct cgroups")