Skip to content
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

AMA is not supported on cbl-mariner 1.0 #3002

Merged
merged 4 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tests_e2e/tests/agent_bvt/vm_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class VmAccessBvt(AgentVmTest):
def run(self):
ssh_client: SshClient = self._context.create_ssh_client()
if not VmExtensionIds.VmAccess.supports_distro(ssh_client.run_command("uname -a")):
if not VmExtensionIds.VmAccess.supports_distro(ssh_client.run_command("get_distro.py").rstrip()):
raise TestSkipped("Currently VMAccess is not supported on this distro")

# Try to use a unique username for each test run (note that we truncate to 32 chars to
Expand Down
2 changes: 1 addition & 1 deletion tests_e2e/tests/ext_sequencing/ext_sequencing.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def run(self):
for instance in instances_ip_address:
ssh_clients[instance.instance_name] = SshClient(ip_address=instance.ip_address, username=self._context.username, identity_file=self._context.identity_file)

if not VmExtensionIds.AzureMonitorLinuxAgent.supports_distro(next(iter(ssh_clients.values())).run_command("uname -a")):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use "uname -a" to check the distro in multiple places in the code. I am concerned with updating only this one instance.

Actually, maybe we should use get_distro(), in the Agent's code to do this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use get_distro to get distro name and version for all test suites which use "uname -a"

if not VmExtensionIds.AzureMonitorLinuxAgent.supports_distro(next(iter(ssh_clients.values())).run_command("get_distro.py").rstrip()):
raise TestSkipped("Currently AzureMonitorLinuxAgent is not supported on this distro")

# This is the base ARM template that's used for deploying extensions for this scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run(self):

# Extensions we will create events for
extensions = ["Microsoft.Azure.Extensions.CustomScript"]
if VmExtensionIds.VmAccess.supports_distro(ssh_client.run_command("uname -a")):
if VmExtensionIds.VmAccess.supports_distro(ssh_client.run_command("get_distro.py").rstrip()):
extensions.append("Microsoft.OSTCExtensions.VMAccessForLinux")

# Set the etp collection period to 30 seconds instead of default 5 minutes
Expand Down
2 changes: 1 addition & 1 deletion tests_e2e/tests/lib/vm_extension_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, publisher: str, ext_type: str, version: str):

unsupported_distros: Dict[str, List[str]] = {
"Microsoft.OSTCExtensions.VMAccessForLinux": ["flatcar"],
"Microsoft.Azure.Monitor.AzureMonitorLinuxAgent": ["flatcar"]
"Microsoft.Azure.Monitor.AzureMonitorLinuxAgent": ["flatcar", "mariner_1"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_distro.py produces _ and here we are only using the name ("flatcar")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We check if any of these are a substring in the result of get_distro.py. This check is on Line 45

Copy link
Contributor Author

@maddieford maddieford Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we only put distro name in this list, then we know that extension doesn't support any version of the distro. If we put 'name_version' then we can mark that the extension only excludes a certain version. I did this since mariner_1 is unsupported by AMA, but mariner_2 is supported

}

def supports_distro(self, system_info: str) -> bool:
Expand Down
Loading