|
@@ -23,16 +23,6 @@ ZONE_PRIORITY = {
|
|
|
'weight': 2
|
|
|
}
|
|
|
|
|
|
-CLOUD_PROVIDER_ZONE_PRIORITY = {
|
|
|
- 'name': 'Zone',
|
|
|
- 'argument': {
|
|
|
- 'serviceAntiAffinity': {
|
|
|
- 'label': 'failure-domain.beta.kubernetes.io/zone'
|
|
|
- }
|
|
|
- },
|
|
|
- 'weight': 2
|
|
|
-}
|
|
|
-
|
|
|
TEST_VARS = [
|
|
|
('3.6', DEFAULT_PRIORITIES_3_6),
|
|
|
('3.7', DEFAULT_PRIORITIES_3_7),
|
|
@@ -42,21 +32,17 @@ TEST_VARS = [
|
|
|
]
|
|
|
|
|
|
|
|
|
-def assert_ok(priorities_lookup, default_priorities, zones_enabled, cloudprovider_enabled, **kwargs):
|
|
|
- results = priorities_lookup.run(None, zones_enabled=zones_enabled,
|
|
|
- cloudprovider_enabled=cloudprovider_enabled, **kwargs)
|
|
|
- if zones_enabled and cloudprovider_enabled:
|
|
|
- assert results == default_priorities + [CLOUD_PROVIDER_ZONE_PRIORITY]
|
|
|
- elif zones_enabled and not cloudprovider_enabled:
|
|
|
+def assert_ok(priorities_lookup, default_priorities, zones_enabled, **kwargs):
|
|
|
+ results = priorities_lookup.run(None, zones_enabled=zones_enabled, **kwargs)
|
|
|
+ if zones_enabled:
|
|
|
assert results == default_priorities + [ZONE_PRIORITY]
|
|
|
else:
|
|
|
assert results == default_priorities
|
|
|
|
|
|
|
|
|
-def test_openshift_version(priorities_lookup, openshift_version_fixture, zones_enabled, cloudprovider_enabled):
|
|
|
+def test_openshift_version(priorities_lookup, openshift_version_fixture, zones_enabled):
|
|
|
facts, default_priorities = openshift_version_fixture
|
|
|
- assert_ok(priorities_lookup, default_priorities, variables=facts, zones_enabled=zones_enabled,
|
|
|
- cloudprovider_enabled=cloudprovider_enabled)
|
|
|
+ assert_ok(priorities_lookup, default_priorities, variables=facts, zones_enabled=zones_enabled)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|
|
@@ -67,10 +53,9 @@ def openshift_version_fixture(request, facts):
|
|
|
return facts, default_priorities
|
|
|
|
|
|
|
|
|
-def test_openshift_release(priorities_lookup, openshift_release_fixture, zones_enabled, cloudprovider_enabled):
|
|
|
+def test_openshift_release(priorities_lookup, openshift_release_fixture, zones_enabled):
|
|
|
facts, default_priorities = openshift_release_fixture
|
|
|
- assert_ok(priorities_lookup, default_priorities, variables=facts, zones_enabled=zones_enabled,
|
|
|
- cloudprovider_enabled=cloudprovider_enabled)
|
|
|
+ assert_ok(priorities_lookup, default_priorities, variables=facts, zones_enabled=zones_enabled)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|
|
@@ -80,12 +65,11 @@ def openshift_release_fixture(request, facts, release_mod):
|
|
|
return facts, default_priorities
|
|
|
|
|
|
|
|
|
-def test_short_version_kwarg(priorities_lookup, short_version_kwarg_fixture, zones_enabled, cloudprovider_enabled):
|
|
|
+def test_short_version_kwarg(priorities_lookup, short_version_kwarg_fixture, zones_enabled):
|
|
|
facts, short_version, default_priorities = short_version_kwarg_fixture
|
|
|
assert_ok(
|
|
|
priorities_lookup, default_priorities, variables=facts,
|
|
|
- zones_enabled=zones_enabled, short_version=short_version,
|
|
|
- cloudprovider_enabled=cloudprovider_enabled)
|
|
|
+ zones_enabled=zones_enabled, short_version=short_version)
|
|
|
|
|
|
|
|
|
@pytest.fixture(params=TEST_VARS)
|