Bläddra i källkod

preflight int tests: fix for openshift_version dep

Luke Meyer 7 år sedan
förälder
incheckning
8fc3eecb2a

+ 13 - 1
test/integration/openshift_health_checker/preflight/playbooks/package_availability_missing_required.yml

@@ -1,4 +1,5 @@
 ---
+# NOTE: this test is probably superfluous since openshift_version already does it
 - include: ../../setup_container.yml
   vars:
     image: preflight-aos-package-checks
@@ -7,11 +8,22 @@
 
 - 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
-  tasks:
+
+  post_tasks:
     - block:
 
+        # put the repo back to disabled
+        - include: tasks/enable_repo.yml
+          vars: { repo_name: "ose-3.2", repo_enabled: 0 }
+
         - action: openshift_health_check
           args:
             checks: [ 'package_availability' ]

+ 8 - 1
test/integration/openshift_health_checker/preflight/playbooks/package_update_dep_missing.yml

@@ -8,9 +8,16 @@
 
 - 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
-  tasks:
+
+  post_tasks:
     - block:
 
         - include: tasks/enable_repo.yml

+ 8 - 1
test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_broken.yml

@@ -8,9 +8,16 @@
 
 - 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
-  tasks:
+
+  post_tasks:
     - block:
 
         - include: tasks/enable_repo.yml

+ 8 - 1
test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_disabled.yml

@@ -8,9 +8,16 @@
 
 - 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
-  tasks:
+
+  post_tasks:
     - block:
 
         - action: openshift_health_check

+ 8 - 1
test/integration/openshift_health_checker/preflight/playbooks/package_update_repo_unreachable.yml

@@ -8,9 +8,16 @@
 
 - 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
-  tasks:
+
+  post_tasks:
     - block:
 
         - include: tasks/enable_repo.yml

+ 8 - 4
test/integration/openshift_health_checker/preflight/playbooks/package_version_matches.yml

@@ -8,13 +8,17 @@
 
 - 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
-  tasks:
-    - block:
 
-        - include: tasks/enable_repo.yml
-          vars: { repo_name: "ose-3.2" }
+  post_tasks:
+    - block:
 
         - action: openshift_health_check
           args:

+ 13 - 2
test/integration/openshift_health_checker/preflight/playbooks/package_version_mismatches.yml

@@ -1,4 +1,5 @@
 ---
+# NOTE: this test is probably superfluous since openshift_version already does it
 - include: ../../setup_container.yml
   vars:
     image: preflight-aos-package-checks
@@ -8,14 +9,24 @@
 
 - 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
-  tasks:
+
+  post_tasks:
     - block:
 
+        # put the repo back to disabled
+        - include: tasks/enable_repo.yml
+          vars: { repo_name: "ose-3.3", repo_enabled: 0 }
+        # test with wrong repo enabled
         - include: tasks/enable_repo.yml
           vars: { repo_name: "ose-3.2" }
-
         - action: openshift_health_check
           args:
             checks: [ 'package_version' ]

+ 9 - 4
test/integration/openshift_health_checker/preflight/playbooks/package_version_multiple.yml

@@ -7,14 +7,19 @@
 
 - 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
-  tasks:
-    - block:
 
-        - include: tasks/enable_repo.yml
-          vars: { repo_name: "ose-3.2" }
+  post_tasks:
+    - block:
 
+        # enable repo with extra minor version available
         - include: tasks/enable_repo.yml
           vars: { repo_name: "ose-3.3" }
 

+ 1 - 1
test/integration/openshift_health_checker/preflight/playbooks/tasks/enable_repo.yml

@@ -6,4 +6,4 @@
     dest: /etc/yum.repos.d/{{ repo_name }}.repo
     section: "{{ repo_name }}"
     option: enabled
-    value: 1
+    value: "{{ repo_enabled | default(1) }}"