Ejemplo n.º 1
0
    def testIntegration(self):
        # CONFIG:
        config.beah_conf(args=[])
        conf = config.get_conf('beah')
        srv = start_server(conf=conf)
        log = logging.getLogger('backend')

        class FakeTask(object):
            origin = {'signature': 'FakeTask'}
            task_id = 'no-id'

            def proc_cmd(self, cmd):
                log.debug("FakeTask.proc_cmd(%r)", cmd)

        class FakeBackend(object):
            def proc_evt(self, evt, **kwargs):
                log.debug("FakeBackend.proc_evt(%r, **%r)", evt, kwargs)

        t = FakeTask()
        reactor.callLater(2, srv.proc_evt, t,
                          event.variable_set('say_hi', 'Hello World!'))
        #reactor.callLater(2.1, srv.proc_evt, t, event.variable_get('say_hi'))
        reactor.callLater(2.2, srv.proc_evt, t,
                          event.variable_get('say_hi', dest='test.loop'))

        b = FakeBackend()
        reactor.callLater(3, srv.proc_cmd, b, command.kill())

        forwarder.main(args=[])
Ejemplo n.º 2
0
    def testIntegration(self):
        # CONFIG:
        config.beah_conf(args=[])
        conf = config.get_conf('beah')
        srv = start_server(conf=conf)
        log = logging.getLogger('backend')

        class FakeTask(object):
            origin = {'signature':'FakeTask'}
            task_id = 'no-id'
            def proc_cmd(self, cmd):
                log.debug("FakeTask.proc_cmd(%r)", cmd)

        class FakeBackend(object):
            def proc_evt(self, evt, **kwargs):
                log.debug("FakeBackend.proc_evt(%r, **%r)", evt, kwargs)

        t = FakeTask()
        reactor.callLater(2, srv.proc_evt, t, event.variable_set('say_hi', 'Hello World!'))
        #reactor.callLater(2.1, srv.proc_evt, t, event.variable_get('say_hi'))
        reactor.callLater(2.2, srv.proc_evt, t, event.variable_get('say_hi', dest='test.loop'))

        b = FakeBackend()
        reactor.callLater(3, srv.proc_cmd, b, command.kill())

        forwarder.main(args=[])
Ejemplo n.º 3
0
 def xmlrpc_set(self, recipe_set_id, test_order, result_server, hostname,
                state):
     log.debug("XMLRPC: sync.set(%r, %r, %r, %r, %r)", recipe_set_id,
               test_order, result_server, hostname, state)
     evt = event.variable_set('sync/recipe_set_%s/test_order_%s/long_state' \
             % (recipe_set_id, test_order),
             state, method=event.VARIABLE_SET_METHOD.APPEND, dest=self.trhostname(hostname))
     self.main.send_evt(evt)
     return 0  # or "Failure reason"
Ejemplo n.º 4
0
 def xmlrpc_set(self, recipe_set_id, test_order, result_server, hostname,
         state):
     log.debug("XMLRPC: sync.set(%r, %r, %r, %r, %r)", recipe_set_id,
             test_order, result_server, hostname, state)
     evt = event.variable_set('sync/recipe_set_%s/test_order_%s/long_state' \
             % (recipe_set_id, test_order),
             state, method=event.VARIABLE_SET_METHOD.APPEND, dest=self.trhostname(hostname))
     self.main.send_evt(evt)
     return 0 # or "Failure reason"