Skip to content

Commit

Permalink
Try to fix discovery tests conditionals.
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-checkmk committed Dec 3, 2024
1 parent 234d782 commit fca72d3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/integration/targets/discovery/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
loop: "{{ checkmk_var_hosts }}"
register: __checkmk_var_result_labels
failed_when: "'State is not supported before 2.3.0' not in __checkmk_var_result_labels.msg"
when: "not '2.3.0' in outer_item.version"
when: "not '2.3.0' in outer_item.version and not '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Monitor undecided services. (Should fail < 2.3.0)"
discovery:
Expand All @@ -103,7 +103,7 @@
loop: "{{ checkmk_var_hosts }}"
register: __checkmk_var_result_undecided_pre_23
failed_when: "'State is not supported before 2.3.0' not in __checkmk_var_result_undecided_pre_23.msg"
when: "not '2.3.0' in outer_item.version"
when: "not '2.3.0' in outer_item.version and not '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Update service labels."
discovery:
Expand All @@ -116,7 +116,7 @@
delegate_to: localhost
run_once: true # noqa run-once[task]
loop: "{{ checkmk_var_hosts }}"
when: "'2.3.0' in outer_item.version"
when: "'2.3.0' in outer_item.version or '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Monitor undecided services. (Should fail in 2.3.0)"
discovery:
Expand All @@ -131,7 +131,7 @@
loop: "{{ checkmk_var_hosts }}"
register: __checkmk_var_result_undecided_post_23
failed_when: "'State can only be used in bulk mode' not in __checkmk_var_result_undecided_post_23.msg"
when: "'2.3.0' in outer_item.version"
when: "'2.3.0' in outer_item.version or '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Tabula Rasa. (New since 2.2)"
discovery:
Expand Down Expand Up @@ -258,7 +258,7 @@
delegate_to: localhost
register: __checkmk_var_result_labels_pre_23
failed_when: "'State is not supported before 2.3.0' not in __checkmk_var_result_labels_pre_23.msg"
when: "not '2.3.0' in outer_item.version"
when: "not '2.3.0' in outer_item.version and not '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Monitor undecided services. (Should fail < 2.3.0)"
discovery:
Expand All @@ -272,7 +272,7 @@
delegate_to: localhost
register: __checkmk_var_result_labels_post_23
failed_when: "'State is not supported before 2.3.0' not in __checkmk_var_result_labels_post_23.msg"
when: "not '2.3.0' in outer_item.version"
when: "not '2.3.0' in outer_item.version and not '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Update service labels. (only 2.3)"
discovery:
Expand All @@ -284,7 +284,7 @@
state: "only_service_labels"
bulk_size: 5
delegate_to: localhost
when: "'2.3.0' in outer_item.version"
when: "'2.3.0' in outer_item.version or '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Monitor undecided services. (only 2.3)"
discovery:
Expand All @@ -296,7 +296,7 @@
state: "monitor_undecided_services"
bulk_size: 5
delegate_to: localhost
when: "'2.3.0' in outer_item.version"
when: "'2.3.0' in outer_item.version or '2.4.0' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Add undecided services to monitoring."
discovery:
Expand Down

0 comments on commit fca72d3

Please sign in to comment.