コード例 #1
0
def test_bump_hello_cpus():
    hello_ids = sdk_tasks.get_task_ids(foldered_name, "hello")
    log.info("hello ids: " + str(hello_ids))

    updated_cpus = config.bump_hello_cpus(foldered_name)

    sdk_tasks.check_tasks_updated(foldered_name, "hello", hello_ids)
    sdk_plan.wait_for_completed_deployment(foldered_name)

    all_tasks = sdk_tasks.get_service_tasks(foldered_name, task_prefix="hello")
    running_tasks = [t for t in all_tasks if t.state == "TASK_RUNNING"]
    assert len(running_tasks) == config.hello_task_count(foldered_name)
    for t in running_tasks:
        assert config.close_enough(t.resources["cpus"], updated_cpus)
コード例 #2
0
ファイル: test_sanity.py プロジェクト: smush618/dcos-commons
def test_bump_hello_cpus():
    hello_ids = sdk_tasks.get_task_ids(foldered_name, "hello")
    log.info("hello ids: " + str(hello_ids))

    updated_cpus = config.bump_hello_cpus(foldered_name)

    sdk_tasks.check_tasks_updated(foldered_name, "hello", hello_ids)
    sdk_plan.wait_for_completed_deployment(foldered_name)

    all_tasks = sdk_tasks.get_service_tasks(foldered_name, task_prefix="hello")
    running_tasks = [t for t in all_tasks if t.state == "TASK_RUNNING"]
    assert len(running_tasks) == config.hello_task_count(foldered_name)
    for t in running_tasks:
        assert config.close_enough(t.resources["cpus"], updated_cpus)
コード例 #3
0
ファイル: test_sanity.py プロジェクト: joerg84/dcos-commons
def test_bump_hello_cpus():
    config.check_running(FOLDERED_SERVICE_NAME)
    hello_ids = sdk_tasks.get_task_ids(FOLDERED_SERVICE_NAME, 'hello')
    log.info('hello ids: ' + str(hello_ids))

    updated_cpus = config.bump_hello_cpus(FOLDERED_SERVICE_NAME)

    sdk_tasks.check_tasks_updated(FOLDERED_SERVICE_NAME, 'hello', hello_ids)
    config.check_running(FOLDERED_SERVICE_NAME)

    all_tasks = shakedown.get_service_tasks(FOLDERED_SERVICE_NAME)
    running_tasks = [t for t in all_tasks if t['name'].startswith('hello') and t['state'] == "TASK_RUNNING"]
    assert len(running_tasks) == config.hello_task_count(FOLDERED_SERVICE_NAME)
    for t in running_tasks:
        assert close_enough(t['resources']['cpus'], updated_cpus)
コード例 #4
0
ファイル: test_sanity.py プロジェクト: springle/dcos-commons
def test_bump_hello_cpus():
    check_running()
    hello_ids = tasks.get_task_ids(PACKAGE_NAME, 'hello')
    sdk_utils.out('hello ids: ' + str(hello_ids))

    updated_cpus = bump_hello_cpus()

    tasks.check_tasks_updated(PACKAGE_NAME, 'hello', hello_ids)
    check_running()

    all_tasks = shakedown.get_service_tasks(PACKAGE_NAME)
    running_tasks = [t for t in all_tasks if t['name'].startswith('hello') and t['state'] == "TASK_RUNNING"]
    assert len(running_tasks) == hello_task_count()
    for t in running_tasks:
        assert close_enough(t['resources']['cpus'], updated_cpus)
コード例 #5
0
def test_bump_hello_cpus():
    config.check_running(FOLDERED_SERVICE_NAME)
    hello_ids = sdk_tasks.get_task_ids(FOLDERED_SERVICE_NAME, 'hello')
    log.info('hello ids: ' + str(hello_ids))

    updated_cpus = config.bump_hello_cpus(FOLDERED_SERVICE_NAME)

    sdk_tasks.check_tasks_updated(FOLDERED_SERVICE_NAME, 'hello', hello_ids)
    config.check_running(FOLDERED_SERVICE_NAME)

    all_tasks = shakedown.get_service_tasks(FOLDERED_SERVICE_NAME)
    running_tasks = [t for t in all_tasks if t['name'].startswith('hello') and t['state'] == "TASK_RUNNING"]
    assert len(running_tasks) == config.hello_task_count(FOLDERED_SERVICE_NAME)
    for t in running_tasks:
        assert close_enough(t['resources']['cpus'], updated_cpus)
コード例 #6
0
def test_bump_hello_cpus():
    check_running()
    hello_ids = tasks.get_task_ids(PACKAGE_NAME, 'hello')
    print('hello ids: ' + str(hello_ids))

    config = marathon.get_config(PACKAGE_NAME)
    cpus = float(config['env']['HELLO_CPUS'])
    updated_cpus = cpus + 0.1
    config['env']['HELLO_CPUS'] = str(updated_cpus)
    marathon.update_app(PACKAGE_NAME, config)

    tasks.check_tasks_updated(PACKAGE_NAME, 'hello', hello_ids)
    check_running()

    all_tasks = shakedown.get_service_tasks(PACKAGE_NAME)
    running_tasks = [t for t in all_tasks if t['name'].startswith('hello') and t['state'] == "TASK_RUNNING"]
    assert len(running_tasks) == hello_task_count()
    for t in running_tasks:
        assert close_enough(t['resources']['cpus'], updated_cpus)
コード例 #7
0
def test_bump_hello_cpus():
    check_running()
    hello_ids = tasks.get_task_ids(PACKAGE_NAME, 'hello')
    print('hello ids: ' + str(hello_ids))

    config = marathon.get_config(PACKAGE_NAME)
    cpus = float(config['env']['HELLO_CPUS'])
    updated_cpus = cpus + 0.1
    config['env']['HELLO_CPUS'] = str(updated_cpus)
    marathon.update_app(PACKAGE_NAME, config)

    tasks.check_tasks_updated(PACKAGE_NAME, 'hello', hello_ids)
    check_running()

    all_tasks = shakedown.get_service_tasks(PACKAGE_NAME)
    running_tasks = [
        t for t in all_tasks
        if t['name'].startswith('hello') and t['state'] == "TASK_RUNNING"
    ]
    assert len(running_tasks) == hello_task_count()
    for t in running_tasks:
        assert close_enough(t['resources']['cpus'], updated_cpus)