Ejemplo n.º 1
0
    def shutdown(signum = None, frame = None):
        with stopLock:
            global stopped
            if stopped:
                return
            else:
                stopped = True
        logging.getLogger().info("Shutting down probe")
        Scheduler.quit()
        if Params.COMMANDER and commander is not None:
            commander.quit()
        from calls.actions import Quit

        if Params.WATCHERS:
            WatcherManager.stopWatchers()
        from managers.probetests import TestManager, TestResponder

        TestManager.stopTests()
        TestResponder.stopTests()
        if actionMan is not None:
            ActionMan.addTask(Quit())
        if server is not None:
            server.quit()
        if actionMan is not None:
            actionMan.quit()
        #everybody might need the client so stop it last
        if client is not None:
            client.quit()
Ejemplo n.º 2
0
    def shutdown(signum=None, frame=None):
        with stopLock:
            global stopped
            if stopped:
                return
            else:
                stopped = True
        logging.getLogger().info("Shutting down probe")
        Scheduler.quit()
        if Params.COMMANDER and commander is not None:
            commander.quit()
        from calls.actions import Quit

        if Params.WATCHERS:
            WatcherManager.stopWatchers()
        from managers.probetests import TestManager, TestResponder

        TestManager.stopTests()
        TestResponder.stopTests()
        if actionMan is not None:
            ActionMan.addTask(Quit())
        if server is not None:
            server.quit()
        if actionMan is not None:
            actionMan.quit()
        #everybody might need the client so stop it last
        if client is not None:
            client.quit()
Ejemplo n.º 3
0
    def treatTestMessage(cls, message):
        """Treats a test message which can be Testee or Tester kind
        Testee are given to TesteeManager
        Tester are given to testResponder
        :param message: testMessage to treat

        """
        cls.logger.ddebug("Handling Tester or Testee message")
        assert isinstance(message, TestMessage)
        # if probe is in test mode, give the message right to the TestManager!
        if isinstance(message, TesteeAnswer):
            cls.logger.ddebug("Handling TesteeAnswer")
            TestManager.handleMessage(message)
        elif isinstance(message, TesterMessage):
            cls.logger.ddebug("Handling TesterMessage")
            TestResponder.handleMessage(message)
        elif isinstance(message, TestMessage):
            #Prepare are test messages
            ActionMan.addTask(MTA.toAction(message))
Ejemplo n.º 4
0
    def treatTestMessage(cls, message):
        """Treats a test message which can be Testee or Tester kind
        Testee are given to TesteeManager
        Tester are given to testResponder
        :param message: testMessage to treat

        """
        cls.logger.ddebug("Handling Tester or Testee message")
        assert isinstance(message, TestMessage)
        # if probe is in test mode, give the message right to the TestManager!
        if isinstance(message, TesteeAnswer):
            cls.logger.ddebug("Handling TesteeAnswer")
            TestManager.handleMessage(message)
        elif isinstance(message, TesterMessage):
            cls.logger.ddebug("Handling TesterMessage")
            TestResponder.handleMessage(message)
        elif isinstance(message, TestMessage):
            #Prepare are test messages
            ActionMan.addTask(MTA.toAction(message))
Ejemplo n.º 5
0
 def abortProbeTest(cls, testId):
     ProbeTestManager.stopTest(testId)
Ejemplo n.º 6
0
 def doTest(cls, testName, testOptions, resultCallback, errorCallback, formatResult = False):
     return ProbeTestManager.startTest(testName, testOptions, resultCallback, errorCallback,
                                       formatResult = formatResult)