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 5, 2023
1 parent a02d42f commit 303973f
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions tests/tests_qdevice_tls_kaptb_options.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# 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]) }}"

- 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 303973f

Please sign in to comment.