|
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. |
3 | 10 |
|
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 |
5 | 12 | delegate_to: ceph-0 |
6 | 13 | become: true |
7 | 14 | delegate_facts: True |
8 | 15 | ansible.builtin.shell: |
9 | 16 | cmd: | |
10 | | - {{ container_bin }} ps | grep logrotate_crond |
| 17 | + {{ container_bin }} ps | grep rsyslog |
11 | 18 | register: container_nodes |
12 | 19 | changed_when: false |
13 | 20 | failed_when: container_nodes.stdout_lines|length != 1 |
14 | 21 |
|
15 | 22 |
|
16 | | -- name: RHELOSP-176012 Stop logrotate_crond container on ceph-0 |
| 23 | +- name: RHELOSP-176012 Stop rsyslog container on ceph-0 |
17 | 24 | ansible.builtin.shell: |
18 | 25 | cmd: | |
19 | | - systemctl stop tripleo_logrotate_crond |
| 26 | + systemctl stop tripleo_rsyslog |
20 | 27 | delegate_to: ceph-0 |
21 | 28 | become: true |
22 | 29 | register: output |
23 | 30 | changed_when: false |
24 | 31 |
|
25 | | -- name: RHELOSP-176037 Check that logrotate_crond container has stopped |
| 32 | +- name: RHELOSP-176037 Check that rsyslog container has stopped |
26 | 33 | ansible.builtin.shell: | |
27 | | - {{ container_bin }} ps | grep logrotate_crond |
| 34 | + {{ container_bin }} ps | grep rsyslog |
28 | 35 | delegate_to: ceph-0 |
29 | 36 | become: true |
30 | 37 | register: container_nodes |
|
34 | 41 | - name: Check what metrics are available to prometheus that relate to sensubility |
35 | 42 | ansible.builtin.shell: |
36 | 43 | 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 |
38 | 45 | changed_when: false |
39 | 46 |
|
40 | 47 | - 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 |
43 | 53 | register: output |
44 | 54 | changed_when: false |
45 | 55 | retries: 60 |
46 | 56 | delay: 10 |
47 | 57 | until: "output.stdout_lines | length == 1" |
48 | 58 |
|
49 | | -- name: RHELOSP-176035 Start logrotate_crond container |
| 59 | +- name: RHELOSP-176035 Start rsyslog container |
50 | 60 | ansible.builtin.shell: |
51 | 61 | cmd: | |
52 | | - systemctl start tripleo_logrotate_crond |
| 62 | + systemctl start tripleo_rsyslog |
53 | 63 | delegate_to: ceph-0 |
54 | 64 | become: true |
55 | 65 | register: output |
56 | 66 | changed_when: false |
57 | 67 |
|
58 | | - |
59 | 68 | - name: RHELOSP-176038 Check that health status of container changed to 1 |
60 | 69 | ansible.builtin.shell: |
61 | 70 | cmd: >- |
62 | 71 | /usr/bin/curl -k {{ prom_auth_string }} \ |
63 | 72 | -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])' \ |
65 | 74 | | grep -oP '(?<="value":).*' | awk -F, '{ print $2 }' | grep -o '[0-9]\+' | grep 1 |
66 | 75 | register: output |
67 | 76 | changed_when: false |
68 | 77 | retries: 60 |
69 | 78 | delay: 10 |
70 | 79 | until: "output.stdout_lines | length == 1" |
71 | | - |
|
0 commit comments