Files @ b68d19ad38a3
Branch filter:

Location: majic-ansible-roles/roles/ldap_client/tests/test_optional.py - annotation

branko
MAR-33: Added initial scaffolding for wsgi_website tests:

- Added Molecule configuration file.
- Implemented test playbook that sets-up three separate instances of WSGI
website in order to test all variations of parameters.
- Added name for the set_fact task.
- Fixed linting errors related to mode that lacks leading zero.
- Added skip_ansible_lint tag for command that creates the Python virtual
environment.
- Added missing become keyword wherever become_user is specified.
- Fixed invalid parameter name for specifying if HTTPS should be enforced or
not.
- Added small initial sample WSGI apps that get deployed.
- Added static/media sample files.
- Added TLS material.
- Added initial dummy test file.
import testinfra.utils.ansible_runner

testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    '.molecule/ansible_inventory').get_hosts('parameters-optional')


def test_ldap_configuration_file_content(File):
    """
    Tests if LDAP configuration file has correct content
    """

    expected_content = """# CA truststore
TLS_CACERT /etc/ssl/certs/testca.cert.pem
# Ensure TLS is enforced
TLS_REQCERT demand
# Default URI to connect to
URI ldaps://ldap-server/
# Base entry
BASE dc=local"""

    config = File('/etc/ldap/ldap.conf')

    assert config.content == expected_content