Ejemplo n.º 1
0
 def create_client(client_name, port=None):
     xmpp_account = xmpp_account_factory(client_name)
     if not port:
         port = xmpp_server.c2s_port
     client = Client(xmpp_account, port=port, config=config)
     clients.append(client)
     return client
Ejemplo n.º 2
0
 def _setup_clients(self):
     self.proxy_servers = []
     for n in range(len(self.test_data["clients"])):
         client_data = self.test_data["clients"][n]
         sock_path = os.path.join(self.sock_path, client_data["account"])
         client_data["port"] = 5224 + n
         self.proxy_servers.append(LatencyProxyServer("localhost", client_data["port"], self.server_host, 5222, int(client_data["latency"])))
         self.clients.append(Client(client_data, self.config, sock_path, self.debug))
         self._adduser(client_data)
Ejemplo n.º 3
0
 def _setup_clients(self):
     for n in range(int(self.test_data["clients"]["count"])):
         account = "client%03d@localhost" % n
         client_data = {
             "account" : account,
             "password" : "password",
             "room" : self.test_data["clients"]["room"],
             "server" : self.test_data["clients"]["server"]}
         sock_path = os.path.join(self.sock_path, client_data["account"])
         self.clients.append(Client(client_data, self.config, sock_path, self.debug))
         self._adduser(client_data)
Ejemplo n.º 4
0
 def _setup_clients(self):
     self.proxy_servers = []
     for n in range(int(self.test_data["clients"]["count"])):
         account = "client%03d@localhost" % n
         client_data = {
             "account": account,
             "password": "******",
             "room": self.test_data["clients"]["room"],
             "server": self.test_data["clients"]["server"],
             "port": 15224 + n
         }
         self.proxy_servers.append(
             ReorderProxyServer("localhost", client_data["port"],
                                self.server_host, 5222))
         sock_path = os.path.join(self.sock_path, client_data["account"])
         self.clients.append(
             Client(client_data, self.config, sock_path, self.debug))
         self._adduser(client_data)
Ejemplo n.º 5
0
 def _setup_clients(self):
     self.proxy_servers = []
     num_clients = int(self.test_data["clients"]["count"])
     for n in range(num_clients):
         account = "client%03d@localhost" % n
         client_data = {
             "account": account,
             "password": "******",
             "room": self.test_data["clients"]["room"],
             "server": self.test_data["clients"]["server"],
             "port": 15224 + n
         }
         if n == (num_clients - 2):  # second to last client
             client_data["port"] = 15524 + n
             self.proxy_servers.append(
                 DisconnectProxyServer("localhost", client_data["port"],
                                       self.server_host, 5222))
         sock_path = os.path.join(self.sock_path, client_data["account"])
         self.clients.append(
             Client(client_data, self.config, sock_path, self.debug))
         self._adduser(client_data)