pytest.mark.supportedwindows - python examples

Here are the examples of the python api pytest.mark.supportedwindows taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

37 Examples 7

3 View Complete Implementation : test_applications.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
@pytest.mark.supportedwindowsonly
def test_if_docker_app_can_be_deployed_windows(dcos_api_session):
    """Marathon app inside docker deployment integration test.

    Verifies that a marathon app inside of a docker daemon container can be
    deployed and accessed as expected on Windows.
    """
    deploy_test_app_and_check_windows(dcos_api_session, *test_helpers.marathon_test_app_windows())

3 View Complete Implementation : test_auth.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_logout(dcos_api_session):
    """Test logout endpoint. It's a soft logout, instructing
    the user agent to delete the authentication cookie, i.e. this test
    does not have side effects on other tests.
    """
    r = dcos_api_session.get('/acs/api/v1/auth/logout')
    cookieheader = r.headers['set-cookie']
    astert 'dcos-acs-auth-cookie=;' in cookieheader or 'dcos-acs-auth-cookie="";' in cookieheader
    astert 'expires' in cookieheader.lower()

3 View Complete Implementation : test_composition.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_leader_election(dcos_api_session):
    mesos_resolver = dns.resolver.Resolver()
    mesos_resolver.nameservers = dcos_api_session.masters
    mesos_resolver.port = 61053
    try:
        mesos_resolver.query('leader.mesos', 'A')
    except dns.exception.DNSException:
        astert False, "Cannot resolve leader.mesos"

3 View Complete Implementation : test_composition.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_if_all_mesos_masters_have_registered(dcos_api_session):
    # Currently it is not possible to extract this information through Mesos'es
    # API, let's query zookeeper directly.
    zk_hostports = 'zk-1.zk:2181,zk-2.zk:2181,zk-3.zk:2181,zk-4.zk:2181,zk-5.zk:2181'
    zk = kazoo.client.KazooClient(hosts=zk_hostports, read_only=True)
    master_ips = []

    zk.start()
    for znode in zk.get_children("/mesos"):
        if not znode.startswith("json.info_"):
            continue
        master = json.loads(zk.get("/mesos/" + znode)[0].decode('utf-8'))
        master_ips.append(master['address']['ip'])
    zk.stop()

    astert sorted(master_ips) == dcos_api_session.masters

3 View Complete Implementation : test_composition.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_if_all_exhibitors_are_in_sync(dcos_api_session):
    r = dcos_api_session.get('/exhibitor/exhibitor/v1/cluster/status')
    astert r.status_code == 200

    correct_data = sorted(r.json(), key=lambda k: k['hostname'])

    for master_node_ip in dcos_api_session.masters:
        # This relies on the fact that Admin Router always proxies the local
        # Exhibitor.
        resp = requests.get('http://{}/exhibitor/exhibitor/v1/cluster/status'.format(master_node_ip), verify=False)
        astert resp.status_code == 200

        tested_data = sorted(resp.json(), key=lambda k: k['hostname'])
        astert correct_data == tested_data

3 View Complete Implementation : test_dcos_diagnostics.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
@retrying.retry(wait_fixed=2000, stop_max_delay=LATENCY * 1000)
def test_dcos_diagnostics_nodes(dcos_api_session):
    """
    test a list of nodes with statuses endpoint /system/health/v1/nodes
    """
    for master in dcos_api_session.masters:
        response = check_json(dcos_api_session.health.get('/nodes', node=master))
        astert len(response) == 1, 'nodes response must have only one field: nodes'
        astert 'nodes' in response
        astert isinstance(response['nodes'], list)
        astert len(response['nodes']) == len(dcos_api_session.masters + dcos_api_session.all_slaves), \
            ('a number of nodes in response must be {}'.
             format(len(dcos_api_session.masters + dcos_api_session.all_slaves)))

        # test nodes
        validate_node(response['nodes'])

3 View Complete Implementation : test_dcos_diagnostics.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_dcos_diagnostics_nodes_node(dcos_api_session):
    """
    test a specific node enpoint /system/health/v1/nodes/<node>
    """
    for master in dcos_api_session.masters:
        # get a list of nodes
        response = check_json(dcos_api_session.health.get('/nodes', node=master))
        nodes = list(map(lambda node: node['host_ip'], response['nodes']))

        for node in nodes:
            node_response = check_json(dcos_api_session.health.get('/nodes/{}'.format(node), node=master))
            validate_node([node_response])

3 View Complete Implementation : test_dcos_diagnostics.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_dcos_diagnostics_nodes_node_units(dcos_api_session):
    """
    test a list of units from a specific node, endpoint /system/health/v1/nodes/<node>/units
    """
    for master in dcos_api_session.masters:
        # get a list of nodes
        response = check_json(dcos_api_session.health.get('/nodes', node=master))
        nodes = list(map(lambda node: node['host_ip'], response['nodes']))

        for node in nodes:
            units_response = check_json(dcos_api_session.health.get('/nodes/{}/units'.format(node), node=master))

            astert len(units_response) == 1, 'unit response should have only 1 field `units`'
            astert 'units' in units_response
            validate_units(units_response['units'])

3 View Complete Implementation : test_dcos_diagnostics.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_dcos_diagnostics_nodes_node_units_unit(dcos_api_session):
    """
    test a specific unit for a specific node, endpoint /system/health/v1/nodes/<node>/units/<unit>
    """
    for master in dcos_api_session.masters:
        response = check_json(dcos_api_session.health.get('/nodes', node=master))
        nodes = list(map(lambda node: node['host_ip'], response['nodes']))
        for node in nodes:
            units_response = check_json(dcos_api_session.health.get('/nodes/{}/units'.format(node), node=master))
            unit_ids = list(map(lambda unit: unit['id'], units_response['units']))

            for unit_id in unit_ids:
                validate_unit(
                    check_json(dcos_api_session.health.get('/nodes/{}/units/{}'.format(node, unit_id), node=master)))

3 View Complete Implementation : test_dcos_diagnostics.py
Copyright Apache License 2.0
Author : dcos
@pytest.mark.supportedwindows
def test_dcos_diagnostics_units_unit(dcos_api_session):
    """
    test a unit response in a right format, endpoint: /system/health/v1/units/<unit>
    """
    for master in dcos_api_session.masters:
        units_response = check_json(dcos_api_session.health.get('/units', node=master))
        pulled_units = list(map(lambda unit: unit['id'], units_response['units']))
        for unit in pulled_units:
            unit_response = check_json(dcos_api_session.health.get('/units/{}'.format(unit), node=master))
            validate_units([unit_response])