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

Extension sequencing scenario #2969

Merged
merged 36 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
656f863
update tests
Oct 18, 2023
5633e53
cleanup
Oct 19, 2023
029f5ae
.
Oct 19, 2023
ae3ad4a
.
Oct 20, 2023
705796d
.
Oct 20, 2023
eb4c490
.
Oct 20, 2023
7dcc600
.
Oct 23, 2023
d49bd31
.
Oct 23, 2023
31b0271
.
Oct 23, 2023
46c9eef
.
Oct 23, 2023
2b9de7f
.
Oct 24, 2023
59b509a
Add new test cases
maddieford Oct 30, 2023
189d1a2
Merge develop
maddieford Oct 30, 2023
a8d77ed
Update scenario to support new tests
maddieford Oct 30, 2023
1574afb
Merge branch 'develop' of github.com:maddieford/WALinuxAgent into dep…
maddieford Oct 30, 2023
b04e06b
Scenario should support failing extensions and extensions with no set…
maddieford Oct 30, 2023
8e522b2
Clean up test
maddieford Oct 31, 2023
9070a5a
Merge branch 'develop' of github.com:maddieford/WALinuxAgent into dep…
maddieford Oct 31, 2023
106f383
Remove locations from test suite yml
maddieford Oct 31, 2023
a37e181
Fix deployment issue
maddieford Oct 31, 2023
4ffa3ee
Support creating multiple resource groups for vmss in one run
maddieford Oct 31, 2023
59691ff
AzureMonitorLinuxAgent is not supported on flatcar
maddieford Oct 31, 2023
fb52b39
Resolve merge conflicts
maddieford Oct 31, 2023
4fd744d
AzureMonitor is not supported on flatcar
maddieford Oct 31, 2023
7f3bb7b
remove agent update
maddieford Oct 31, 2023
2640a7e
Address PR comments
maddieford Nov 1, 2023
ecdb9ad
Fix issue with getting random ssh client
maddieford Nov 1, 2023
7e693a1
Address PR Comments
maddieford Nov 2, 2023
d826622
Address PR Comments
maddieford Nov 2, 2023
0e2ea4f
Address PR comments
maddieford Nov 2, 2023
8cf4d19
Do not keep rg count in runbook
maddieford Nov 2, 2023
6ae88f0
Use try/finally with lock
maddieford Nov 2, 2023
c5e79ae
only check logs after scenario startS
maddieford Nov 7, 2023
a45db9c
Merge branch 'develop' into depenency_tests
maddieford Nov 7, 2023
0c91f6d
Change to instance member
maddieford Nov 7, 2023
c832824
Merge branch 'develop' into depenency_tests
maddieford Nov 7, 2023
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
10 changes: 7 additions & 3 deletions tests_e2e/orchestrator/lib/agent_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def __init__(self, metadata: TestSuiteMetadata) -> None:
self._lisa_environment_name: str # Name assigned by LISA to the test environment, useful for correlation with LISA logs
self._environment_name: str # Name assigned by the AgentTestSuiteCombinator to the test environment

self._vmss_resource_group_count: int # Counter to keep track of how many resource groups have been created for vmss suites
maddieford marked this conversation as resolved.
Show resolved Hide resolved

self._test_suites: List[AgentTestSuite] # Test suites to execute in the environment

