Files @ 663c02da41b8
Branch filter:

Location: majic-ansible-roles/roles/php_website/molecule/default/tests/test_parameters_optional_jessie.py

branko
Noticket: Improve reliability for mail_server tests, detection of running ClamAV daemon:

The fixes mainly help with reliability of tests against the
mail_server role due to ClamAV not becoming available before the tests
get run. This normally is not a real issue in production (since the
daemon will become available farily quickly).

Changes made:

- Wait for ClamAV socket to become available in mail_server
role (otherwise mail delivery failures can happen).
- Increase memory used in mail server instances for testing to avoid
OOM killer kicking-in during tests.
- Introduce slight delay when running local alias tests to avoid race
condition.
- Formating fix in task that waits for ClamAV database to be
available.
import os

import testinfra.utils.ansible_runner

testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('jessie')


def test_mariadb_compat_symlink(host):
    """
    Tests if compatibility symlink is set-up for mysql_config binary if
    libmariadb-client-lgpl-dev-compat is installed.
    """

    link = host.file('/usr/bin/mysql_config')
    assert link.is_symlink
    assert link.linked_to == "/usr/bin/mariadb_config"