diff options
Diffstat (limited to 'test')
11 files changed, 36 insertions, 66 deletions
diff --git a/test/integration/openshift_health_checker/common.go b/test/integration/openshift_health_checker/common.go index a92d6861d..8b79c48cb 100644 --- a/test/integration/openshift_health_checker/common.go +++ b/test/integration/openshift_health_checker/common.go @@ -25,7 +25,7 @@ func (p PlaybookTest) Run(t *testing.T) { // A PlaybookTest is intended to be run in parallel with other tests. t.Parallel() - cmd := exec.Command("ansible-playbook", "-i", "/dev/null", p.Path) + cmd := exec.Command("ansible-playbook", "-e", "testing_skip_some_requirements=1", "-i", "/dev/null", p.Path) cmd.Env = append(os.Environ(), "ANSIBLE_FORCE_COLOR=1") b, err := cmd.CombinedOutput() diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_availability_missing_required.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_availability_missing_required.yml index a557282b4..9875de9aa 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_availability_missing_required.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_availability_missing_required.yml @@ -8,12 +8,6 @@ - name: Fail as required packages cannot be installed hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } - roles: - openshift_health_checker diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_update_dep_missing.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_update_dep_missing.yml index 0929b73ce..9f3aad7bd 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_update_dep_missing.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_update_dep_missing.yml @@ -8,12 +8,6 @@ - name: Fails when a dependency required for update is missing hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } - roles: - openshift_health_checker diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_broken.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_broken.yml index f8790358a..84e9360f5 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_broken.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_broken.yml @@ -8,12 +8,6 @@ - name: Fails when a repo definition is completely broken hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } - roles: - openshift_health_checker diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_disabled.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_disabled.yml index e2bb84715..f4c1bedfa 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_disabled.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_disabled.yml @@ -8,12 +8,6 @@ - name: Succeeds when nothing blocks a yum update hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } - roles: - openshift_health_checker diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_unreachable.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_unreachable.yml index 28efdd81d..409057792 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_unreachable.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_unreachable.yml @@ -8,12 +8,6 @@ - name: Fails when repo content is not available hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } - roles: - openshift_health_checker diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_version_matches.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_version_matches.yml index 58bed0fc0..d88f82a4a 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_version_matches.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_version_matches.yml @@ -8,12 +8,6 @@ - name: Success when AOS version matches openshift_release hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } - roles: - openshift_health_checker diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_version_mismatches.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_version_mismatches.yml index c26413009..401ad1e21 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_version_mismatches.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_version_mismatches.yml @@ -5,16 +5,10 @@ image: preflight-aos-package-checks l_host_vars: deployment_type: openshift-enterprise - openshift_release: 3.3 + openshift_release: 3.2 - name: Failure when AOS version doesn't match openshift_release hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.3" } - roles: - openshift_health_checker @@ -23,10 +17,10 @@ # put the repo back to disabled - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.3", repo_enabled: 0 } + vars: { repo_name: "ose-3.2", repo_enabled: 0 } # test with wrong repo enabled - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } + vars: { repo_name: "ose-3.3" } - action: openshift_health_check args: checks: [ 'package_version' ] diff --git a/test/integration/openshift_health_checker/preflight/playbooks/package_version_multiple.yml b/test/integration/openshift_health_checker/preflight/playbooks/package_version_multiple.yml index 850a55a72..88613802b 100644 --- a/test/integration/openshift_health_checker/preflight/playbooks/package_version_multiple.yml +++ b/test/integration/openshift_health_checker/preflight/playbooks/package_version_multiple.yml @@ -7,12 +7,6 @@ - name: Fails when multiple AOS versions are available hosts: all - pre_tasks: - - # run before roles to prevent openshift_version breaking - - include: tasks/enable_repo.yml - vars: { repo_name: "ose-3.2" } - roles: - openshift_health_checker diff --git a/test/integration/openshift_health_checker/setup_container.yml b/test/integration/openshift_health_checker/setup_container.yml index 33e94cf1f..413754fcd 100644 --- a/test/integration/openshift_health_checker/setup_container.yml +++ b/test/integration/openshift_health_checker/setup_container.yml @@ -44,5 +44,19 @@ delegate_to: "{{ container_name }}" with_dict: "{{ l_host_vars | default({}) }}" +- hosts: all + tasks: + + # run before openshift_version to prevent it breaking + - include: preflight/playbooks/tasks/enable_repo.yml + vars: { repo_name: "ose-3.2" } + - include: ../../../playbooks/byo/openshift-cluster/initialize_groups.yml -- include: ../../../playbooks/common/openshift-cluster/evaluate_groups.yml +- include: ../../../playbooks/common/openshift-cluster/std_include.yml + +- hosts: all + tasks: + + # put it back like it was for the tests + - include: preflight/playbooks/tasks/enable_repo.yml + vars: { repo_name: "ose-3.2", enabled: False } diff --git a/test/openshift_version_tests.py b/test/openshift_version_tests.py index 393a4d6ba..6095beb95 100644 --- a/test/openshift_version_tests.py +++ b/test/openshift_version_tests.py @@ -17,39 +17,39 @@ class OpenShiftVersionTests(unittest.TestCase): # Static tests for legacy filters. legacy_gte_tests = [{'name': 'oo_version_gte_3_1_or_1_1', - 'positive_enterprise_version': '3.2.0', - 'negative_enterprise_version': '3.0.0', + 'positive_openshift-enterprise_version': '3.2.0', + 'negative_openshift-enterprise_version': '3.0.0', 'positive_origin_version': '1.2.0', 'negative_origin_version': '1.0.0'}, {'name': 'oo_version_gte_3_1_1_or_1_1_1', - 'positive_enterprise_version': '3.2.0', - 'negative_enterprise_version': '3.1.0', + 'positive_openshift-enterprise_version': '3.2.0', + 'negative_openshift-enterprise_version': '3.1.0', 'positive_origin_version': '1.2.0', 'negative_origin_version': '1.1.0'}, {'name': 'oo_version_gte_3_2_or_1_2', - 'positive_enterprise_version': '3.3.0', - 'negative_enterprise_version': '3.1.0', + 'positive_openshift-enterprise_version': '3.3.0', + 'negative_openshift-enterprise_version': '3.1.0', 'positive_origin_version': '1.3.0', 'negative_origin_version': '1.1.0'}, {'name': 'oo_version_gte_3_3_or_1_3', - 'positive_enterprise_version': '3.4.0', - 'negative_enterprise_version': '3.2.0', + 'positive_openshift-enterprise_version': '3.4.0', + 'negative_openshift-enterprise_version': '3.2.0', 'positive_origin_version': '1.4.0', 'negative_origin_version': '1.2.0'}, {'name': 'oo_version_gte_3_4_or_1_4', - 'positive_enterprise_version': '3.5.0', - 'negative_enterprise_version': '3.3.0', + 'positive_openshift-enterprise_version': '3.5.0', + 'negative_openshift-enterprise_version': '3.3.0', 'positive_origin_version': '1.5.0', 'negative_origin_version': '1.3.0'}, {'name': 'oo_version_gte_3_5_or_1_5', - 'positive_enterprise_version': '3.6.0', - 'negative_enterprise_version': '3.4.0', + 'positive_openshift-enterprise_version': '3.6.0', + 'negative_openshift-enterprise_version': '3.4.0', 'positive_origin_version': '3.6.0', 'negative_origin_version': '1.4.0'}] def test_legacy_gte_filters(self): for test in self.legacy_gte_tests: - for deployment_type in ['enterprise', 'origin']: + for deployment_type in ['openshift-enterprise', 'origin']: # Test negative case per deployment_type self.assertFalse( self.openshift_version_filters._filters[test['name']]( @@ -70,3 +70,7 @@ class OpenShiftVersionTests(unittest.TestCase): self.assertFalse( self.openshift_version_filters._filters["oo_version_gte_{}_{}".format(major, minor)]( "{}.{}".format(major, minor))) + + def test_get_filters(self): + self.assertTrue( + self.openshift_version_filters.filters() == self.openshift_version_filters._filters) |