Loading defaults/main.yml +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ php_fpm_www_pool_config: pm.start_servers: 2 pm.min_spare_servers: 1 pm.max_spare_servers: 3 pm.status_path: /status ping.path: /ping pm.status_path: /status.php ping.path: /ping.php chdir: / chroot: '{{ php_fpm_chroot[ansible_os_family]|default(None) }}' tests/test_php-fpm.py +19 −14 Original line number Diff line number Diff line from testinfra.utils.ansible_runner import AnsibleRunner import json testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') def test_php_fpm_service(Service, SystemInfo, File): def test_php_fpm_service(Service, SystemInfo, File, Sudo): if SystemInfo.type == 'openbsd': service = Service('php56_fpm') socket = File('/var/www/run/php-fpm.sock') user = 'www' elif SystemInfo.type == 'linux' and SystemInfo.distribution in ['debian', 'ubuntu']: elif SystemInfo.type == 'linux' and SystemInfo.distribution in [ 'debian', 'ubuntu' ]: service = Service('php5-fpm') socket = File('/var/run/php5-fpm.sock') user = 'www-data' with Sudo(): assert socket.is_socket assert socket.mode == 0o0660 assert socket.user == user Loading Loading @@ -40,8 +43,10 @@ def test_php_fpm_config(Command, Sudo, SystemInfo): def test_php_fpm_status(Command): assert 'PHP version 5' in Command( 'curl http://localhost/status.php').stdout status = json.loads( Command('curl http://localhost/status.php?json').stdout) assert status['pool'] == 'www' assert status['process manager'] == 'dynamic' def test_php_fpm_ping(Command): Loading Loading
defaults/main.yml +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ php_fpm_www_pool_config: pm.start_servers: 2 pm.min_spare_servers: 1 pm.max_spare_servers: 3 pm.status_path: /status ping.path: /ping pm.status_path: /status.php ping.path: /ping.php chdir: / chroot: '{{ php_fpm_chroot[ansible_os_family]|default(None) }}'
tests/test_php-fpm.py +19 −14 Original line number Diff line number Diff line from testinfra.utils.ansible_runner import AnsibleRunner import json testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') def test_php_fpm_service(Service, SystemInfo, File): def test_php_fpm_service(Service, SystemInfo, File, Sudo): if SystemInfo.type == 'openbsd': service = Service('php56_fpm') socket = File('/var/www/run/php-fpm.sock') user = 'www' elif SystemInfo.type == 'linux' and SystemInfo.distribution in ['debian', 'ubuntu']: elif SystemInfo.type == 'linux' and SystemInfo.distribution in [ 'debian', 'ubuntu' ]: service = Service('php5-fpm') socket = File('/var/run/php5-fpm.sock') user = 'www-data' with Sudo(): assert socket.is_socket assert socket.mode == 0o0660 assert socket.user == user Loading Loading @@ -40,8 +43,10 @@ def test_php_fpm_config(Command, Sudo, SystemInfo): def test_php_fpm_status(Command): assert 'PHP version 5' in Command( 'curl http://localhost/status.php').stdout status = json.loads( Command('curl http://localhost/status.php?json').stdout) assert status['pool'] == 'www' assert status['process manager'] == 'dynamic' def test_php_fpm_ping(Command): Loading