summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/test/package_availability_test.py
diff options
context:
space:
mode:
authorjuanvallejo <jvallejo@redhat.com>2017-03-23 16:12:53 -0400
committerjuanvallejo <jvallejo@redhat.com>2017-04-11 10:33:46 -0400
commitdaebc9f0848ffd875ccfe9e2f0e6e919a4f83516 (patch)
tree27c9da356a9144bdcc4e62cbf64605e2d91020f5 /roles/openshift_health_checker/test/package_availability_test.py
parent4ebf81f1d1b3a1277c1f3cae784882edbe183fe5 (diff)
downloadopenshift-daebc9f0848ffd875ccfe9e2f0e6e919a4f83516.tar.gz
openshift-daebc9f0848ffd875ccfe9e2f0e6e919a4f83516.tar.bz2
openshift-daebc9f0848ffd875ccfe9e2f0e6e919a4f83516.tar.xz
openshift-daebc9f0848ffd875ccfe9e2f0e6e919a4f83516.zip
skip PackageAvailability check if not yum
Diffstat (limited to 'roles/openshift_health_checker/test/package_availability_test.py')
-rw-r--r--roles/openshift_health_checker/test/package_availability_test.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/test/package_availability_test.py b/roles/openshift_health_checker/test/package_availability_test.py
index 25385339a..f7e916a46 100644
--- a/roles/openshift_health_checker/test/package_availability_test.py
+++ b/roles/openshift_health_checker/test/package_availability_test.py
@@ -3,6 +3,20 @@ import pytest
from openshift_checks.package_availability import PackageAvailability
+@pytest.mark.parametrize('pkg_mgr,is_containerized,is_active', [
+ ('yum', False, True),
+ ('yum', True, False),
+ ('dnf', True, False),
+ ('dnf', False, False),
+])
+def test_is_active(pkg_mgr, is_containerized, is_active):
+ task_vars = dict(
+ ansible_pkg_mgr=pkg_mgr,
+ openshift=dict(common=dict(is_containerized=is_containerized)),
+ )
+ assert PackageAvailability.is_active(task_vars=task_vars) == is_active
+
+
@pytest.mark.parametrize('task_vars,must_have_packages,must_not_have_packages', [
(
dict(openshift=dict(common=dict(service_type='openshift'))),