Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adding collectd libpodstats tests #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions roles/client_side_tests/tasks/test_libpodstats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
- name: Get prom creds
ansible.builtin.include_tasks:
file: get_prom_info.yml

- name: Check for libpodstats cpu time total
# Description: Query Prometheus for collectd_libpodstats_cpu_time_total metrics and save the output into the file
ansible.builtin.shell:
cmd: >-
/usr/bin/curl -k -u "{{ prom_user }}:{{ prom_pass }}" \
-g https://{{ prom_url }}/api/v1/query? \
--data-urlencode 'query=collectd_libpodstats_pod_cpu_time_total {type_instance="base"}[1m]' \
--output /tmp/query_libpodstats_pod_cpu_time_total
register: checkmyconf
changed_when: false
failed_when:
- checkmyconf.rc !=0


- name: Check for libpodstats_pod_memory
# Description: Query Prometheus for collectd_libpodstats_memory metrics and save the output into the file
ansible.builtin.shell:
cmd: >-
/usr/bin/curl -k -u "{{ prom_user }}:{{ prom_pass }}" \
-g https://{{ prom_url }}/api/v1/query? \
--data-urlencode 'query=collectd_libpodstats_pod_memory {type_instance="base"}[1m]' \
--output /tmp/query_libpodstats_pod_memory
register: checkmyconf
changed_when: false
failed_when:
- checkmyconf.rc !=0


- name: Check for libpodstats_pod_memory
# Description: Query Prometheus for collectd_libpodstats_cpu_percent metrics and save the output into the file
ansible.builtin.shell:
cmd: >-
/usr/bin/curl -k -u "{{ prom_user }}:{{ prom_pass }}" \
-g https://{{ prom_url }}/api/v1/query? \
--data-urlencode 'query=collectd_libpodstats_pod_cpu_percent {type_instance="base"}[1m]' \
--output /tmp/query_libpodstats_pod_cpu_percent
register: checkmyconf
changed_when: false
failed_when:
- checkmyconf.rc !=0



- name: Read content of query_libpodstats_pod_cpu_time_total
# Description: Read content of query_libpodstats_pod_cpu_time_total and check that metrics are present
ansible.builtin.shell:
cmd: >-
egrep 'controller-0|controller-1|controller-2|compute-0|compute-1|ceph-0' /tmp/query_libpodstats_pod_cpu_time_total
register: checkmyconf
changed_when: false
failed_when:
- checkmyconf.rc != 0


- name: Read content of query_libpodstats_pod_memory
# Description: Read content of query_libpodstats_pod_memory and check that metrics are present
ansible.builtin.shell:
cmd: >-
egrep 'controller-0|controller-1|controller-2|compute-0|compute-1|ceph-0' /tmp/query_libpodstats_pod_memory
register: checkmyconf
changed_when: false
failed_when:
- checkmyconf.rc != 0




- name: Read content of query_libpodstats_pod_cpu_percent
# Description: Read content of query_libpodstats_pod_cpu_percent and check that metrics are present
ansible.builtin.shell:
cmd: >-
egrep 'controller-0|controller-1|controller-2|compute-0|compute-1|ceph-0' /tmp/query_libpodstats_pod_cpu_percent
register: checkmyconf
changed_when: false
failed_when:
- checkmyconf.rc != 0