Skip to content

Commit

Permalink
tests: add qnetd cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjelinek authored and richm committed Dec 12, 2022
1 parent d1f3839 commit faa860f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
18 changes: 18 additions & 0 deletions tasks/test_cleanup_qnetd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-License-Identifier: MIT
# This task configures test systems for testing in the CI environment.
# Only use this task for testing.
# This task file resides in `tasks/` so that it can be used from other roles
# with `include_role` with `tasks_from: filename` directly without the need to
# provide a relative path. Providing relative path is problematic with
# collections.
---
- name: Make sure qnetd is not installed
package:
name:
- corosync-qnetd
state: absent

- name: Make sure qnetd config files are not present
file:
path: /etc/corosync/qnetd
state: absent
12 changes: 11 additions & 1 deletion tests/tests_qdevice_minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
name: linux-system-roles.ha_cluster
tasks_from: test_setup.yml

- name: Set up test environment for qnetd / qdevice
- name: Clean up test environment for qnetd
include_role:
name: linux-system-roles.ha_cluster
tasks_from: test_cleanup_qnetd.yml

- name: Set up test environment for qnetd
include_role:
name: linux-system-roles.ha_cluster
tasks_from: test_setup_qnetd.yml
Expand Down Expand Up @@ -99,4 +104,9 @@
- name: Check qdevice status
include_tasks: tasks/assert_qdevice_in_cluster.yml

always:
- name: Clean up test environment for qnetd
include_role:
name: linux-system-roles.ha_cluster
tasks_from: test_cleanup_qnetd.yml
tags: tests::verify
5 changes: 5 additions & 0 deletions tests/tests_qnetd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
name: linux-system-roles.ha_cluster
tasks_from: test_setup.yml

- name: Clean up test environment for qnetd
include_role:
name: linux-system-roles.ha_cluster
tasks_from: test_cleanup_qnetd.yml

- name: Run HA Cluster role
include_role:
name: linux-system-roles.ha_cluster
Expand Down
5 changes: 5 additions & 0 deletions tests/tests_qnetd_disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
name: linux-system-roles.ha_cluster
tasks_from: test_setup.yml

- name: Clean up test environment for qnetd / qdevice
include_role:
name: linux-system-roles.ha_cluster
tasks_from: test_cleanup_qnetd.yml

- name: Run HA Cluster role
include_role:
name: linux-system-roles.ha_cluster
Expand Down

0 comments on commit faa860f

Please sign in to comment.