def test_litmus_with_authentication(self): """Run litmus test suite on HTTP with authentification. This test passes """ try: proc = Process(target=run_wsgidav_server, args=(True, False)) proc.daemon = True proc.start() time.sleep(1) try: self.assertEqual(subprocess.call(["litmus", "http://127.0.0.1:8080/", "tester", "secret"]), 0, "litmus suite failed: check the log") except OSError: print "*" * 70 print "This test requires the litmus test suite." print "See http://www.webdav.org/neon/litmus/" print "*" * 70 raise finally: proc.terminate() proc.join()
def test_litmus_with_authentication(self): """Run litmus test suite on HTTP with authentification. This test passes """ try: proc = Process(target=run_wsgidav_server, args=(True, False)) proc.daemon = True proc.start() time.sleep(1) try: self.assertEqual( subprocess.call([ "litmus", "http://127.0.0.1:8080/", "tester", "secret" ]), 0, "litmus suite failed: check the log") except OSError: print "*" * 70 print "This test requires the litmus test suite." print "See http://www.webdav.org/neon/litmus/" print "*" * 70 raise finally: proc.terminate() proc.join()
def process(host,port): from multiprocessing.process import Process p = Process(target=run, args=(host,port)) p.daemon = True p.start() return p
def _launch(type_name, config, is_important): plugin_clazz = _get_type(type_name) if not plugin_clazz: logging.warn('could not find %s plugin' % type_name) d = plugin_clazz(config) p = Process(target=d.start) p.daemon = not is_important p.name = 'plugin: %s' % d.name p.start()
def main(): ''' parse the command line - new up the appl and listen on port ''' if os.path.isfile("../kew_pe.conf"): print ("Loading config file ../kew_pe.conf") options.parse_config_file("../kew_pe.conf") options.parse_command_line() logging.basicConfig(level=logging.DEBUG) #report_control.process('localhost',8081) process = Process(target=report_control.run, name="report_control", kwargs={'host':'localhost', 'port':8081}) process.daemon = True process.start()
def start_actor_server( actor, host_port_tuple=None, start_in_background_thread=False, log_requests=False, server_starter=start_bjoern_server ): if server_starter != start_bjoern_server: print("Using builtin server (slow)") if not host_port_tuple: # if no specific port is given, # run on free port host_port_tuple = ('', 0) port = host_port_tuple[1] if host_port_tuple[1] == 0: port = get_free_port(host_port_tuple) host_name = get_host_name(host_port_tuple[0]) host_uri = 'http://{0}:{1}'.format(host_name, port) print("Running server on {0}".format(host_uri)) wsgi_application = get_wsgi_application( actor, host_uri, log_requests=log_requests ) if start_in_background_thread: process = Process( target=server_starter, args=(wsgi_application, host_name, port) ) process.daemon = True process.start() return host_uri, process server_starter(wsgi_application, host_name, port)
def cli(config): _configure_logging() config = yaml.load(config) for plugin_config in config['plugins']: plugin_config['redis'] = config['redis'] _launch(plugin_config['type'], plugin_config, False) sleep(3) # wait for plugins to subscribe to queues from triviabot.daemon import Daemon core_config = config['core'] core_config['redis'] = config['redis'] daemon = Daemon(core_config) p = Process(target=daemon.run) p.daemon = True p.run() while True: sleep(1)
def build_process(target): f51fp = Process(target=target, name=target.__name__) f51fp.daemon = 1 f51fp.start() return f51fp
def build_process(target): f51fp = Process(target=target, name=target.__name__) f51fp.daemon = 1 f51fp.start() return f51fp