Exemple #1
0
 def testMonitorLoadMonitorMemory(self):
     """Check if the MemoryMemory is started"""
     self.load_config['enable_memory_monitor'] = True
     monitor.load(self.load_config)
     self.assertEquals(isinstance(monitor.monitor_request, MonitorRequest),
                       True)
     self.assertEquals(isinstance(monitor.monitor_memory, MonitorMemory),
                       True)
 def testMonitorLoadMonitorMemory(self):
   """Check if the MemoryMemory is started"""
   self.load_config['enable_memory_monitor'] = True
   monitor.load(self.load_config)
   self.assertEquals(isinstance(monitor.monitor_request,
                                MonitorRequest),
                                True)
   self.assertEquals(isinstance(monitor.monitor_memory,
                                MonitorMemory),
                                True)
Exemple #3
0
def bootstrapHandler(configuration_dict):
    # Bootstrap handler
    from signal import signal, SIGINT, SIGQUIT, SIGHUP
    from cloudooo.handler.ooo.mimemapper import mimemapper
    from cloudooo.handler.ooo.application.openoffice import openoffice
    import cloudooo.handler.ooo.monitor as monitor

    def stopProcesses(signum, frame):
        monitor.stop()
        openoffice.stop()

    # Signal to stop all processes
    signal(SIGINT, stopProcesses)
    signal(SIGQUIT, stopProcesses)
    signal(SIGHUP, stopProcesses)

    working_path = configuration_dict.get('working_path')
    application_hostname = configuration_dict.get('application_hostname')
    openoffice_port = int(configuration_dict.get('openoffice_port'))
    environment_dict = configuration_dict['env']
    # Loading Configuration to start OOo Instance and control it
    openoffice.loadSettings(
        application_hostname,
        openoffice_port,
        working_path,
        configuration_dict.get('office_binary_path'),
        configuration_dict.get('uno_path'),
        configuration_dict.get('openoffice_user_interface_language', 'en'),
        environment_dict=environment_dict,
    )
    openoffice.start()
    monitor.load(configuration_dict)

    timeout_response = int(configuration_dict.get('timeout_response'))
    kw = dict(uno_path=configuration_dict.get('uno_path'),
              office_binary_path=configuration_dict.get('office_binary_path'),
              timeout=timeout_response,
              ooo_disable_filter_list=configuration_dict.get(
                  'ooo_disable_filter_list'),
              ooo_disable_filter_name_list=configuration_dict.get(
                  'ooo_disable_filter_name_list'))

    # Load all filters
    openoffice.acquire()
    mimemapper.loadFilterList(application_hostname, openoffice_port, **kw)
    openoffice.release()
Exemple #4
0
def bootstrapHandler(configuration_dict):
  # Bootstrap handler
  from signal import signal, SIGINT, SIGQUIT, SIGHUP
  from cloudooo.handler.ooo.mimemapper import mimemapper
  from cloudooo.handler.ooo.application.openoffice import openoffice
  import cloudooo.handler.ooo.monitor as monitor

  def stopProcesses(signum, frame):
    monitor.stop()
    openoffice.stop()

  # Signal to stop all processes
  signal(SIGINT, stopProcesses)
  signal(SIGQUIT, stopProcesses)
  signal(SIGHUP, stopProcesses)

  working_path = configuration_dict.get('working_path')
  application_hostname = configuration_dict.get('application_hostname')
  openoffice_port = int(configuration_dict.get('openoffice_port'))
  environment_dict = configuration_dict['env']
  # Loading Configuration to start OOo Instance and control it
  openoffice.loadSettings(application_hostname,
                          openoffice_port,
                          working_path,
                          configuration_dict.get('office_binary_path'),
                          configuration_dict.get('uno_path'),
                          configuration_dict.get('openoffice_user_interface_language',
                                                 'en'),
                          environment_dict=environment_dict,
                          )
  openoffice.start()
  monitor.load(configuration_dict)

  timeout_response = int(configuration_dict.get('timeout_response'))
  kw = dict(uno_path=configuration_dict.get('uno_path'),
            office_binary_path=configuration_dict.get('office_binary_path'),
            timeout=timeout_response,
            ooo_disable_filter_list=configuration_dict.get('ooo_disable_filter_list'),
            ooo_disable_filter_name_list=configuration_dict.get('ooo_disable_filter_name_list'))

  # Load all filters
  openoffice.acquire()
  mimemapper.loadFilterList(application_hostname,
                            openoffice_port, **kw)
  openoffice.release()
Exemple #5
0
 def testMonitorLoadOnlyMonitorRequest(self):
     """Check if the monitors are started"""
     monitor.load(self.load_config)
     self.assertEquals(isinstance(monitor.monitor_request, MonitorRequest),
                       True)
 def testMonitorLoadOnlyMonitorRequest(self):
     """Check if the monitors are started"""
     monitor.load(self.load_config)
     self.assertEquals(isinstance(monitor.monitor_request, MonitorRequest), True)