def test_succeeds_with_recommended_memory(group_names, configured_min, ansible_memtotal_mb):
    task_vars = dict(
        group_names=group_names,
        openshift_check_min_host_memory_gb=configured_min,
        ansible_memtotal_mb=ansible_memtotal_mb,
    )

    result = MemoryAvailability(fake_execute_module, task_vars).run()

    assert not result.get('failed', False)
Пример #2
0
def test_succeeds_with_recommended_memory(group_names, ansible_memtotal_mb):
    task_vars = dict(
        group_names=group_names,
        ansible_memtotal_mb=ansible_memtotal_mb,
    )

    check = MemoryAvailability(execute_module=fake_execute_module)
    result = check.run(tmp=None, task_vars=task_vars)

    assert not result.get('failed', False)
Пример #3
0
def test_succeeds_with_recommended_memory(group_names, configured_min,
                                          ansible_memtotal_mb):
    task_vars = dict(
        group_names=group_names,
        openshift_check_min_host_memory_gb=configured_min,
        ansible_memtotal_mb=ansible_memtotal_mb,
    )

    result = MemoryAvailability(fake_execute_module, task_vars).run()

    assert not result.get('failed', False)
def test_fails_with_insufficient_memory(group_names, configured_min, ansible_memtotal_mb, extra_words):
    task_vars = dict(
        group_names=group_names,
        openshift_check_min_host_memory_gb=configured_min,
        ansible_memtotal_mb=ansible_memtotal_mb,
    )

    result = MemoryAvailability(fake_execute_module, task_vars).run()

    assert result.get('failed', False)
    for word in 'below recommended'.split() + extra_words:
        assert word in result['msg']
Пример #5
0
def test_fails_with_insufficient_memory(group_names, ansible_memtotal_mb,
                                        extra_words):
    task_vars = dict(
        group_names=group_names,
        ansible_memtotal_mb=ansible_memtotal_mb,
    )

    check = MemoryAvailability(execute_module=fake_execute_module)
    result = check.run(tmp=None, task_vars=task_vars)

    assert result['failed']
    for word in 'below recommended'.split() + extra_words:
        assert word in result['msg']
Пример #6
0
def test_fails_with_insufficient_memory(group_names, configured_min,
                                        ansible_memtotal_mb, extra_words):
    task_vars = dict(
        group_names=group_names,
        openshift_check_min_host_memory_gb=configured_min,
        ansible_memtotal_mb=ansible_memtotal_mb,
    )

    result = MemoryAvailability(fake_execute_module, task_vars).run()

    assert result.get('failed', False)
    for word in 'below recommended'.split() + extra_words:
        assert word in result['msg']
Пример #7
0
def test_is_active(group_names, is_active):
    task_vars = dict(group_names=group_names, )
    assert MemoryAvailability.is_active(task_vars=task_vars) == is_active
def test_is_active(group_names, is_active):
    task_vars = dict(
        group_names=group_names,
    )
    assert MemoryAvailability.is_active(task_vars=task_vars) == is_active