def engine_cert(engine_fqdn, engine_ip): with http_proxy_disabled(): with tempfile.NamedTemporaryFile(prefix="engine-cert", suffix=".pem") as cert_file: shell([ "curl", "-fsS", "-m", "10", "--resolve", "{}:80:{}".format(engine_fqdn, engine_ip), "-o", cert_file.name, "http://{}/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA" .format(engine_fqdn) ]) yield cert_file.name
def _grid(engine_fqdn, engine_ip, node_images, hub_image, hub_port): if node_images is None: node_images = [CHROME_CONTAINER_IMAGE, FIREFOX_CONTAINER_IMAGE] engine_dns_entry = "{}:{}".format(engine_fqdn, engine_ip) with common.http_proxy_disabled(): with _pod(hub_port) as pod_name: with _hub(hub_image, hub_port, pod_name) as hub_name: with _nodes(node_images, hub_port, pod_name, engine_dns_entry) as node_names: url = common.GRID_URL_TEMPLATE.format(HUB_IP, hub_port) try: common.grid_health_check(url, len(node_images)) yield url except common.SeleniumGridError: _log_issues(pod_name, hub_name, node_names) raise
def grid(engine_fqdn, engine_ip, node_images=None, hub_image=HUB_CONTAINER_IMAGE, hub_port=HUB_PORT, network_name=NETWORK_NAME): if node_images is None: node_images = [CHROME_CONTAINER_IMAGE, FIREFOX_CONTAINER_IMAGE] engine_dns_entry = "{}:{}".format(engine_fqdn, engine_ip) with common.http_proxy_disabled(): with _network(network_name): with _hub(hub_image, hub_port, network_name) as (hub_name, hub_ip): with _nodes(node_images, hub_ip, hub_port, network_name, engine_dns_entry) as node_names: url = common.GRID_URL_TEMPLATE.format(hub_ip, hub_port) try: common.grid_health_check(url, len(node_images)) except RuntimeError: _log_issues(hub_name, node_names) raise yield url
def engine_is_alive(): with http_proxy_disabled(): engine_download(health_url) return True