def main(argv, stdout, stderr):
    # This is a copy of serve.py main function, except for the wait step
    config = WebPlatformTestServer.load_config("config.default.json",
                                               "config.json")
    WebPlatformTestServer.setup_logger(config["log_level"])
    ssl_env = WebPlatformTestServer.get_ssl_environment(config)
    logged_servers = []
    with WebPlatformTestServer.get_ssl_environment(config) as ssl_env:
        config_, started_servers = WebPlatformTestServer.start(config, ssl_env)

        for protocol, servers in started_servers.items():
            for port, process in servers:
                logged_servers.append({
                    "protocol": protocol,
                    "port": port,
                    "pid": process.proc.pid
                })
                logger.info("%s, port:%d, pid:%d" %
                            (protocol, port, process.proc.pid))

    # Write pids in a file in case abrupt shutdown is needed
    with open(argv[0], "wb") as servers_file:
        json.dump(logged_servers, servers_file)

    sys.stdin.read(1)
Example #2
0
def main(argv, stdout, stderr):
    # This is a copy of serve.py main function, except for the wait step
    config = WebPlatformTestServer.load_config("config.default.json", "config.json")
    WebPlatformTestServer.setup_logger(config["log_level"])
    ssl_env = WebPlatformTestServer.get_ssl_environment(config)
    with WebPlatformTestServer.get_ssl_environment(config) as ssl_env:
        config_, started_servers = WebPlatformTestServer.start(config, ssl_env)

        for protocol, servers in started_servers.items():
            for port, process in servers:
                logger.info("%s, port:%d, pid:%d" % (protocol, port, process.proc.pid))

    sys.stdin.read(1)
def main(argv, stdout, stderr):
    # This is a copy of serve.py main function, except for the wait step
    config = WebPlatformTestServer.load_config("config.default.json", "config.json")
    WebPlatformTestServer.setup_logger(config["log_level"])
    ssl_env = WebPlatformTestServer.get_ssl_environment(config)
    logged_servers = []
    with WebPlatformTestServer.get_ssl_environment(config) as ssl_env:
        config_, started_servers = WebPlatformTestServer.start(config, ssl_env)

        for protocol, servers in started_servers.items():
            for port, process in servers:
                logged_servers.append({"protocol": protocol, "port": port, "pid": process.proc.pid})
                logger.info("%s, port:%d, pid:%d" % (protocol, port, process.proc.pid))

    # Write pids in a file in case abrupt shutdown is needed
    with open(argv[0], "wb") as servers_file:
        json.dump(logged_servers, servers_file)

    sys.stdin.read(1)