def test_succeeds_with_recommended_disk_space(group_names, configured_min, ansible_mounts):
    task_vars = dict(
        group_names=group_names,
        openshift_check_min_host_disk_gb=configured_min,
        ansible_mounts=ansible_mounts,
    )

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

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

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

    assert not result.get('failed', False)
def test_fails_with_insufficient_disk_space(name, group_names, configured_min, ansible_mounts, expect_chunks):
    task_vars = dict(
        group_names=group_names,
        openshift_check_min_host_disk_gb=configured_min,
        ansible_mounts=ansible_mounts,
    )

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

    assert result['failed']
    for chunk in 'below recommended'.split() + expect_chunks:
        assert chunk in result.get('msg', '')
def test_fails_with_insufficient_disk_space(name, group_names, configured_min,
                                            ansible_mounts, expect_chunks):
    task_vars = dict(
        group_names=group_names,
        openshift_check_min_host_disk_gb=configured_min,
        ansible_mounts=ansible_mounts,
    )

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

    assert result['failed']
    for chunk in 'below recommended'.split() + expect_chunks:
        assert chunk in result.get('msg', '')