summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/test/package_version_test.py
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-03-06 16:27:39 -0500
committerLuke Meyer <lmeyer@redhat.com>2017-04-08 17:59:17 -0400
commit96a6efb7e92afc0ad9f8899bbc2cefbc169c7ede (patch)
tree60a7ba8a9e1b2a13b131a8a83f37932f37bc8938 /roles/openshift_health_checker/test/package_version_test.py
parent94d3945e9734c9848d6c8bab907fa08c80aa917b (diff)
downloadopenshift-96a6efb7e92afc0ad9f8899bbc2cefbc169c7ede.tar.gz
openshift-96a6efb7e92afc0ad9f8899bbc2cefbc169c7ede.tar.bz2
openshift-96a6efb7e92afc0ad9f8899bbc2cefbc169c7ede.tar.xz
openshift-96a6efb7e92afc0ad9f8899bbc2cefbc169c7ede.zip
preflight checks: refactor and fix aos_version
Bring in openshift_repos to provide Origin repo before checks on Origin. For OCP we want the check to fail if both version 3.3 and version 3.4 are available - they shouldn't have both channels enabled. For Origin everything is in one repo so it's not surprising to find 1.4 and 1.5 versions available. Added unit tests as well.
Diffstat (limited to 'roles/openshift_health_checker/test/package_version_test.py')
-rw-r--r--roles/openshift_health_checker/test/package_version_test.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/roles/openshift_health_checker/test/package_version_test.py b/roles/openshift_health_checker/test/package_version_test.py
index cc1d263bc..c6889ee9b 100644
--- a/roles/openshift_health_checker/test/package_version_test.py
+++ b/roles/openshift_health_checker/test/package_version_test.py
@@ -4,16 +4,19 @@ from openshift_checks.package_version import PackageVersion
def test_package_version():
task_vars = dict(
openshift=dict(common=dict(service_type='origin')),
- openshift_release='v3.5',
+ openshift_release='3.5',
+ openshift_deployment_type='origin',
)
return_value = object()
def execute_module(module_name=None, module_args=None, tmp=None, task_vars=None):
assert module_name == 'aos_version'
- assert 'prefix' in module_args
- assert 'version' in module_args
- assert module_args['prefix'] == task_vars['openshift']['common']['service_type']
- assert module_args['version'] == task_vars['openshift_release']
+ assert 'requested_openshift_release' in module_args
+ assert 'openshift_deployment_type' in module_args
+ assert 'rpm_prefix' in module_args
+ assert module_args['requested_openshift_release'] == task_vars['openshift_release']
+ assert module_args['openshift_deployment_type'] == task_vars['openshift_deployment_type']
+ assert module_args['rpm_prefix'] == task_vars['openshift']['common']['service_type']
return return_value
check = PackageVersion(execute_module=execute_module)