Skip to content

Commit

Permalink
Fix win_group_membership integration tests (#665)
Browse files Browse the repository at this point in the history
Integration test fix and adapt files to pass ansible-lint warning and errors
  • Loading branch information
ronger4 authored Nov 19, 2024
1 parent fbe2dc5 commit 9722494
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 146 deletions.
43 changes: 21 additions & 22 deletions tests/integration/targets/win_group_membership/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
- name: Gather facts
setup:
ansible.builtin.setup:

- name: Remove potentially leftover test group
win_group: &wg_absent
ansible.windows.win_group: &wg_absent
name: WinGroupMembershipTest
state: absent

- name: Remove potentially leftover test user
win_user: &wu_absent
ansible.windows.win_user: &wu_absent
name: WinTestUser
state: absent

- name: Add new test group
win_group:
ansible.windows.win_group:
name: WinGroupMembershipTest
state: present

- name: Add new test user
win_user:
ansible.windows.win_user:
name: WinTestUser
password: "W1nGr0upM3mb3rsh1pT3$tP@$$w0rd"
state: present

- name: Run tests for win_group_membership
block:

- name: Test in normal mode
import_tasks: tests.yml
vars:
win_local_group: WinGroupMembershipTest
win_local_user: WinTestUser
in_check_mode: no

- name: Test in check-mode
import_tasks: tests.yml
vars:
win_local_group: WinGroupMembershipTest
win_local_user: WinTestUser
in_check_mode: yes
check_mode: yes
- name: Test in normal mode
ansible.builtin.import_tasks: tests.yml
vars:
win_local_group: WinGroupMembershipTest
win_local_user: WinTestUser
in_check_mode: false

- name: Test in check-mode
ansible.builtin.import_tasks: tests.yml
vars:
win_local_group: WinGroupMembershipTest
win_local_user: WinTestUser
in_check_mode: true
check_mode: true

- name: Remove test group
win_group: *wg_absent
ansible.windows.win_group: *wg_absent

- name: Remove test user
win_group: *wu_absent
ansible.windows.win_group: *wu_absent
Loading

0 comments on commit 9722494

Please sign in to comment.