mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-02 04:04:23 -07:00
Update tests/integration/targets/listen_ports_facts/tasks/main.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
02c51d6448
commit
7670f9b4df
1 changed files with 24 additions and 26 deletions
|
@ -112,32 +112,30 @@
|
|||
ignore_errors: true
|
||||
|
||||
|
||||
- name: Remove netstat and ss dependencies to simulate missing executables
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- net-tools
|
||||
- iproute2
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
when: ansible_os_family == "Debian"
|
||||
- when: ansible_os_family == "Debian"
|
||||
block:
|
||||
- name: Remove netstat and ss dependencies to simulate missing executables
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- net-tools
|
||||
- iproute2
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
|
||||
- name: Trigger listen_ports_facts with missing tools
|
||||
community.general.listen_ports_facts:
|
||||
register: listen_ports_failure_result
|
||||
ignore_errors: true
|
||||
when: ansible_os_family == "Debian"
|
||||
- name: Trigger listen_ports_facts with missing tools
|
||||
community.general.listen_ports_facts:
|
||||
register: listen_ports_failure_result
|
||||
ignore_errors: true
|
||||
|
||||
- name: Assert graceful failure when dependencies are missing
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- listen_ports_failure_result.failed
|
||||
- "'Unable to find any of the supported commands' in listen_ports_failure_result.msg"
|
||||
when: ansible_os_family == "Debian"
|
||||
- name: Assert graceful failure when dependencies are missing
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- listen_ports_failure_result is failed
|
||||
- "'Unable to find any of the supported commands' in listen_ports_failure_result.msg"
|
||||
|
||||
- name: Reinstall netstat and ss dependencies after test
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- net-tools
|
||||
- iproute2
|
||||
state: present
|
||||
when: ansible_os_family == "Debian"
|
||||
- name: Reinstall netstat and ss dependencies after test
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- net-tools
|
||||
- iproute2
|
||||
state: present
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue