Files @ bfafd526bfc3
Branch filter:

Location: majic-ansible-roles/roles/backup_client/tests/test_default.py

branko
MAR-108: Updated tests for backup_server role:

- Refactored how the internal parameters for GnuPG binary name and length of
key ID used in Duply configuration is set-up (use defaults/main.yml instead of
set_facts module).
- Added Debian Stretch as supported platform to molecule tests.
- Replaced use of backup_server role for deployment with regular server with SSH
properly set-up.
- Use IP address for backup server instead of hostname for backup_client
configuration.
- Fixed key lookup for known hosts to use public keys (and not private keys).
- Added public keys of server for deployment in client known_hosts file.
import testinfra.utils.ansible_runner

testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    '.molecule/ansible_inventory').get_hosts('all')


def test_hosts_file(File):
    f = File('/etc/hosts')

    assert f.exists
    assert f.user == 'root'
    assert f.group == 'root'