Skip to content

Commit 8a3889d

Browse files
committed
[temp][test_sensubility] Add more detail to the healthcheck
1 parent 6b51a0d commit 8a3889d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

roles/test_sensubility/tasks/test_health_status.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
changed_when: false
3333
failed_when: container_nodes.stdout_lines|length != 0
3434

35+
36+
# issue might be that the value is aggregated over 10m, and we only check for 2
3537
- name: RHELOSP-176036 Check that health status of container changed to 0
3638
ansible.builtin.shell:
3739
cmd: /usr/bin/curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/query? --data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[10m])' | grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+' | grep 0
@@ -41,6 +43,52 @@
4143
delay: 10
4244
until: "output.stdout_lines | length == 1"
4345

46+
- name: NEW RHELOSP-176036 but check over a smaller time
47+
ansible.builtin.shell:
48+
cmd: /usr/bin/curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/query? --data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[2m])' | grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+' | grep 0
49+
register: output
50+
changed_when: false
51+
retries: 12
52+
delay: 10
53+
until: "output.stdout_lines | length == 1"
54+
55+
- name: NEW RHELOSP-176036 but check over a smaller time
56+
ansible.builtin.shell:
57+
cmd: /usr/bin/curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/query? --data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[2m])' | grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+' | grep 0
58+
register: output
59+
changed_when: false
60+
retries: 12
61+
delay: 10
62+
until: "output.stdout_lines | length == 1"
63+
64+
- name: NEW RHELOSP-176036 but wait for up to 10 minutes
65+
ansible.builtin.shell:
66+
cmd: /usr/bin/curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/query? --data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[10m])' | grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+' | grep 0
67+
register: output
68+
changed_when: false
69+
retries: 60
70+
delay: 10
71+
until: "output.stdout_lines | length == 1"
72+
73+
- name: NEW RHELOSP-176036 but don't "grep 0"
74+
ansible.builtin.shell:
75+
cmd: /usr/bin/curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/query? --data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[10m])' | grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+'
76+
register: output
77+
changed_when: false
78+
79+
- name: NEW RHELOSP-176036 but skip the awk
80+
ansible.builtin.shell:
81+
cmd: /usr/bin/curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/query? --data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[10m])' | grep -oP '(?<="value":).*'
82+
register: output
83+
changed_when: false
84+
85+
- name: NEW RHELOSP-176036 but check the whole output
86+
ansible.builtin.shell:
87+
cmd: /usr/bin/curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/query? --data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[10m])'
88+
register: output
89+
changed_when: false
90+
91+
4492
- name: RHELOSP-176035 Start logrotate_crond container
4593
ansible.builtin.shell:
4694
cmd: |

0 commit comments

Comments
 (0)