Beispiel #1
0
    def setUp(self):
        self.conn = r.connect(db=integration.DB,
                              host=integration.HOST,
                              port=integration.PORT)

        self.protocols = []
        self.transports = []

        self.config = dict(nsqd_tcp_address=["127.0.0.1:4150"],
                           lookupd_http_address=["127.0.0.1:4161"],
                           hostname="testserver",
                           group_on_request=True,
                           user_on_request=True,
                           db=integration.DB,
                           rdb_host=integration.HOST,
                           rdb_port=integration.PORT
                           )

        self.ctx = makeContext(self.config)

        self.factory = IRCDDFactory(self.ctx)

        self.clients = 3
        for client in xrange(0, self.clients):

            protocol = self.factory.buildProtocol(("127.0.0.%s" % client, 0))
            self.protocols.append(protocol)

            transport = proto_helpers.StringTransport()
            self.transports.append(transport)

            protocol.makeConnection(transport)
Beispiel #2
0
    def setUp(self):
        self.conn = r.connect(db=integration.DB,
                              host=integration.HOST,
                              port=integration.PORT)

        self.protocols = []
        self.transports = []

        self.config = dict(nsqd_tcp_address=["127.0.0.1:4150"],
                           lookupd_http_address=["127.0.0.1:4161"],
                           hostname="testserver",
                           group_on_request=True,
                           user_on_request=True,
                           db=integration.DB,
                           rdb_host=integration.HOST,
                           rdb_port=integration.PORT)

        self.ctx = makeContext(self.config)

        self.factory = IRCDDFactory(self.ctx)

        self.clients = 3
        for client in xrange(0, self.clients):

            protocol = self.factory.buildProtocol(("127.0.0.%s" % client, 0))
            self.protocols.append(protocol)

            transport = proto_helpers.StringTransport()
            self.transports.append(transport)

            protocol.makeConnection(transport)
Beispiel #3
0
    def setUp(self):
        self.conn = r.connect(db=integration.DB,
                              host=integration.HOST,
                              port=integration.PORT)

        config = dict(nsqd_tcp_address=["127.0.0.1:4150"],
                      lookupd_http_address=["127.0.0.1:4161"],
                      hostname="testserver",
                      group_on_request=True,
                      user_on_request=True,
                      db=integration.DB,
                      rdb_host=integration.HOST,
                      rdb_port=integration.PORT)
        self.ctx = makeContext(config)

        self.ctx["db"].createUser("john", password="******", registered=True)
        self.ctx["db"].createUser("jane", password="******", registered=True)
        self.ctx["db"].createUser("jill", password="******", registered=True)

        self.factory = IRCDDFactory(self.ctx)
        self.protocol = self.factory.buildProtocol(("127.0.0.1", 0))
        self.transport = proto_helpers.StringTransport()
        self.protocol.makeConnection(self.transport)
Beispiel #4
0
    def setUp(self):
        self.conn = r.connect(db=integration.DB,
                              host=integration.HOST,
                              port=integration.PORT)

        config = dict(nsqd_tcp_address=["127.0.0.1:4150"],
                      lookupd_http_address=["127.0.0.1:4161"],
                      hostname="testserver",
                      group_on_request=True,
                      user_on_request=True,
                      db=integration.DB,
                      rdb_host=integration.HOST,
                      rdb_port=integration.PORT
                      )
        self.ctx = makeContext(config)

        self.ctx["db"].createUser("john", password="******", registered=True)
        self.ctx["db"].createUser("jane", password="******", registered=True)
        self.ctx["db"].createUser("jill", password="******", registered=True)

        self.factory = IRCDDFactory(self.ctx)
        self.protocol = self.factory.buildProtocol(("127.0.0.1", 0))
        self.transport = proto_helpers.StringTransport()
        self.protocol.makeConnection(self.transport)
Beispiel #5
0
    def setUp(self):
        self.conn = r.connect(db=integration.DB,
                              host=integration.HOST,
                              port=integration.PORT)

        config = dict(nsqd_tcp_address=["127.0.0.1:4150"],
                      lookupd_http_address=["127.0.0.1:4161"],
                      hostname="testserver",
                      group_on_request=True,
                      user_on_request=True,
                      db=integration.DB,
                      rdb_host=integration.HOST,
                      rdb_port=integration.PORT
                      )
        self.ctx = makeContext(config)

        self.factory = IRCDDFactory(self.ctx)
        self.protocol = self.factory.buildProtocol(("127.0.0.1", 0))
        self.transport = proto_helpers.StringTransport()
        self.protocol.makeConnection(self.transport)

        self.shardedUser = ShardedUser(self.ctx, "john")
        self.shardedUser.mind = self.protocol
        self.shardedUser.mind.name = "john"
Beispiel #6
0
 def makeService(self, config):
     ctx = context.makeContext(config)
     return ircdd_server.makeServer(ctx)
Beispiel #7
0
 def makeService(self, config):
     ctx = context.makeContext(config)
     return ircdd_server.makeServer(ctx)