Skip to content

Commit

Permalink
Fix e2e test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
mgunnala committed Nov 11, 2024
1 parent edec2af commit b440696
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tests_e2e/test_suites/ext_policy_with_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ name: "ExtPolicyWithDependencies"
tests:
- "ext_policy/ext_policy_with_dependencies.py"
images: "random(endorsed)"
executes_on_scale_set: true
executes_on_scale_set: true
# This test should run on its own VMSS, because other tests may leave behind extensions
# that are disallowed by policy and affect results.
owns_vm: true
2 changes: 1 addition & 1 deletion tests_e2e/tests/ext_policy/ext_policy_with_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def run(self):

# Copy policy file to each instance
log.info("Updating policy file with new policy: {0}".format(policy))
for instance_name, ssh_client in ssh_clients.items():
for ssh_client in ssh_clients.values():
self._create_policy_file(ssh_client, policy)

# Deploy updated extension template to the scale set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ def main():
found = False

try:
after_timestamp = (datetime.strptime(args.after_timestamp, '%Y-%m-%d %H:%M:%S') if args.after_timestamp else None)
found = AgentLog(Path('/var/log/waagent.log')).agent_log_contains(args.data, after_timestamp)
if args.after_timestamp is not None:
after_datetime = datetime.strptime(args.after_timestamp, '%Y-%m-%d %H:%M:%S')
found = AgentLog(Path('/var/log/waagent.log')).agent_log_contains(args.data, after_datetime)
else:
found = AgentLog(Path('/var/log/waagent.log')).agent_log_contains(args.data)
if found:
print("Found data: {0} in agent log".format(args.data))
else:
Expand Down

0 comments on commit b440696

Please sign in to comment.