From 3af14913cb4484d1e4deb333f975e1a67b28845a Mon Sep 17 00:00:00 2001 From: Matt Willsher Date: Fri, 21 Jun 2024 08:01:22 +0100 Subject: [PATCH] fix: base @ tests on socket accept as the code does --- tests/tests_second_service.yml | 4 ++-- tests/tests_second_service_drop_in.yml | 3 ++- tests/tests_systemd_services.yml | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tests_second_service.yml b/tests/tests_second_service.yml index 3f7f41b..921bc2a 100644 --- a/tests/tests_second_service.yml +++ b/tests/tests_second_service.yml @@ -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: diff --git a/tests/tests_second_service_drop_in.yml b/tests/tests_second_service_drop_in.yml index a315815..22e4a71 100644 --- a/tests/tests_second_service_drop_in.yml +++ b/tests/tests_second_service_drop_in.yml @@ -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: diff --git a/tests/tests_systemd_services.yml b/tests/tests_systemd_services.yml index f3073dc..e1679a7 100644 --- a/tests/tests_systemd_services.yml +++ b/tests/tests_systemd_services.yml @@ -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: