Ejemplo n.º 1
0
 def start(self, context):
     if self.enabled:
         command = ['streamline', '-capture', self.session_file, '-output', self.capture_file]
         self.streamline = subprocess.Popen(command,
                                            stdout=subprocess.PIPE,
                                            stderr=subprocess.PIPE,
                                            stdin=subprocess.PIPE,
                                            preexec_fn=os.setpgrp)
         outlogger = StreamLogger('streamline', self.streamline.stdout, klass=LineLogWriter)
         errlogger = StreamLogger('streamline', self.streamline.stderr, klass=LineLogWriter)
         outlogger.start()
         errlogger.start()
Ejemplo n.º 2
0
    def _start_daemon(self):
        self.logger.debug('Starting gatord')
        self.device.killall('gatord', as_root=True)
        if self.configuration_file:
            command = '{} -c {}'.format(self.daemon, self.on_device_config)
        else:

            command = '{}'.format(self.daemon)

        self.daemon_process = self.device.execute(command, as_root=True, background=True)
        outlogger = StreamLogger('gatord', self.daemon_process.stdout)
        errlogger = StreamLogger('gatord', self.daemon_process.stderr, logging.ERROR)
        outlogger.start()
        errlogger.start()
        if self.daemon_process.poll() is not None:
            # If adb returned, something went wrong.
            raise InstrumentError('Could not start gatord.')
Ejemplo n.º 3
0
 def start(self, context):
     command = ['streamline', '-capture', self.session_file, '-output', self.capture_file]
     self.streamline = subprocess.Popen(command,
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.PIPE,
                                        stdin=subprocess.PIPE,
                                        preexec_fn=os.setpgrp)
     outlogger = StreamLogger('streamline', self.streamline.stdout, klass=LineLogWriter)
     errlogger = StreamLogger('streamline', self.streamline.stderr, klass=LineLogWriter)
     outlogger.start()
     errlogger.start()
Ejemplo n.º 4
0
    def _start_daemon(self):
        self.logger.debug('Starting gatord')
        self.device.killall('gatord', as_root=True)
        if self.configuration_file:
            command = '{} -c {}'.format(self.daemon, self.on_device_config)
        else:
            command = '{}'.format(self.daemon)

        self.daemon_process = self.device.execute(command, as_root=True, background=True)
        outlogger = StreamLogger('gatord', self.daemon_process.stdout)
        errlogger = StreamLogger('gatord', self.daemon_process.stderr, logging.ERROR)
        outlogger.start()
        errlogger.start()
        if self.daemon_process.poll() is not None:
            # If adb returned, something went wrong.
            raise InstrumentError('Could not start gatord.')