ansible-role-forgejo_runner/molecule/default/tests/test_default.py
Adrien Waksberg c0402701d0
Some checks failed
/ lint (push) Failing after 17s
/ molecule (push) Successful in 57s
first version
2024-05-10 22:38:58 +02:00

34 lines
920 B
Python

import testinfra.utils.ansible_runner
def test_package(host):
package = host.package('docker.io')
assert package.is_installed
def test_user(host):
user = host.user('forgejo-runner')
assert user.exists
assert user.group == 'forgejo-runner'
assert 'docker' in user.groups
assert user.home == '/opt/forgejo-runner'
assert user.shell == '/bin/nologin'
def test_binary_file(host):
path = host.file('/usr/local/bin/forgejo-runner')
assert path.exists
assert path.is_file
assert path.user == 'root'
assert path.group == 'root'
assert path.mode == 0o755
def test_config_file(host):
path = host.file('/etc/forgejo-runner.yml')
assert path.exists
assert path.is_file
assert path.user == 'root'
assert path.group == 'root'
assert path.mode == 0o644
assert path.contains('level: info')
def test_service(host):
service = host.service('forgejo-runner')
assert service.is_enabled