Skip to content

Commit

Permalink
test: Improve HA tests
Browse files Browse the repository at this point in the history
* Remove mssql_version from inventory, set it in the playbook
* Set mssql_manage_selinux and mssql_run_selinux_confined to true on EL9
* Load softdog module for stonith to have at least one watchdog
  • Loading branch information
spetrosi committed Sep 13, 2024
1 parent a52b7ba commit 59b692e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 7 additions & 6 deletions tests/tests_configure_ha_cluster_external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
# managed_host1:
# ansible_host: <ip_address1>
# mssql_ha_replica_type: primary
# mssql_version: <version_to_test>
# managed_host2:
# ansible_host: <ip_address2>
# mssql_ha_replica_type: synchronous
# mssql_version: <version_to_test>
# managed_host3:
# ansible_host: <ip_address3>
# mssql_ha_replica_type: witness
# mssql_version: <version_to_test>
---
- name: Verify HA functionality with external clusters and templates
hosts: all
Expand All @@ -27,12 +24,12 @@
mssql_edition: Evaluation
mssql_version: 2022
mssql_manage_firewall: true
__mssql_gather_facts_no_log: true
__mssql_test_confined_supported: "{{
(ansible_distribution in ['CentOS', 'RedHat']) and
(ansible_distribution_major_version is version('9', '>=')) }}"
__mssql_gather_facts_no_log: true
mssql_manage_selinux: false
mssql_run_selinux_confined: false
mssql_manage_selinux: "{{ __mssql_test_confined_supported }}"
mssql_run_selinux_confined: "{{ __mssql_test_confined_supported }}"
mssql_ha_configure: true
mssql_ha_endpoint_port: 5022
mssql_ha_cert_name: ExampleCert
Expand Down Expand Up @@ -165,6 +162,10 @@
- ansible_play_hosts_all | length == 1
- mssql_ha_replica_type is not defined

- name: Load softdog module for stonith to have at least one watchdog
command: modprobe softdog
changed_when: true

- name: Set facts to create test DBs on primary as a pre task
set_fact:
mssql_pre_input_sql_file:
Expand Down
10 changes: 5 additions & 5 deletions tests/tests_configure_ha_cluster_read_scale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
# managed_host1:
# ansible_host: <ip_address1>
# mssql_ha_replica_type: primary
# mssql_version: <version_to_test>
# managed_host2:
# ansible_host: <ip_address2>
# mssql_ha_replica_type: synchronous
# mssql_version: <version_to_test>
# managed_host3:
# ansible_host: <ip_address3>
# mssql_ha_replica_type: asynchronous
# mssql_version: <version_to_test>
---
- name: Verify HA functionality with read-scale clusters
hosts: all
Expand All @@ -27,8 +24,11 @@
mssql_version: 2022
mssql_manage_firewall: true
__mssql_gather_facts_no_log: true
mssql_manage_selinux: false
mssql_run_selinux_confined: false
__mssql_test_confined_supported: "{{
(ansible_distribution in ['CentOS', 'RedHat']) and
(ansible_distribution_major_version is version('9', '>=')) }}"
mssql_manage_selinux: "{{ __mssql_test_confined_supported }}"
mssql_run_selinux_confined: "{{ __mssql_test_confined_supported }}"
mssql_ha_configure: true
mssql_ha_endpoint_port: 5022
mssql_ha_cert_name: ExampleCert
Expand Down

0 comments on commit 59b692e

Please sign in to comment.