Ejemplo n.º 1
0
def test_overlay_network_deployment_and_endpoints():
    # double check
    sdk_tasks.check_running(config.SERVICE_NAME, config.DEFAULT_BROKER_COUNT)
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "", 2)
    assert "broker" in endpoints, "broker is missing from endpoints {}".format(endpoints)
    assert "zookeeper" in endpoints, "zookeeper missing from endpoints {}".format(endpoints)
    broker_endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "broker", 3)
    sdk_networks.check_endpoints_on_overlay(broker_endpoints)

    zookeeper = sdk_cmd.svc_cli(config.PACKAGE_NAME, config.SERVICE_NAME, 'endpoints zookeeper')
    assert zookeeper.rstrip() == 'master.mesos:2181/{}'.format(sdk_utils.get_zk_path(config.SERVICE_NAME))
Ejemplo n.º 2
0
def test_endpoints_on_overlay():
    endpoint_types_without_ingest = (
        'coordinator-http', 'coordinator-transport',
        'data-http', 'data-transport',
        'master-http', 'master-transport')

    observed_endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "",
                                                             len(endpoint_types_without_ingest))
    for endpoint in endpoint_types_without_ingest:
        assert endpoint in observed_endpoints, "missing {} endpoint".format(endpoint)
        specific_endpoint = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, endpoint, 3)
        sdk_networks.check_endpoints_on_overlay(specific_endpoint)
Ejemplo n.º 3
0
def test_endpoints_on_overlay():
    observed_endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "", 2)
    expected_endpoints = ("hdfs-site.xml", "core-site.xml")
    for endpoint in expected_endpoints:
        assert endpoint in observed_endpoints, "missing {} endpoint".format(endpoint)
        xmlout = sdk_cmd.svc_cli(config.PACKAGE_NAME, config.SERVICE_NAME, 'endpoints {}'.format(endpoint))
        ElementTree.fromstring(xmlout)
Ejemplo n.º 4
0
def test_tls_endpoints(kafka_service_tls):
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "", 2)
    assert BROKER_TLS_ENDPOINT in endpoints

    # Test that broker-tls endpoint is available
    endpoint_tls = sdk_cmd.svc_cli(config.PACKAGE_NAME, config.SERVICE_NAME,
                                   'endpoints {name}'.format(name=BROKER_TLS_ENDPOINT), json=True)
    assert len(endpoint_tls['dns']) == config.DEFAULT_BROKER_COUNT
Ejemplo n.º 5
0
def test_tls_endpoints(kafka_service_tls):
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME,
                                                    config.SERVICE_NAME, "", 2)
    assert BROKER_TLS_ENDPOINT in endpoints

    # Test that broker-tls endpoint is available
    endpoint_tls = sdk_cmd.svc_cli(
        config.PACKAGE_NAME,
        config.SERVICE_NAME,
        'endpoints {name}'.format(name=BROKER_TLS_ENDPOINT),
        json=True)
    assert len(endpoint_tls['dns']) == config.DEFAULT_BROKER_COUNT
Ejemplo n.º 6
0
def test_endpoints_on_overlay():
    observed_endpoints = sdk_networks.get_and_test_endpoints(
        "", config.PACKAGE_NAME, 2)
    expected_endpoints = ("hdfs-site.xml", "core-site.xml")
    for endpoint in expected_endpoints:
        assert endpoint in observed_endpoints, "missing {} endpoint".format(
            endpoint)
        xmlout, err, rc = shakedown.run_dcos_command("{} endpoints {}".format(
            config.PACKAGE_NAME, endpoint))
        assert rc == 0, "failed to get {} endpoint. \nstdout:{},\nstderr:{} ".format(
            endpoint, xmlout, err)
        ElementTree.fromstring(xmlout)
def test_custom_service_tld():
    custom_tld = sdk_hosts.get_crypto_id_domain()
    sdk_install.install(
        config.PACKAGE_NAME,
        config.SERVICE_NAME,
        1,
        additional_options={
            "service": {
                "custom_service_tld": custom_tld,
                "yaml": "custom_tld",
            }
        })

    # Verify the endpoints are correct
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "test", 2)
    for entry in endpoints["dns"]:
        assert custom_tld in entry
def test_custom_service_tld():
    custom_tld = sdk_hosts.get_crypto_id_domain()
    sdk_install.install(config.PACKAGE_NAME,
                        config.SERVICE_NAME,
                        1,
                        additional_options={
                            "service": {
                                "custom_service_tld": custom_tld,
                                "yaml": "custom_tld",
                            }
                        })

    # Verify the endpoints are correct
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME,
                                                    config.SERVICE_NAME,
                                                    "test", 2)
    for entry in endpoints["dns"]:
        assert custom_tld in entry
Ejemplo n.º 9
0
def test_no_vip(kafka_client, kafka_server, kerberos):
    endpoints = sdk_networks.get_and_test_endpoints(kafka_server["package_name"], kafka_server["service"]["name"], "broker", 2)
    assert "vip" not in endpoints
def test_no_vip(kafka_client, kafka_server, kerberos):
    endpoints = sdk_networks.get_and_test_endpoints(kafka_server["package_name"], kafka_server["service"]["name"], "broker", 2)
    assert "vip" not in endpoints
Ejemplo n.º 11
0
def test_endpoints():
    # tests that the correct number of endpoints are found, should just be "native-client":
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "", 1)
    assert "native-client" in endpoints, "Cassandra endpoints should contain only 'native-client', got {}".format(endpoints)
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "native-client", 2)
    sdk_networks.check_endpoints_on_overlay(endpoints)
def test_endpoints():
    # tests that the correct number of endpoints are found, should just be "native-client":
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "", 1)
    assert "native-client" in endpoints, "Cassandra endpoints should contain only 'native-client', got {}".format(endpoints)
    endpoints = sdk_networks.get_and_test_endpoints(config.PACKAGE_NAME, config.SERVICE_NAME, "native-client", 2)
    sdk_networks.check_endpoints_on_overlay(endpoints)
Ejemplo n.º 13
0
def test_endpoints():
    endpoints = sdk_networks.get_and_test_endpoints("", config.PACKAGE_NAME, 1)  # tests that the correct number of endpoints are found, should just be "node"
    assert "node" in endpoints, "Cassandra endpoints should contain only 'node', got {}".format(endpoints)
    endpoints = sdk_networks.get_and_test_endpoints("node", config.PACKAGE_NAME, 3)
    assert "address" in endpoints, "Endpoints missing address key"
    sdk_networks.check_endpoints_on_overlay(endpoints)