Skip to content

Commit

Permalink
tests: Fail when rsyslog errors in __default_system_log
Browse files Browse the repository at this point in the history
When imuxsock is configured, errors are not visible in journalctl, but
in /var/log/messages. The test now searches for errors in this file.
  • Loading branch information
spetrosi committed May 20, 2024
1 parent a3f9e5c commit aab2c6b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/tests_imuxsock_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@
__logging_file: "{{ __default_system_log }}"
include_tasks: tasks/test_logger.yml

- name: Get content of {{ __default_system_log }}
command: cat {{ __default_system_log }}
register: __default_system_log_content
changed_when: false

- name: Ensure no errors in {{ __default_system_log }}
assert:
that: "'rsyslogd: error' not in __default_system_log_content.stdout"

- name: Check ports managed by firewall and selinux
include_tasks: tasks/check_firewall_selinux.yml

Expand Down Expand Up @@ -139,6 +148,12 @@
command: journalctl -ex
changed_when: false

# When imuxsock is configured, errors are not visible in journalctl
- name: Print errors in {{ __default_system_log }}
command: >-
grep "rsyslogd: error" {{ __default_system_log }}
changed_when: false

- name: Fail
fail:
msg: "{{ ansible_failed_result }}"

0 comments on commit aab2c6b

Please sign in to comment.