self._cloud: str # Azure cloud where test VMs are located
Expand Down Expand Up @@ -189,6 +191,8 @@ def _initialize(self, environment: Environment, variables: Dict[str, Any], lisa_
self._lisa_environment_name = environment.name
self._environment_name = variables["c_env_name"]

self._vmss_resource_group_count = variables["c_vmss_resource_group_count"]

self._test_suites = variables["c_test_suites"]

self._cloud = variables["cloud"]
Expand Down Expand Up @@ -230,9 +234,9 @@ def _initialize(self, environment: Environment, variables: Dict[str, Any], lisa_

if isinstance(environment.nodes[0], LocalNode):
# We need to create a new VMSS.
# Use the same naming convention as LISA for the scale set name: lisa-<runbook name>-<run id>-e0-n0. Note that we hardcode the resource group
# id to "e0" and the scale set name to "n0" since we are creating a single scale set.
self._resource_group_name = f"lisa-{self._runbook_name}-{RUN_ID}-e0"
# Use the same naming convention as LISA for the scale set name: lisa-<runbook name>-<run id>-e0-n0. Note
Copy link
Member

Choose a reason for hiding this comment

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

"e0" needs updating since now we use the counter

# that we hardcode the scale set name to "n0" since we are creating a single scale set.
self._resource_group_name = f"lisa-{self._runbook_name.lower()}-{RUN_ID}-e{self._vmss_resource_group_count}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ipaddress cannot have upercase characters in it's domain or we hit the following error. Making runbook name lowercase here

Code: InvalidTemplateDeployment Message: The template deployment 'TestDeployment' is not valid according to the validation procedure. The tracking id is '043fde1e-6cff-43ff-85d6-a15dd8f97690'. See inner errors for details. Exception Details: (InvalidDomainNameLabel) The domain name label lisa-WALinuxAgent-20231031-191104-824-e0-n0 is invalid. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Code: InvalidDomainNameLabel Message: The domain name label lisa-WALinuxAgent-20231031-191104-824-e0-n0 is invalid. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. Target: /subscriptions/***/resourceGroups/lisa-WALinuxAgent-20231031-191104-824-e0/providers/Microsoft.Network/publicIPAddresses/e2e-testPublicLbIp

Copy link
Member

Choose a reason for hiding this comment

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

thanks. this is worth adding as a comment in the code

self._vmss_name = f"{self._resource_group_name}-n0"
self._test_nodes = [] # we'll fill this up when the scale set is created
self._create_scale_set = True
Expand Down
8 changes: 7 additions & 1 deletion tests_e2e/orchestrator/lib/agent_test_suite_combinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def __init__(self, runbook: AgentTestSuitesCombinatorSchema) -> None:
raise Exception("Invalid runbook parameters: The 'vmss_name' parameter indicates an existing VMSS, a 'resource_group_name' must be specified.")

self._log: logging.Logger = logging.getLogger("lisa")
self._vmss_resource_group_count: int = 0

with set_thread_name("AgentTestSuitesCombinator"):
if self.runbook.vm_name != '':
Expand Down Expand Up @@ -176,10 +177,12 @@ def create_environment_list(self) -> List[Dict[str, Any]]:
if test_suite_info.executes_on_scale_set:
env = self.create_vmss_environment(
env_name=f"{image_name}-vmss-{test_suite_info.name}",
vmss_resource_group_count=self._vmss_resource_group_count,
marketplace_image=marketplace_image,
location=location,
vm_size=vm_size,
test_suite_info=test_suite_info)
self._vmss_resource_group_count += 1
else:
env = self.create_vm_environment(
env_name=f"{image_name}-{test_suite_info.name}",
Expand All @@ -202,10 +205,12 @@ def create_environment_list(self) -> List[Dict[str, Any]]:
raise Exception("VHDS are currently not supported on scale sets.")
env = self.create_vmss_environment(
env_name=env_name,
vmss_resource_group_count=self._vmss_resource_group_count,
marketplace_image=marketplace_image,
location=location,
vm_size=vm_size,
test_suite_info=test_suite_info)
self._vmss_resource_group_count += 1
else:
env = self.create_vm_environment(
env_name=env_name,
Expand Down Expand Up @@ -369,7 +374,7 @@ def create_vm_environment(self, env_name: str, marketplace_image: str, vhd: str,
"vm_tags": vm_tags
}

def create_vmss_environment(self, env_name: str, marketplace_image: str, location: str, vm_size: str, test_suite_info: TestSuiteInfo) -> Dict[str, Any]:
def create_vmss_environment(self, env_name: str, vmss_resource_group_count: int, marketplace_image: str, location: str, vm_size: str, test_suite_info: TestSuiteInfo) -> Dict[str, Any]:
return {
"c_platform": [
{
Expand All @@ -388,6 +393,7 @@ def create_vmss_environment(self, env_name: str, marketplace_image: str, locatio
},

"c_env_name": env_name,
"c_vmss_resource_group_count": vmss_resource_group_count,
"c_test_suites": [test_suite_info],
"c_location": location,
"c_image": marketplace_image,
Expand Down
10 changes: 9 additions & 1 deletion tests_e2e/orchestrator/runbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ variable:
# Test suites to execute
#
- name: test_suites
value: "agent_bvt, no_outbound_connections, extensions_disabled, agent_not_provisioned, fips, agent_ext_workflow, agent_status, multi_config_ext, agent_cgroups, ext_cgroups, agent_firewall, ext_telemetry_pipeline"
value: "agent_bvt, no_outbound_connections, extensions_disabled, agent_not_provisioned, fips, agent_ext_workflow, agent_update, agent_status, multi_config_ext, agent_cgroups, ext_cgroups, agent_firewall, ext_telemetry_pipeline, ext_sequencing"

#
# Parameters used to create test VMs
Expand Down Expand Up @@ -136,6 +136,14 @@ variable:
value: ""
is_case_visible: true

#
# Count of how many resource groups have been created, used to create a unique resource group name for each vmss test
# environment
#
- name: c_vmss_resource_group_count
value: 0
is_case_visible: true

#
# Test suites assigned for execution in the current test environment.
#
Expand Down
10 changes: 10 additions & 0 deletions tests_e2e/test_suites/ext_sequencing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Adds extensions with multiple dependencies to VMSS using 'provisionAfterExtensions' property and validates they are
# enabled in order of dependencies.
#
name: "ExtSequencing"
tests:
- "ext_sequencing/ext_sequencing.py"
images: "endorsed"
# This scenario is executed on instances of a scaleset created by the agent test suite.
executes_on_scale_set: true
Loading
Loading