Repository URL to install this package:
|
Version:
1.0.0b1 ▾
|
pycklets
/
resources
/
ansible-role
/
cloudalchemy.node-exporter
/
molecule
/
latest
/
tests
/
test_alternative.py
|
|---|
import pytest
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("files", [
"/etc/systemd/system/node_exporter.service",
"/usr/local/bin/node_exporter"
])
def test_files(host, files):
f = host.file(files)
assert f.exists
assert f.is_file
def test_service(host):
s = host.service("node_exporter")
# assert s.is_enabled
assert s.is_running
def test_socket(host):
s = host.socket("tcp://0.0.0.0:9100")
assert s.is_listening