diff options
Diffstat (limited to 'tests/ga/test_extension.py')
-rw-r--r-- | tests/ga/test_extension.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/ga/test_extension.py b/tests/ga/test_extension.py index 9a72989..9111cde 100644 --- a/tests/ga/test_extension.py +++ b/tests/ga/test_extension.py @@ -414,8 +414,7 @@ class TestExtension(AgentTestCase): "<Incarnation>4<") test_data.ext_conf = test_data.ext_conf.replace("1.0.0", "1.1.0") exthandlers_handler.run() - self._assert_handler_status(protocol.report_vm_status, "Ready", 1, "1.0.0") - self._assert_ext_status(protocol.report_ext_status, "success", 0) + self._assert_no_handler_status(protocol.report_vm_status) #Test GUID change with hotfix test_data.goal_state = test_data.goal_state.replace("<Incarnation>4<", @@ -459,8 +458,7 @@ class TestExtension(AgentTestCase): "<Incarnation>10<") test_data.ext_conf = test_data.ext_conf.replace("1.1.0", "1.2.0") exthandlers_handler.run() - self._assert_handler_status(protocol.report_vm_status, "Ready", 1, "1.1.1") - self._assert_ext_status(protocol.report_ext_status, "success", 0) + self._assert_no_handler_status(protocol.report_vm_status) #Test GUID change with upgrade available test_data.goal_state = test_data.goal_state.replace("<Incarnation>10<", @@ -579,12 +577,12 @@ class TestExtension(AgentTestCase): decision_version = '1.0.0' _, protocol = self._create_mock(WireProtocolData(datafile), *args) - ext_handlers, etag = protocol.get_ext_handlers() + ext_handlers, _ = protocol.get_ext_handlers() self.assertEqual(1, len(ext_handlers.extHandlers)) ext_handler = ext_handlers.extHandlers[0] self.assertEqual('OSTCExtensions.ExampleHandlerLinux', ext_handler.name) self.assertEqual(config_version, ext_handler.properties.version, "config version.") - ExtHandlerInstance(ext_handler, protocol).decide_version(etag) + ExtHandlerInstance(ext_handler, protocol).decide_version() self.assertEqual(decision_version, ext_handler.properties.version, "decision version.") def test_ext_handler_version_decide_between_minor_versions(self, *args): @@ -611,7 +609,6 @@ class TestExtension(AgentTestCase): _, protocol = self._create_mock(WireProtocolData(DATA_FILE), *args) version_uri = Mock() version_uri.uri = 'http://some/Microsoft.OSTCExtensions_ExampleHandlerLinux_asiaeast_manifest.xml' - incarnation = 1 for (installed_version, config_version, expected_version, autoupgrade_expected_version) in cases: ext_handler = Mock() @@ -623,9 +620,8 @@ class TestExtension(AgentTestCase): ext_handler_instance = ExtHandlerInstance(ext_handler, protocol) ext_handler_instance.get_installed_version = Mock(return_value=installed_version) - ext_handler_instance.decide_version(incarnation) + ext_handler_instance.decide_version() self.assertEqual(expected_version, ext_handler.properties.version) - incarnation += 1 ext_handler.properties.version = config_version ext_handler.properties.upgradePolicy = 'auto' @@ -633,9 +629,8 @@ class TestExtension(AgentTestCase): ext_handler_instance = ExtHandlerInstance(ext_handler, protocol) ext_handler_instance.get_installed_version = Mock(return_value=installed_version) - ext_handler_instance.decide_version(incarnation) + ext_handler_instance.decide_version() self.assertEqual(autoupgrade_expected_version, ext_handler.properties.version) - incarnation += 1 if __name__ == '__main__': |