Files
@ f05151d6f802
Branch filter:
Location: majic-ansible-roles/roles/web_server/molecule/default/tests/conftest.py - annotation
f05151d6f802
1.3 KiB
text/x-python
MAR-132: Added support for Debian 9 (Stretch) to wsgi_website role:
- Set the shell for application system account explicitly (workaround
for Debian bug 865762 in Stretch).
- Updated Molecule tests to cover Debian 9.
- Updated Molecule test preparation playbook to account for a number
of differences between Jessie and Stretch (mainly related to mailing
functionality).
- Renamed a couple of variables in test for sending out mails to make
it clearer what is being looked up as part of regex matching.
- Updated Molecule tests where certain paths depend on what Debian
release they are ran against.
- Split-up Jessie-specific tests into separate file.
- Remove the /bin/ss utility instead of renaming it (testinfra socket
tests do not work with /bin/ss).
- Set the shell for application system account explicitly (workaround
for Debian bug 865762 in Stretch).
- Updated Molecule tests to cover Debian 9.
- Updated Molecule test preparation playbook to account for a number
of differences between Jessie and Stretch (mainly related to mailing
functionality).
- Renamed a couple of variables in test for sending out mails to make
it clearer what is being looked up as part of regex matching.
- Updated Molecule tests where certain paths depend on what Debian
release they are ran against.
- Split-up Jessie-specific tests into separate file.
- Remove the /bin/ss utility instead of renaming it (testinfra socket
tests do not work with /bin/ss).
a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f a52f9fdabd0f | from collections import namedtuple
import pytest
@pytest.fixture
def php_info(host):
"""
Helper fixture used to define what the expected PHP-FPM package
name, PHP-FPM service name, and PHP base configuration directory
is based on Debian release.
Currently supports Debian 8 (Jessie), and Debian 9 (Stretch).
Resulting information can be accessed through returned named tuple
with the following properties:
- fpm_package (name of the PHP-FPM package)
- fpm_service (name of the PHP-FPM system service)
- base_config_dir (base configuration directory for PHP)
"""
PHPInfo = namedtuple('PHPInfo', 'fpm_package fpm_service base_config_dir')
ansible_facts = host.ansible("setup")["ansible_facts"]
ansible_distribution_release = ansible_facts['ansible_distribution_release']
if ansible_distribution_release == 'jessie':
info = PHPInfo(fpm_package='php5-fpm', fpm_service='php5-fpm', base_config_dir='/etc/php5')
elif ansible_distribution_release == 'stretch':
info = PHPInfo(fpm_package='php-fpm', fpm_service='php7.0-fpm', base_config_dir='/etc/php/7.0')
else:
raise Exception('The php_info pytest fixture does not support Debian release: %s' % ansible_distribution_release)
return info
|