Exemplo n.º 1
0
 def test_get_handler(self):
     osutil.get_osutil()
     protocol.get_protocol_util()
     dhcp.get_dhcp_handler()
     provision.get_provision_handler()
     deprovision.get_deprovision_handler()
     daemon.get_daemon_handler()
     resourcedisk.get_resourcedisk_handler()
     scvmm.get_scvmm_handler()
     monitor.get_monitor_handler()
     update.get_update_handler()
     exthandlers.get_exthandlers_handler()
Exemplo n.º 2
0
 def test_get_handler(self):
     osutil.get_osutil()
     protocol.get_protocol_util()
     dhcp.get_dhcp_handler()
     provision.get_provision_handler()
     deprovision.get_deprovision_handler()
     daemon.get_daemon_handler()
     resourcedisk.get_resourcedisk_handler()
     scvmm.get_scvmm_handler()
     monitor.get_monitor_handler()
     update.get_update_handler()
     exthandlers.get_exthandlers_handler()
Exemplo n.º 3
0
 def daemon(self):
     """
     Run agent daemon
     """
     from azurelinuxagent.daemon import get_daemon_handler
     daemon_handler = get_daemon_handler()
     daemon_handler.run()
Exemplo n.º 4
0
    def test_check_pid(self, mock_exit, mock_conf, mock_sleep):
        daemon_handler = get_daemon_handler()

        mock_pid_file = os.path.join(self.tmp_dir, "pid")
        mock_conf.get_agent_pid_file_path = Mock(return_value=mock_pid_file)

        daemon_handler.check_pid()
        self.assertTrue(os.path.isfile(mock_pid_file))

        daemon_handler.check_pid()
        mock_exit.assert_any_call(0)
Exemplo n.º 5
0
    def daemon(self):
        """
        Run agent daemon
        """
        child_args = None \
            if self.conf_file_path is None \
                else "-configuration-path:{0}".format(self.conf_file_path)

        from azurelinuxagent.daemon import get_daemon_handler
        daemon_handler = get_daemon_handler()
        daemon_handler.run(child_args=child_args)
Exemplo n.º 6
0
    def daemon(self):
        """
        Run agent daemon
        """
        child_args = None \
            if self.conf_file_path is None \
                else "-configuration-path:{0}".format(self.conf_file_path)

        from azurelinuxagent.daemon import get_daemon_handler
        daemon_handler = get_daemon_handler()
        daemon_handler.run(child_args=child_args)
Exemplo n.º 7
0
    def test_daemon_restart(self, mock_sleep):
        #Mock daemon function
        daemon_handler = get_daemon_handler()
        mock_daemon = Mock(side_effect=MockDaemonCall(daemon_handler, 2))
        daemon_handler.daemon = mock_daemon

        daemon_handler.check_pid = Mock()
 
        daemon_handler.run()

        mock_sleep.assert_any_call(15)
        self.assertEquals(2, daemon_handler.daemon.call_count)
Exemplo n.º 8
0
 def daemon(self):
     """
     Run agent daemon
     """
     set_daemon_version(AGENT_VERSION)
     logger.set_prefix("Daemon")
     threading.current_thread().setName("Daemon")
     child_args = None \
         if self.conf_file_path is None \
             else "-configuration-path:{0}".format(self.conf_file_path)
     from azurelinuxagent.daemon import get_daemon_handler
     daemon_handler = get_daemon_handler()
     daemon_handler.run(child_args=child_args)