Skip to content

Commit

Permalink
[test_verify_email] Update log check
Browse files Browse the repository at this point in the history
* update the tasks to remove grep and wc
* add a second task to wait for an update in the log
  • Loading branch information
elfiesmelfie committed Nov 27, 2024
1 parent 4817858 commit 91990e9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions roles/test_verify_email/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,21 @@
- name: "RHELOSP-176045 Check for alertmanager logs"
ansible.builtin.shell:
cmd: |
oc logs alertmanager-default-0 -c alertmanager | grep 'receiver=email' | wc -l
oc logs alertmanager-default-0 -c alertmanager
register: cmd_output
failed_when: "cmd_output.stdout|int == 0"
failed_when:
- "cmd_output.stdout_lines | length == 0"
- "'receiver=email' not in cmd_outout.stdout"
changed_when: false

- name: "RHELOSP-176045 Check for alertmanager logs"
ansible.builtin.shell:
cmd: |
oc logs alertmanager-default-0 -c alertmanager
register: cmd_output
retries: 18
delay: 10
until: "'receiver=email' in cmd_outout.stdout"
changed_when: false

always:
Expand Down

0 comments on commit 91990e9

Please sign in to comment.