From db3c0fc23f7eabd4db5c54be89077facef8c14fa Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 27 Mar 2026 17:15:13 +0100 Subject: [PATCH] Make tests more lenient. (#1252) (#1253) (cherry picked from commit b00fc741e1cddc7e44171aff5737d4cb9cc6e16e) --- tests/ee/roles/current_container_facts/tasks/main.yml | 9 +++++---- .../targets/current_container_facts/tasks/main.yml | 2 +- .../targets/docker_container/tasks/tests/options.yml | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/ee/roles/current_container_facts/tasks/main.yml b/tests/ee/roles/current_container_facts/tasks/main.yml index 72bcbe66..d25f0da4 100644 --- a/tests/ee/roles/current_container_facts/tasks/main.yml +++ b/tests/ee/roles/current_container_facts/tasks/main.yml @@ -7,6 +7,10 @@ community.docker.current_container_facts: register: result +- name: Print facts returned by module + ansible.builtin.debug: + var: result.ansible_facts + # The following two tasks are useful if we ever have to debug why this fails. - name: Print all Ansible facts @@ -20,13 +24,10 @@ - /proc/self/cpuset - /proc/1/cgroup - /proc/1/environ + ignore_errors: true # not all of these files always exist loop_control: loop_var: path -- name: Print facts returned by module - debug: - var: result.ansible_facts - - name: Validate results assert: that: diff --git a/tests/integration/targets/current_container_facts/tasks/main.yml b/tests/integration/targets/current_container_facts/tasks/main.yml index a0d1ae79..2762f5d2 100644 --- a/tests/integration/targets/current_container_facts/tasks/main.yml +++ b/tests/integration/targets/current_container_facts/tasks/main.yml @@ -27,8 +27,8 @@ - /proc/self/cgroup - /proc/self/cpuset - /proc/self/mountinfo + ignore_errors: true # not all of these files always exist register: slurp - ignore_errors: true - name: Print files ansible.builtin.debug: diff --git a/tests/integration/targets/docker_container/tasks/tests/options.yml b/tests/integration/targets/docker_container/tasks/tests/options.yml index 7ed6cb1f..52aea35e 100644 --- a/tests/integration/targets/docker_container/tasks/tests/options.yml +++ b/tests/integration/targets/docker_container/tasks/tests/options.yml @@ -957,7 +957,7 @@ - when: device_read_bps_1 is failed assert: that: - - "'error setting cgroup config for procHooks process' in device_read_bps_1.msg and 'blkio.throttle.read_bps_device: no such device' in device_read_bps_1.msg" + - "'error setting cgroup config for procHooks process' in device_read_bps_1.msg and ': no such device' in device_read_bps_1.msg" #################################################################### ## device_read_iops ################################################ @@ -1040,7 +1040,7 @@ - when: device_read_iops_1 is failed assert: that: - - "'error setting cgroup config for procHooks process' in device_read_iops_1.msg and 'blkio.throttle.read_iops_device: no such device' in device_read_iops_1.msg" + - "'error setting cgroup config for procHooks process' in device_read_iops_1.msg and ': no such device' in device_read_iops_1.msg" #################################################################### ## device_write_bps and device_write_iops ########################## @@ -1110,7 +1110,7 @@ - when: device_write_limit_1 is failed assert: that: - - "'error setting cgroup config for procHooks process' in device_write_limit_1.msg and 'blkio.throttle.write_bps_device: no such device' in device_write_limit_1.msg" + - "'error setting cgroup config for procHooks process' in device_write_limit_1.msg and ': no such device' in device_write_limit_1.msg" #################################################################### ## device_requests #################################################