tokenbridge/deployment/molecule/tests/test_all.py
Przemyslaw Rzad 54f6fb5835
UI deployment - Molecule tests (#147)
* Renamed scenario default to oracle

* Introduced ui molecule tests

* Readme

* Common prepare

* Shared test_all

* Moved test_docker_config to common

* Added ui tests

* Lint.
2019-07-12 14:51:06 +02:00

35 lines
919 B
Python

import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_repo(host):
assert host.file('/home/poadocker/bridge').exists
assert host.file('/home/poadocker/bridge').is_directory
assert host.file('/home/poadocker/bridge/package.json').exists
def test_docker_group(host):
assert host.group('docker').exists
def test_user(host):
assert host.user('poadocker').exists
assert 'docker' in host.user('poadocker').groups
@pytest.mark.parametrize("filename", [
("/etc/rsyslog.d/30-docker.conf"),
("/etc/rsyslog.d/35-docker-remote-logging.conf")
])
def test_logging(host, filename):
assert host.file(filename).exists
assert host.file(filename).mode == 0o0644
def test_docker_config(host):
assert host.file('/etc/docker/daemon.json').exists