Skip to content

Commit

Permalink
Johnf/address 1604 assertion eror (#3599)
Browse files Browse the repository at this point in the history
* add logic to handle multiple errors in error details list

* change logic to check for error code 2 when details counts less than equal to 2
  • Loading branch information
feng-j678 authored Jan 14, 2025
1 parent 9e89205 commit f6e8d5e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions microsoft/testsuites/vm_extensions/linux_patch_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,17 @@ def _assert_status_file_result(status_file: Any, error_code: str) -> None:
assert_that(status_file["status"]).described_as(
f"{expected_warning_status_msg} - Actual status: {status_file['status']}"
).is_in("Warning", "CompletedWithWarnings", "Succeeded")
assert_that(error_code).described_as(
"Expected error code in status file patches operation"
).is_equal_to("2")

# PACKAGE_LIST_TRUNCATED error code is 2
if len(status_file["error"]["details"]) <= 1:
assert_that(error_code).described_as(
"Expected error code in status file patches operation"
).is_equal_to("2")
else:
# multiple errors, error code is 1
assert_that(error_code).described_as(
"Expected error code in status file patches operation"
).is_equal_to("1")

elif ua_esm_required_code and not file_status_is_error:
assert_that(status_file["status"]).described_as(
Expand Down

0 comments on commit f6e8d5e

Please sign in to comment.