code stringlengths 3 6.57k |
|---|
self.assertFalse(latest_agent.is_blacklisted) |
self.assertTrue(len(self.update_handler.agents) |
self.assertTrue(child_agent.is_available) |
self.assertFalse(child_agent.is_blacklisted) |
self.update_handler._evaluate_agent_health(latest_agent) |
test_evaluate_agent_health_ignores_installed_agent(self) |
self.update_handler._evaluate_agent_health(None) |
test_evaluate_agent_health_raises_exception_for_restarting_agent(self) |
time.time() |
self.assertRaises(Exception, self._test_evaluate_agent_health) |
test_evaluate_agent_health_will_not_raise_exception_for_long_restarts(self) |
time.time() |
self._test_evaluate_agent_health() |
test_evaluate_agent_health_will_not_raise_exception_too_few_restarts(self) |
time.time() |
self._test_evaluate_agent_health() |
test_evaluate_agent_health_resets_with_new_agent(self) |
time.time() |
self._test_evaluate_agent_health(child_agent_index=1) |
self.assertEqual(1, self.update_handler.child_launch_attempts) |
test_filter_blacklisted_agents(self) |
self.prepare_agents() |
self.update_handler._set_agents([GuestAgent(path=path) |
self.agent_dirs() |
self.assertEqual(len(self.agent_dirs() |
len(self.update_handler.agents) |
agent.mark_failure(is_fatal=True) |
self.update_handler._filter_blacklisted_agents() |
self.assertEqual(kept_agents, self.update_handler.agents) |
test_find_agents(self) |
self.prepare_agents() |
self.assertTrue(0 <= len(self.update_handler.agents) |
self.update_handler._find_agents() |
self.assertEqual(len(self._get_agents(self.tmp_dir) |
len(self.update_handler.agents) |
test_find_agents_does_reload(self) |
self.prepare_agents() |
self.update_handler._find_agents() |
self.update_handler._find_agents() |
self.assertNotEqual(agents, self.update_handler.agents) |
test_find_agents_sorts(self) |
self.prepare_agents() |
self.update_handler._find_agents() |
FlexibleVersion("100000") |
self.assertTrue(v > a.version) |
patch('azurelinuxagent.common.protocol.wire.WireClient.get_host_plugin') |
test_get_host_plugin_returns_host_for_wireserver(self, mock_get_host) |
WireProtocol('12.34.56.78') |
self.update_handler._get_host_plugin(protocol=protocol) |
print("mock_get_host call cound={0}".format(mock_get_host.call_count) |
self.assertEqual(1, mock_get_host.call_count) |
self.assertEqual("faux host", host) |
test_get_latest_agent(self) |
self.prepare_agents() |
self.update_handler.get_latest_agent() |
self.assertEqual(len(self._get_agents(self.tmp_dir) |
len(self.update_handler.agents) |
self.assertEqual(latest_version, latest_agent.version) |
test_get_latest_agent_excluded(self) |
self.prepare_agent(AGENT_VERSION) |
self.agent_versions() |
self.assertEqual(None, self.update_handler.get_latest_agent() |
test_get_latest_agent_no_updates(self) |
self.assertEqual(None, self.update_handler.get_latest_agent() |
test_get_latest_agent_skip_updates(self) |
Mock(return_value=False) |
self.assertEqual(None, self.update_handler.get_latest_agent() |
test_get_latest_agent_skips_unavailable(self) |
self.prepare_agents() |
self.update_handler.get_latest_agent() |
self.prepare_agents(count=self.agent_count() |
os.path.join(self.tmp_dir, "{0}-{1}".format(AGENT_NAME, latest_version) |
self.assertFalse(GuestAgent(latest_path) |
self.update_handler.get_latest_agent() |
self.assertTrue(latest_agent.version < latest_version) |
self.assertEqual(latest_agent.version, prior_agent.version) |
test_get_pid_files(self) |
self.update_handler._get_pid_files() |
self.assertEqual(0, len(pid_files) |
test_get_pid_files_returns_previous(self) |
range(1250) |
fileutil.write_file(os.path.join(self.tmp_dir, str(n) |
ustr(n + 1) |
self.update_handler._get_pid_files() |
self.assertEqual(1250, len(pid_files) |
self.update_handler._get_pid_parts() |
self.assertTrue(pid_re.match(os.path.basename(p) |
test_is_clean_start_returns_true_when_no_sentinel(self) |
self.assertFalse(os.path.isfile(self.update_handler._sentinel_file_path() |
self.assertTrue(self.update_handler._is_clean_start) |
test_is_clean_start_returns_false_when_sentinel_exists(self) |
self.update_handler._set_sentinel(agent=CURRENT_AGENT) |
self.assertFalse(self.update_handler._is_clean_start) |
test_is_clean_start_returns_false_for_exceptions(self) |
self.update_handler._set_sentinel() |
patch("azurelinuxagent.common.utils.fileutil.read_file", side_effect=Exception) |
self.assertFalse(self.update_handler._is_clean_start) |
test_is_orphaned_returns_false_if_parent_exists(self) |
fileutil.write_file(conf.get_agent_pid_file_path() |
ustr(42) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.