Exemple #1
0
                'name': 'ct2',
                'resources': {'cpus': 0.1, 'mem': 32},
                'exec': {'command': {'shell': 'echo $PING > foo; while true; do sleep 1; done'}},
                'healthcheck': {'command': {'shell': 'test $PING = `cat foo`'}}
            }
        ],
        'networks': [{'mode': 'host'}]
    }

    with dcos_api_session.marathon.deploy_pod_and_cleanup(pod_definition):
        # Trivial app if it deploys, there is nothing else to check
        pass


@pytest.mark.skipif(
    expanded_config.get('security') == 'strict',
    reason='See: https://jira.mesosphere.com/browse/DCOS-14760')
def test_octarine(dcos_api_session, timeout=30):
    # This app binds to port 80. This is only required by the http (not srv)
    # transparent mode test. In transparent mode, we use ".mydcos.directory"
    # to go to localhost, the port attached there is only used to
    # determine which port to send traffic to on localhost. When it
    # reaches the proxy, the port is not used, and a request is made
    # to port 80.

    app, uuid = get_test_app(host_port=80)
    app['acceptedResourceRoles'] = ["slave_public"]
    app['requirePorts'] = True

    with dcos_api_session.marathon.deploy_and_cleanup(app) as service_points:
        port_number = service_points[0].port
Exemple #2
0
                'command': {
                    'shell': 'test $PING = `cat foo`'
                }
            }
        }],
        'networks': [{
            'mode': 'host'
        }]
    }

    with dcos_api_session.marathon.deploy_pod_and_cleanup(pod_definition):
        # Trivial app if it deploys, there is nothing else to check
        pass


@pytest.mark.skipif(expanded_config.get('security') == 'strict',
                    reason='See: https://jira.mesosphere.com/browse/DCOS-14760'
                    )
def test_octarine(dcos_api_session, timeout=30):
    # This app binds to port 80. This is only required by the http (not srv)
    # transparent mode test. In transparent mode, we use ".mydcos.directory"
    # to go to localhost, the port attached there is only used to
    # determine which port to send traffic to on localhost. When it
    # reaches the proxy, the port is not used, and a request is made
    # to port 80.

    app, uuid = get_test_app(host_port=80)
    app['acceptedResourceRoles'] = ["slave_public"]
    app['requirePorts'] = True

    with dcos_api_session.marathon.deploy_and_cleanup(app) as service_points:
Exemple #3
0
    data = install_response.json()

    dcos_api_session.marathon.wait_for_deployments_complete()

    list_response = dcos_api_session.cosmos.list_packages()
    packages = list_response.json()['packages']
    assert len(packages) == 1 and packages[0]['appId'] == data['appId']

    dcos_api_session.cosmos.uninstall_package('nginx', app_id=data['appId'])

    list_response = dcos_api_session.cosmos.list_packages()
    packages = list_response.json()['packages']
    assert len(packages) == 0


@pytest.mark.skipif(expanded_config.get('security') == 'strict',
                    reason="MoM disabled for strict mode")
def test_mom_installation(dcos_api_session):
    """Test the Cosmos installation of marathon on marathon (MoM)
    """

    install_response = dcos_api_session.cosmos.install_package('marathon')
    data = install_response.json()

    dcos_api_session.marathon.wait_for_deployments_complete()

    list_response = dcos_api_session.cosmos.list_packages()
    packages = list_response.json()['packages']
    assert len(packages) == 1 and packages[0]['appId'] == data['appId']

    dcos_api_session.cosmos.uninstall_package('marathon', app_id=data['appId'])