forked from linux-system-roles/ha_cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests_bootc_e2e_cluster.yml
More file actions
94 lines (81 loc) · 3.4 KB
/
tests_bootc_e2e_cluster.yml
File metadata and controls
94 lines (81 loc) · 3.4 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
92
93
94
# SPDX-License-Identifier: MIT
---
- name: Test bootc integration - cluster
hosts: all
vars_files: vars/main.yml
tasks:
- name: Run test
tags: tests::verify
when: ansible_connection | d("") == "buildah" or __bootc_validation | d(false)
block:
- name: Set up test environment
include_role:
name: linux-system-roles.ha_cluster
tasks_from: test_setup.yml
- name: Do build time tasks and verify
when: not __bootc_validation | d(false)
block:
- name: Run HA Cluster role
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
__sr_public: true
when: not __bootc_validation | d(false)
- name: Create QEMU deployment during bootc end-to-end test
delegate_to: localhost
command: "{{ lsr_scriptdir | quote }}/bootc-buildah-qcow.sh {{ ansible_host | quote }}"
changed_when: true
- name: Do build time tasks and verify
when: __bootc_validation | d(false)
block:
- name: Get package facts
package_facts:
- name: Check installed packages
assert:
that:
- "'corosync' in ansible_facts.packages"
- "'pacemaker' in ansible_facts.packages"
- "'pcs' in ansible_facts.packages"
- name: Get services status
include_tasks: tasks/handle_service_facts.yml
- name: Check that services exist and are not running
assert:
that:
- __test_service_facts["pcsd.service"].status == "disabled"
- __test_service_facts["pcsd.service"].state == "inactive"
- __test_service_facts["corosync.service"].status == "disabled"
- __test_service_facts["corosync.service"].state == "inactive"
- __test_service_facts["pacemaker.service"].status == "disabled"
- __test_service_facts["pacemaker.service"].state == "inactive"
- name: Stat corosync config
stat:
path: /etc/corosync/corosync.conf
register: stat_corosync_conf
- name: Stat corosync authkey
stat:
path: /etc/corosync/authkey
register: stat_corosync_key
- name: Stat pacemaker authkey
stat:
path: /etc/pacemaker/authkey
register: stat_pacemaker_key
- name: Stat fence-virt authkey
stat:
path: /etc/cluster/fence_xvm.key
register: stat_fence_xvm_key
- name: Stat pcsd TLS certificate
stat:
path: /var/lib/pcsd/pcsd.crt
register: stat_pcsd_cert
- name: Stat pcsd TLS key
stat:
path: /var/lib/pcsd/pcsd.key
register: stat_pcsd_key
- name: Check that config files, keys and certificates are not present
assert:
that:
- not stat_corosync_conf.stat.exists
- not stat_corosync_key.stat.exists
- not stat_pacemaker_key.stat.exists
- not stat_fence_xvm_key.stat.exists
- not stat_pcsd_cert.stat.exists
- not stat_pcsd_key.stat.exists