Repository URL to install this package:
|
Version:
1.0.0b1 ▾
|
pycklets
/
resources
/
ansible-role
/
cloudalchemy.mysqld-exporter
/
molecule
/
default
/
tests
/
test_default.py
|
|---|
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_files(host):
files = [
"/etc/systemd/system/mysqld_exporter.service",
"/usr/local/bin/mysqld_exporter"
]
for file in files:
f = host.file(file)
assert f.exists
assert f.is_file
def test_service(host):
s = host.service("mysqld_exporter")
# assert s.is_enabled
assert s.is_running
def test_socket(host):
sockets = [
"tcp://127.0.0.1:9104"
]
for socket in sockets:
s = host.socket(socket)
assert s.is_listening