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, 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']
Пример #4
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']