From b64a1c0d9f577014f51adf5ee666cb800ef8d68b Mon Sep 17 00:00:00 2001 From: maddieford <93676569+maddieford@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:13:39 -0700 Subject: [PATCH] download_fail unit test should use agent version in common instead of 9.9.9.9 (#2908) (cherry picked from commit ed80388c02471a1e196fd8d77cf0a74eab13c5c7) --- tests/ga/test_guestagent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ga/test_guestagent.py b/tests/ga/test_guestagent.py index a127341d15..3d25ff7921 100644 --- a/tests/ga/test_guestagent.py +++ b/tests/ga/test_guestagent.py @@ -173,6 +173,7 @@ def http_get_handler(uri, *_, **__): return MockHttpResponse(status=httpclient.SERVICE_UNAVAILABLE) return None + agent_version = self._get_agent_version() pkg = ExtHandlerPackage(version=str(self._get_agent_version())) pkg.uris.append(agent_uri) @@ -185,7 +186,7 @@ def http_get_handler(uri, *_, **__): messages = [kwargs['message'] for _, kwargs in add_event.call_args_list if kwargs['op'] == 'Install' and kwargs['is_success'] == False] self.assertEqual(1, len(messages), "Expected exactly 1 install error/ Got: {0}".format(add_event.call_args_list)) - self.assertIn('[UpdateError] Unable to download Agent WALinuxAgent-9.9.9.9', messages[0], "The install error does not include the expected message") + self.assertIn(str.format('[UpdateError] Unable to download Agent WALinuxAgent-{0}', agent_version), messages[0], "The install error does not include the expected message") self.assertFalse(agent.is_blacklisted, "Download failures should not blacklist the Agent")