Skip to content

Commit

Permalink
Merge branch 'develop' into ec
Browse files Browse the repository at this point in the history
  • Loading branch information
narrieta committed Oct 4, 2023
2 parents 2cb21c6 + ffa99ed commit 9d0c3c8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion azurelinuxagent/ga/agent_update_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def __update_last_attempt_update_times(self):
else:
self.update_state.last_attempted_normal_update_time = now
self.update_state.last_attempted_hotfix_update_time = now
self.update_state.last_attempted_manifest_download_time = now

def __should_agent_attempt_manifest_download(self):
"""
Expand All @@ -103,6 +102,7 @@ def __should_agent_attempt_manifest_download(self):

if next_attempt_time > now:
return False
self.update_state.last_attempted_manifest_download_time = now
return True

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion azurelinuxagent/ga/cgroupapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
14 changes: 8 additions & 6 deletions tests/ga/test_cgroupapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions tests_e2e/test_suites/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ image-sets:
#
- "alma_9"
- "centos_79"
- "centos_82"
- "debian_9"
- "debian_10"
- "debian_11"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions tests_e2e/tests/agent_cgroups/agent_cgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9d0c3c8

Please sign in to comment.