Skip to content

Commit

Permalink
Test playbooks enhancement
Browse files Browse the repository at this point in the history
In the code to check the log message is successfully logged or not
in the /var/log/messages file, adding "until: __result is success"
and waiting up to 5 seconds.
  • Loading branch information
nhosoi committed Aug 25, 2020
1 parent fe3f658 commit 90952a1
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/tests_basics_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@

- name: Check the test log message in {{ __default_system_log }}
command: /bin/grep testMessage0000 {{ __default_system_log }}
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false
4 changes: 4 additions & 0 deletions tests/tests_basics_files2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,8 @@

- name: Check the test log message in {{ __default_system_log }}
command: /bin/grep testMessage0000 "{{ __default_system_log }}"
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false
4 changes: 4 additions & 0 deletions tests/tests_basics_files_forwards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@

- name: Check the test log message in {{ __default_system_log }}
command: /bin/grep testMessage0000 '{{ __default_system_log }}'
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false

- name: Check if the forwarding config exists
Expand Down
4 changes: 4 additions & 0 deletions tests/tests_basics_files_log_dir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@

- name: Check the files output config that the path is {{ logging_system_log_dir }}/messages
command: /bin/grep '\*.info;mail.none;authpriv.none;cron.none.*{{ logging_system_log_dir }}/messages' {{ __test_files_conf }}
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false

- name: Check the test log message in {{ logging_system_log_dir }}/messages
Expand Down
4 changes: 4 additions & 0 deletions tests/tests_basics_forwards_implicit_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@

- name: Check if the test message is in {{ __default_system_log }}
command: /bin/grep testMessage0000 '{{ __default_system_log }}'
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false

- name: Get the forwarding config stat
Expand Down
4 changes: 4 additions & 0 deletions tests/tests_combination.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@

- name: Check the test log message in {{ __default_system_log }}
command: /bin/grep testMessage0000 '{{ __default_system_log }}'
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false

- name: Generated a file to check severity_and_facility
Expand Down
4 changes: 4 additions & 0 deletions tests/tests_combination2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@

- name: Check the test log message in {{ __default_system_log }}
command: /bin/grep testMessage0000 '{{ __default_system_log }}'
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false

- name: Check the forwarding config stat
Expand Down
4 changes: 4 additions & 0 deletions tests/tests_imuxsock_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@

- name: Check the test log message in {{ __default_system_log }}
command: /bin/grep testMessage0000 "{{ __default_system_log }}"
register: __result
until: __result is success
retries: 5
delay: 1
changed_when: false

0 comments on commit 90952a1

Please sign in to comment.