Skip to content

Commit

Permalink
test: fix tests for pacemaker 3
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjelinek committed Nov 1, 2024
1 parent fa7f34b commit 01b059e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
16 changes: 12 additions & 4 deletions tests/tests_cib_constraints_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,9 @@
"in_effect": "UNKNOWN",
"options": {
"boolean-op": "or",
"score": "0"
{% if __test_pacemaker_version is version("3.0", "<") %}
"score": "0"
{% endif %}
},
"type": "RULE"
}
Expand Down Expand Up @@ -938,7 +940,9 @@
"in_effect": "UNKNOWN",
"options": {
"boolean-op": "or",
"score": "0"
{% if __test_pacemaker_version is version("3.0", "<") %}
"score": "0"
{% endif %}
},
"type": "RULE"
}
Expand Down Expand Up @@ -1235,7 +1239,9 @@
"in_effect": "UNKNOWN",
"options": {
"boolean-op": "or",
"score": "0"
{% if __test_pacemaker_version is version("3.0", "<") %}
"score": "0"
{% endif %}
},
"type": "RULE"
},
Expand Down Expand Up @@ -1320,7 +1326,9 @@
"in_effect": "UNKNOWN",
"options": {
"boolean-op": "or",
"score": "0"
{% if __test_pacemaker_version is version("3.0", "<") %}
"score": "0"
{% endif %}
},
"type": "RULE"
},
Expand Down
21 changes: 15 additions & 6 deletions tests/tests_cib_rsc_op_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@
name: linux-system-roles.ha_cluster
public: true

- name: Fetch versions of cluster components
include_tasks: tasks/fetch_versions.yml

- name: Verify resource defaults
vars:
__test_rule_score: "{{
__test_pacemaker_version is version('3.0.0', '<')
| ternary(' score=INFINITY', '') }}"
__test_expected_lines:
- "Meta Attrs: rsc_defaults-meta_attributes"
- " rsc-key-1=rsc-val-1"
Expand All @@ -88,16 +94,16 @@
- " rsc-key-3=rsc-val-3"
- "Meta Attrs: rsc_defaults-meta_attributes-2"
- " rsc-key-4=rsc-val-4"
- " Rule: boolean-op=and score=INFINITY"
- " Rule: boolean-op=and{{ __test_rule_score }}"
- " Expression: resource ocf:pacemaker:"
- "Meta Attrs: without_attrs_rsc score=20"
- " Rule: boolean-op=or score=INFINITY"
- " Rule: boolean-op=or{{ __test_rule_score }}"
- " Expression: resource :pacemaker:"
- " Expression: resource :heartbeat:"
- "Meta Attrs: all_options_rsc score=INFINITY"
- " rsc-key-5=rsc-val-5"
- " rsc-key-6=rsc-val-6"
- " Rule: boolean-op=and score=INFINITY"
- " Rule: boolean-op=and{{ __test_rule_score }}"
- " Expression: resource ocf:pacemaker:test"
block:
- name: Fetch resource defaults configuration from the cluster
Expand All @@ -122,6 +128,9 @@

- name: Verify operation defaults
vars:
__test_rule_score: "{{
__test_pacemaker_version is version('3.0.0', '<')
| ternary(' score=INFINITY', '') }}"
__test_expected_lines:
- "Meta Attrs: op_defaults-meta_attributes"
- " op-key-1=op-val-1"
Expand All @@ -131,16 +140,16 @@
- " op-key-3=op-val-3"
- "Meta Attrs: op_defaults-meta_attributes-2"
- " op-key-4=op-val-4"
- " Rule: boolean-op=and score=INFINITY"
- " Rule: boolean-op=and{{ __test_rule_score }}"
- " Expression: resource ocf:pacemaker:"
- "Meta Attrs: without_attrs_op score=20"
- " Rule: boolean-op=or score=INFINITY"
- " Rule: boolean-op=or{{ __test_rule_score }}"
- " Expression: resource :pacemaker:"
- " Expression: op monitor"
- "Meta Attrs: all_options_op score=INFINITY"
- " op-key-5=op-val-5"
- " op-key-6=op-val-6"
- " Rule: boolean-op=and score=INFINITY"
- " Rule: boolean-op=and{{ __test_rule_score }}"
- " Expression: resource ocf:pacemaker:test"
block:
- name: Fetch operation defaults configuration from the cluster
Expand Down

0 comments on commit 01b059e

Please sign in to comment.