From 303973fc1ccf8f86733e4a1c9ad6dffa87d17b0d Mon Sep 17 00:00:00 2001 From: Tomas Jelinek Date: Thu, 5 Oct 2023 16:37:32 +0200 Subject: [PATCH] test: test support for qdevice tls and kaptb options 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. --- tests/tests_qdevice_tls_kaptb_options.yml | 70 +++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/tests_qdevice_tls_kaptb_options.yml diff --git a/tests/tests_qdevice_tls_kaptb_options.yml b/tests/tests_qdevice_tls_kaptb_options.yml new file mode 100644 index 00000000..39ee57c2 --- /dev/null +++ b/tests/tests_qdevice_tls_kaptb_options.yml @@ -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