forked from linux-system-roles/ha_cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests_cib_stonith_levels_validation.yml
More file actions
91 lines (86 loc) · 3.18 KB
/
tests_cib_stonith_levels_validation.yml
File metadata and controls
91 lines (86 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# SPDX-License-Identifier: MIT
---
- name: Ensure stonith levels are properly defined
hosts: all
vars_files: vars/main.yml
tasks:
- name: Run test
tags: tests::verify
block:
- name: Set up test environment
include_role:
name: linux-system-roles.ha_cluster
tasks_from: test_setup.yml
- name: Check that target is specified
block:
- name: Run HA Cluster role 1
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
ha_cluster_cluster_name: test-cluster
ha_cluster_stonith_levels:
- level: 1
resource_ids:
- fence1
rescue:
- name: Check errors 1
assert:
that:
- ansible_failed_result.results[0].msg ==
"Specify exactly one of 'target', 'target_pattern', "
~ "'target_attribute' for each fencing level\n"
run_once: true # noqa: run_once[task]
- name: Check that exactly one target is specified
block:
- name: Run HA Cluster role 2
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
ha_cluster_cluster_name: test-cluster
ha_cluster_stonith_levels:
- level: 1
target: node
target_pattern: node
resource_ids:
- fence1
rescue:
- name: Check errors 2
assert:
that:
- ansible_failed_result.results[0].msg ==
"Specify exactly one of 'target', 'target_pattern', "
~ "'target_attribute' for each fencing level\n"
run_once: true # noqa: run_once[task]
- name: Check that level is specified
block:
- name: Run HA Cluster role 3
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
ha_cluster_cluster_name: test-cluster
ha_cluster_stonith_levels:
- target: node
resource_ids:
- fence1
rescue:
- name: Check errors 3
assert:
that:
- ansible_failed_result.results[0].msg ==
"Specify 'level' 1..9 for each fencing level"
run_once: true # noqa: run_once[task]
- name: Check that level is correct
block:
- name: Run HA Cluster role 4
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
ha_cluster_cluster_name: test-cluster
ha_cluster_stonith_levels:
- level: 10
target: node
resource_ids:
- fence1
rescue:
- name: Check errors 4
assert:
that:
- ansible_failed_result.results[0].msg ==
"Specify 'level' 1..9 for each fencing level"
run_once: true # noqa: run_once[task]