示例#1
0
def test_install():
    with package('chronos', deploy=True, args=[]):
        watch_all_deployments()
        wait_for_service('chronos')

    services = get_services(args=['--inactive'])
    assert len(
        [service for service in services if service['name'] == 'chronos']) == 0
示例#2
0
def test_log():
    package_name = 'hello-world'

    with package(package_name, deploy=True):
        returncode, stdout, stderr = exec_command(
            ['dcos', 'service', 'log', package_name])

        assert stderr == b''
        assert returncode == 0
        assert len(stdout.decode('utf-8').split('\n')) > 1

        returncode, stdout, stderr = exec_command(
            ['dcos', 'service', 'log', package_name, 'stderr'])

        assert stderr == b''
        assert returncode == 0
        assert len(stdout.decode('utf-8').split('\n')) > 1
示例#3
0
def test_log():
    with package('cassandra',
                 deploy=True,
                 args=['--package-version=1.0.25-3.0.10']):
        returncode, stdout, stderr = exec_command(
            ['dcos', 'service', 'log', 'cassandra'])

        assert returncode == 0
        assert len(stdout.decode('utf-8').split('\n')) > 1
        assert stderr == b''

        returncode, stdout, stderr = exec_command(
            ['dcos', 'service', 'log', 'cassandra', 'stderr'])

        assert returncode == 0
        assert len(stdout.decode('utf-8').split('\n')) > 1
        assert stderr == b''

    # Package was uninstalled but its group needs to be removed separately
    exec_command(['dcos', 'marathon', 'group', 'remove', 'cassandra'])