Skip to content

Commit

Permalink
test: test support for qdevice tls and kaptb options
Browse files Browse the repository at this point in the history
Support for these options is purely a pcs thing, there is no code update
needed to be done in the role itself. This test demonstrates that the
options are indeed supported by the role.
  • Loading branch information
tomjelinek committed Oct 11, 2023
1 parent afbc87c commit 5c9a376
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ variables:
- include_vars_from_parent
- qdevice_all_options
- qdevice_minimal
- qdevice_tls_kaptb_options
- qnetd_and_cluster
- qnetd_disabled
- qnetd
Expand Down
76 changes: 76 additions & 0 deletions tests/tests_qdevice_tls_kaptb_options.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# SPDX-License-Identifier: MIT
---
- name: Test qdevice - tls and KAPTB options
hosts: all
vars_files: vars/main.yml
vars:
_required_capability: corosync.quorum.device.model.net.options_tls_and_kaptb

tasks:
- name: Set qnetd address
set_fact:
__test_qnetd_address: "{{
(ansible_play_hosts_all | length == 1)
| ternary('localhost', ansible_play_hosts[0]) }}"

# Install pcs so we can detect whether it supports tls and kaptb options
- name: Install pcs
package:
name: pcs
state: present

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

- name: Run test
tags: tests::verify
include_tasks: template_qdevice.yml
when:
- _required_capability in __test_pcs_capabilities
vars:
ha_cluster_quorum:
device:
model: net
model_options:
- name: host
value: "{{ __test_qnetd_address }}"
- name: algorithm
value: lms
- name: tls
value: required
- name: keep_active_partition_tie_breaker
value: "on"
__test_expected_lines:
- "totem {"
- " version: 2"
- " cluster_name: {{ ha_cluster_cluster_name }}"
- " transport: knet"
- " crypto_cipher: aes256"
- " crypto_hash: sha256"
- "}"
- "nodelist {"
- "}"
- "quorum {"
- " provider: corosync_votequorum"
- " device {"
- " model: net"
- " net {"
- " algorithm: lms"
- " host: {{ __test_qnetd_address }}"
- " keep_active_partition_tie_breaker: on"
- " tls: required"
- " }"
- " }"
- "}"
- "logging {"
- " to_logfile: yes"
- " logfile: /var/log/cluster/corosync.log"
- " to_syslog: yes"
- " timestamp: on"
- "}"

- name: Warn about skipped test
debug:
msg: This test needs pcs with {{ _required_capability }} capability
when:
- _required_capability not in __test_pcs_capabilities

0 comments on commit 5c9a376

Please sign in to comment.