Skip to content

Commit 3f2fe95

Browse files
authored
Merge branch 'master' into alexy_ck_job_4a
2 parents 832c6e9 + 15185c5 commit 3f2fe95

2 files changed

Lines changed: 25 additions & 17 deletions

File tree

roles/client_side_tests/tasks/get_prom_info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
- name: "Generate an access token for prometheus"
3636
ansible.builtin.shell:
3737
cmd: |
38-
oc create token stf-prometheus-reader
38+
oc create token stf-prometheus-reader --duration=24h
3939
register: prom_token_out
4040
changed_when: false
4141

roles/test_sensubility/tasks/test_health_status.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
1-
#In this test we choose one container (logrotate_crond),checking that it is running
2-
#and then stopping the container and starting it again and checking that its health status changes accordingly.
1+
# In this test we choose one container (rsyslog),checking that it is running
2+
# and then stopping the container and starting it again and checking that its health status changes accordingly.
3+
#
4+
# NOTE(dpawlik): Earlier we were using logrotate_crond service to verify the
5+
# functionality. That has been changed to rsyslog, because in the
6+
# /config-scripts/collectd_check_health.py script that is running in collectd
7+
# container, in the SKIP_LIST, the regex contains: '.*_cron' which "fit"
8+
# the name 'logrotate_crond'. The regex should be '.*_cron$', then the
9+
# tests would pass.
310

4-
- name: RHELOSP-176011 Check that logrotate_crond container is running on ceph-0
11+
- name: RHELOSP-176011 Check that rsyslog container is running on ceph-0
512
delegate_to: ceph-0
613
become: true
714
delegate_facts: True
815
ansible.builtin.shell:
916
cmd: |
10-
{{ container_bin }} ps | grep logrotate_crond
17+
{{ container_bin }} ps | grep rsyslog
1118
register: container_nodes
1219
changed_when: false
1320
failed_when: container_nodes.stdout_lines|length != 1
1421

1522

16-
- name: RHELOSP-176012 Stop logrotate_crond container on ceph-0
23+
- name: RHELOSP-176012 Stop rsyslog container on ceph-0
1724
ansible.builtin.shell:
1825
cmd: |
19-
systemctl stop tripleo_logrotate_crond
26+
systemctl stop tripleo_rsyslog
2027
delegate_to: ceph-0
2128
become: true
2229
register: output
2330
changed_when: false
2431

25-
- name: RHELOSP-176037 Check that logrotate_crond container has stopped
32+
- name: RHELOSP-176037 Check that rsyslog container has stopped
2633
ansible.builtin.shell: |
27-
{{ container_bin }} ps | grep logrotate_crond
34+
{{ container_bin }} ps | grep rsyslog
2835
delegate_to: ceph-0
2936
become: true
3037
register: container_nodes
@@ -34,38 +41,39 @@
3441
- name: Check what metrics are available to prometheus that relate to sensubility
3542
ansible.builtin.shell:
3643
cmd: |
37-
curl -k {{ prom_auth_string }} -g https://${prom_url}/api/v1/label/__name__/values | jq | grep sensubility
44+
curl -k {{ prom_auth_string }} -g https://{{ prom_url }}/api/v1/label/__name__/values | jq | grep sensubility
3845
changed_when: false
3946

4047
- name: RHELOSP-176036 Check that health status of container changed to 0
41-
ansible.builtin.shell:
42-
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
48+
ansible.builtin.shell: >
49+
/usr/bin/curl
50+
-k {{ prom_auth_string }}
51+
-g https://{{ prom_url }}/api/v1/query?
52+
--data-urlencode 'query=last_over_time(sensubility_container_health_status{process="rsyslog",host="ceph-0.redhat.local"}[10m])' | grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+' | grep 0
4353
register: output
4454
changed_when: false
4555
retries: 60
4656
delay: 10
4757
until: "output.stdout_lines | length == 1"
4858

49-
- name: RHELOSP-176035 Start logrotate_crond container
59+
- name: RHELOSP-176035 Start rsyslog container
5060
ansible.builtin.shell:
5161
cmd: |
52-
systemctl start tripleo_logrotate_crond
62+
systemctl start tripleo_rsyslog
5363
delegate_to: ceph-0
5464
become: true
5565
register: output
5666
changed_when: false
5767

58-
5968
- name: RHELOSP-176038 Check that health status of container changed to 1
6069
ansible.builtin.shell:
6170
cmd: >-
6271
/usr/bin/curl -k {{ prom_auth_string }} \
6372
-g https://{{ prom_url }}/api/v1/query? \
64-
--data-urlencode 'query=last_over_time(sensubility_container_health_status{process="logrotate_crond",host="ceph-0.redhat.local"}[10m])' \
73+
--data-urlencode 'query=last_over_time(sensubility_container_health_status{process="rsyslog",host="ceph-0.redhat.local"}[10m])' \
6574
| grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+' | grep 1
6675
register: output
6776
changed_when: false
6877
retries: 60
6978
delay: 10
7079
until: "output.stdout_lines | length == 1"
71-

0 commit comments

Comments
 (0)