def run_bep44_seeder(self, name, idx_key, args, deferred_cache_ready, deferred_result_got_cached): config = OuinetConfig(name, TestFixtures.BEP44_CACHE_TIMEOUT, ["--index-bep44-public-key", idx_key] + args, benchmark_regexes=[TestFixtures.BEP44_CACHE_READY_REGEX, TestFixtures.BEP44_RESPONSE_CACHED_REGEX]) return self._run_cache_client(OuinetBEP44Client, config, [deferred_cache_ready, deferred_result_got_cached])
def run_tcp_injector(self, injector_args, deffered_tcp_port_ready): injector = OuinetInjector( OuinetConfig(app_name=TestFixtures.TCP_INJECTOR_NAME + "_tcp", timeout=TestFixtures.TCP_TRANSPORT_TIMEOUT, argv=injector_args, benchmark_regexes=[TestFixtures.TCP_PORT_READY_REGEX ]), [deffered_tcp_port_ready]) injector.start() self.proc_list.append(injector) return injector
def run_tcp_client(self, name, args, deffered_tcp_port_ready): client = OuinetClient( OuinetConfig(name, TestFixtures.TCP_TRANSPORT_TIMEOUT, args, benchmark_regexes=[TestFixtures.TCP_PORT_READY_REGEX ]), [deffered_tcp_port_ready]) client.start() self.proc_list.append(client) return client
def run_cache_client(self, name, args, deferred_cache_ready): client = OuinetIPFSClient( OuinetConfig( name, TestFixtures.IPFS_CACHE_TIMEOUT, args, benchmark_regexes=[TestFixtures.IPFS_CACHE_READY_REGEX]), [deferred_cache_ready]) client.start() self.proc_list.append(client) return client
def run_i2p_injector(self, injector_args, deferred_i2p_ready): injector = OuinetI2PInjector( OuinetConfig( TestFixtures.I2P_INJECTOR_NAME + "_i2p", TestFixtures.I2P_TRANSPORT_TIMEOUT, injector_args, benchmark_regexes=[TestFixtures.I2P_TUNNEL_READY_REGEX]), [deferred_i2p_ready]) injector.start() self.proc_list.append(injector) return injector
def run_i2p_injector(self, injector_args, deferred_i2p_ready): injector = OuinetI2PInjector( OuinetConfig( TestFixtures.I2P_INJECTOR_NAME + "_i2p", TestFixtures.I2P_TRANSPORT_TIMEOUT, injector_args, benchmark_regexes=[TestFixtures.I2P_TUNNEL_READY_REGEX]), [deferred_i2p_ready], TestFixtures.I2P_REUSE_PREDEFINED_IDENTITY and TestFixtures.INJECTOR_I2P_PRIVATE_KEY or None) injector.start() self.proc_list.append(injector) return injector
def run_cache_injector(self, injector_args, deferred_tcp_port_ready, deferred_result_got_cached): injector = OuinetIPFSCacheInjector( OuinetConfig(TestFixtures.CACHE_INJECTOR_NAME, TestFixtures.IPFS_CACHE_TIMEOUT, injector_args, benchmark_regexes=[ TestFixtures.TCP_PORT_READY_REGEX, TestFixtures.REQUEST_CACHED_REGEX ]), [deferred_tcp_port_ready, deferred_result_got_cached]) injector.start() self.proc_list.append(injector) return injector
def run_i2p_client(self, name, idx_key, args, deferred_i2p_ready): client = OuinetClient(OuinetConfig(name, TestFixtures.I2P_TRANSPORT_TIMEOUT, args, benchmark_regexes=[TestFixtures.I2P_TUNNEL_READY_REGEX]), [deferred_i2p_ready]) client.start() self.proc_list.append(client) return client
def _cache_injector_config(self, timeout, evt_regexes, args): return OuinetConfig(TestFixtures.CACHE_INJECTOR_NAME, timeout, args, benchmark_regexes=([TestFixtures.TCP_PORT_READY_REGEX] + evt_regexes))