def _create_sensors(self):
        # Wait for unity to start running.
        Eventually(Equals(True)).match(
            lambda: process_helpers.is_job_running('unity8'))

        # Wait for the sensors fifo file to be created.
        fifo_path = '/tmp/sensor-fifo-{0}'.format(
            process_helpers._get_unity_pid())
        Eventually(Equals(True)).match(
            lambda: os.path.exists(fifo_path))

        with open(fifo_path, 'w') as fifo:
            fifo.write('create accel 0 1000 0.1\n')
            fifo.write('create light 0 10 1\n')
            fifo.write('create proximity\n')
 def setUpClass(cls):
     try:
         is_unity_running = process_helpers.is_job_running('unity8')
     except process_helpers.JobError as e:
         xdg_config_home = os.getenv(
             'XDG_CONFIG_HOME', os.path.join(os.getenv('HOME'), '.config'))
         upstart_config_path = os.path.join(xdg_config_home, 'upstart')
         logger.error('`initctl status unity8` failed, most probably the '
                      'unity8 session could not be found:\n\n'
                      '{0}\n'
                      'Please install unity8 or copy data/unity8.conf to '
                      '{1}\n'.format(e.output, upstart_config_path))
         raise e
     else:
         assert not is_unity_running, (
             'Unity is currently running, these tests require it to be '
             'stopped.\n'
             'Please run this command before running these tests: \n'
             'initctl stop unity8\n')
Exemple #3
0
 def setUpClass(cls):
     try:
         is_unity_running = process_helpers.is_job_running('unity8')
     except process_helpers.JobError as e:
         xdg_config_home = os.getenv(
             'XDG_CONFIG_HOME', os.path.join(os.getenv('HOME'), '.config'))
         upstart_config_path = os.path.join(xdg_config_home, 'upstart')
         logger.error(
             '`initctl status unity8` failed, most probably the '
             'unity8 session could not be found:\n\n'
             '{0}\n'
             'Please install unity8 or copy data/unity8.conf to '
             '{1}\n'.format(e.output, upstart_config_path)
         )
         raise e
     else:
         assert not is_unity_running, (
             'Unity is currently running, these tests require it to be '
             'stopped.\n'
             'Please run this command before running these tests: \n'
             'initctl stop unity8\n')
 def ensure_dash_not_running(self):
     if process_helpers.is_job_running('unity8-dash'):
         process_helpers.stop_job('unity8-dash')
Exemple #5
0
 def ensure_dash_not_running(self):
     if process_helpers.is_job_running('unity8-dash'):
         process_helpers.stop_job('unity8-dash')
 def ensure_service_not_running(self):
     if process_helpers.is_job_running('unity-mock-indicator-service'):
         self.stop_service()