Skip to content

Commit

Permalink
fix: base @ tests on socket accept as the code does
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwillsher committed Jun 21, 2024
1 parent 178ba8d commit 3af1491
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/tests_second_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@
when:
- ansible_facts['service_mgr'] == 'systemd' or
(ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7')
- ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12
- not (ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_version'] is version('24.04', '>=')) # 24.04 has no sshd@.service in the package
block:
- name: Read the created instantiated service file
ansible.builtin.slurp:
src: "/etc/systemd/system/sshd2@.service"
register: service_inst
when:
- __sshd_socket_accept | bool

- name: Check content of the created service file
ansible.builtin.assert:
Expand Down
3 changes: 2 additions & 1 deletion tests/tests_second_service_drop_in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@
tags: tests::verify
when:
- ansible_facts['service_mgr'] == 'systemd'
- ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12
block:
- name: Read the created instantiated service file
ansible.builtin.slurp:
src: "/etc/systemd/system/sshd2@.service"
register: service_inst
when:
- __sshd_socket_accept | bool

- name: Check content of the created service file
ansible.builtin.assert:
Expand Down
3 changes: 1 addition & 2 deletions tests/tests_systemd_services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@
when:
- ansible_facts['service_mgr'] == 'systemd' or
(ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7')
- ansible_facts['distribution'] != "Debian" or ansible_facts['distribution_major_version'] | int < 12
- not (ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_version'] is version('24.04', '>=')) # 24.04 has no sshd@.service in the package
- __sshd_socket_accept | bool
block:
- name: Read the distribution instantiated service file
ansible.builtin.slurp:
Expand Down

0 comments on commit 3af1491

Please sign in to comment.