Skip to content
Snippets Groups Projects
Commit c79096d6 authored by nimrod's avatar nimrod
Browse files

- Use SystemInfo to determine to OS type (instead of using the facts from the...

- Use SystemInfo to determine to OS type (instead of using the facts from the Ansbile module and the Testinfra backend module, which is just ugly code).
parent fc9abec9
Branches
No related tags found
No related merge requests found
...@@ -8,15 +8,9 @@ def test_deploy_key(Command, Sudo): ...@@ -8,15 +8,9 @@ def test_deploy_key(Command, Sudo):
assert Command('git -C /tmp/ansible-role-deploy-key pull').rc == 0 assert Command('git -C /tmp/ansible-role-deploy-key pull').rc == 0
def test_deply_key_alias(File, Ansible, User, TestinfraBackend): def test_deply_key_alias(File, User, SystemInfo):
assert User('nobody').exists assert User('nobody').exists
connection = TestinfraBackend.get_connection_type() if SystemInfo.type == 'linux':
if connection == 'docker':
ansible_os_family = 'Debian'
elif connection == 'ansible':
ansible_os_family = Ansible('setup')['ansible_facts'][
'ansible_os_family']
if ansible_os_family == 'Debian':
assert File('/etc/aliases').contains('nobody: root') assert File('/etc/aliases').contains('nobody: root')
elif ansible_os_family == 'OpenBSD': elif SystemInfo.type == 'openbsd':
assert File('/etc/mail/aliases').contains('nobody: root') assert File('/etc/mail/aliases').contains('nobody: root')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment