def _voidRemoteSetUpCallBackHandler(self, success):
     if success:
         self.ping()
         self.start()
     else:
         error("FATAL : Failed to setup test")
         self.tearDown()
Exemplo n.º 2
0
 def run(self):
     """
     Start executing the tests.
     """
     if self._running:
         error("TestRun is already running")
         return
     # make sure working directory exists
     if not os.path.exists(self._outputdir):
         os.makedirs(self._outputdir)
     self._collectEnvironment()
Exemplo n.º 3
0
    def run(self):
        # 1. setUp the test
        self._teststarttime = time.time()
        if not self.setUp():
            error("Something went wrong during setup !")
            self.stop()
            return False

        if self.__async_setup__:
            # the subclass will call start() on his own
            # put in a timeout check
            self._asynctimeouttime = time.time() + self._asynctimeout
            self._asynctimeoutid = gobject.timeout_add(self._asynctimeout * 1000, self._asyncSetupTimeoutCb)
            return True

        # 2. Start it
        self.start()
        if not self.__async_test__:
            self.stop()

        return True
    def run(self):
        # do something
        debug("Starting in process...")
        self._lock.acquire()
        while True:
            debug("queue:%d _exit:%r _abort:%r",
                    len(self._queue), self._exit,
                    self._abort)
            if self._abort:
                debug("aborting")
                self._lock.release()
                return

            while len(self._queue) == 0:
                debug("queue:%d _exit:%r _abort:%r",
                        len(self._queue), self._exit,
                        self._abort)
                if self._exit:
                    self._lock.release()
                    return
                debug("waiting for cond")
                self._lock.wait()
                debug("cond was triggered")
                if self._abort:
                    self._lock.release()
                    return
            method, args, kwargs = self._queue.pop(0)
            self._lock.release()
            try:
                debug("about to call %r", method)
                method(*args, **kwargs)
            except:
                error("There was a problem calling %r", method)
                error(traceback.format_exc())
            finally:
                debug("Finished calling %r, re-acquiring lock",
                      method)
            self._lock.acquire()
 def _voidRemoteErrBackHandler(self, exc, caller=None, fatal=True):
     error("%r : %s", caller, exc)
     if fatal:
         warning("FATAL : aborting test")
         # a fatal error happened, DIVE DIVE DIVE !
         self.tearDown()
 def _voidRemoteStartCallBackHandler(self, success):
     if not success:
         error("FATAL : Failed to start test")
         self.tearDown()