tripleo-ansible/tripleo_ansible/roles/tripleo_collectd/molecule/enable_libpodstats/verify.yml

53 lines
1.9 KiB
YAML

---
# Copyright 2021 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- import_playbook: ../common/verify.yml
- name: "Verify collectd libpodstats plugin"
hosts: all
tasks:
- name: Check that the libpodstats conf file exists
stat:
path: '/etc/collectd.d/libpodstats.conf'
register: output
failed_when:
- not output.stat.exists
- name: Get contents of libpodstats.conf
slurp:
src: /etc/collectd.d/libpodstats.conf
register: libpodstats_conf
failed_when:
- not 'LoadPlugin "libpodstats"' in libpodstats_conf.content | b64decode
- not '<Plugin "libpodstats">' in libpodstats_conf.content | b64decode
- not '</Plugin>' in libpodstats_conf.content | b64decode
- name: "Check that the TypesDB has been updated"
slurp:
src: /etc/collectd.conf
register: output
failed_when:
- not "TypesDB \"/etc/collectd.d/types.db.libpodstats\"" in output.content | b64decode
- name: "Check that the contents of types.db.libpodstats are as expected"
slurp:
src: /etc/collectd.d/types.db.libpodstats
register: typesdb
failed_when:
- not "pod_cpu percent:GAUGE:0:100.1, time:DERIVE:0:U" in typesdb.content | b64decode
- not "pod_memory value:GAUGE:0:281474976710656" in typesdb.content | b64decode