summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/test/docker_image_availability_test.py
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-06-01 19:24:31 -0400
committerLuke Meyer <lmeyer@redhat.com>2017-06-07 19:27:31 -0400
commita092dff53070c4eaa942dae36fc8742a7d53959d (patch)
tree332bd39ce6938982317c7054c48e239e242f71e5 /roles/openshift_health_checker/test/docker_image_availability_test.py
parent055082c1679cb253758bc16e0a6ca37f70d0bc65 (diff)
downloadopenshift-a092dff53070c4eaa942dae36fc8742a7d53959d.tar.gz
openshift-a092dff53070c4eaa942dae36fc8742a7d53959d.tar.bz2
openshift-a092dff53070c4eaa942dae36fc8742a7d53959d.tar.xz
openshift-a092dff53070c4eaa942dae36fc8742a7d53959d.zip
docker checks: finish and refactor
Incorporated docker_storage_driver into docker_storage as both need driver info. Corrected storage calculation to include VG free space, not just the current amount in the LV pool. Now makes no assumptions about pool name. Improved user messaging. Factored out some methods that can be shared with docker_image_availability.
Diffstat (limited to 'roles/openshift_health_checker/test/docker_image_availability_test.py')
-rw-r--r--roles/openshift_health_checker/test/docker_image_availability_test.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/roles/openshift_health_checker/test/docker_image_availability_test.py b/roles/openshift_health_checker/test/docker_image_availability_test.py
index 0379cafb5..197c65f51 100644
--- a/roles/openshift_health_checker/test/docker_image_availability_test.py
+++ b/roles/openshift_health_checker/test/docker_image_availability_test.py
@@ -3,19 +3,25 @@ import pytest
from openshift_checks.docker_image_availability import DockerImageAvailability
-@pytest.mark.parametrize('deployment_type,is_active', [
- ("origin", True),
- ("openshift-enterprise", True),
- ("enterprise", False),
- ("online", False),
- ("invalid", False),
- ("", False),
+@pytest.mark.parametrize('deployment_type, is_containerized, group_names, expect_active', [
+ ("origin", True, [], True),
+ ("openshift-enterprise", True, [], True),
+ ("enterprise", True, [], False),
+ ("online", True, [], False),
+ ("invalid", True, [], False),
+ ("", True, [], False),
+ ("origin", False, [], False),
+ ("openshift-enterprise", False, [], False),
+ ("origin", False, ["nodes", "masters"], True),
+ ("openshift-enterprise", False, ["etcd"], False),
])
-def test_is_active(deployment_type, is_active):
+def test_is_active(deployment_type, is_containerized, group_names, expect_active):
task_vars = dict(
+ openshift=dict(common=dict(is_containerized=is_containerized)),
openshift_deployment_type=deployment_type,
+ group_names=group_names,
)
- assert DockerImageAvailability.is_active(task_vars=task_vars) == is_active
+ assert DockerImageAvailability.is_active(task_vars=task_vars) == expect_active
@pytest.mark.parametrize("is_containerized,is_atomic", [