Files
@ 114f02e67a4d
Branch filter:
Location: majic-ansible-roles/roles/php_website/molecule/default/tests/test_default.py - annotation
114f02e67a4d
832 B
text/x-python
MAR-173: Switch to using Prosody 0.11 as default version in the xmpp_server role:
- Updated default value for the Prosody package parameters.
- Configure the backports repository on the server, and pin the
lua-ldap package to be installed from the backports
repository (needed for Lua 5.2 support).
- Drop the explicit installation of lua-sec library - it is already
installed as pre-requisite for the Prosody package.
- Updated default value for the Prosody package parameters.
- Configure the backports repository on the server, and pin the
lua-ldap package to be installed from the backports
repository (needed for Lua 5.2 support).
- Drop the explicit installation of lua-sec library - it is already
installed as pre-requisite for the Prosody package.
14eb78a4f466 14eb78a4f466 5b102c4afcb3 5b102c4afcb3 1b6495e2ba42 1b6495e2ba42 3dd7f39302f8 1b6495e2ba42 d62b3adec462 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 5b102c4afcb3 | import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('fqdn', [
'parameters-mandatory',
'parameters-optional.local',
])
def test_https_enforcement(host, fqdn):
"""
Tests if HTTPS is being enforced.
"""
https_enforcement = host.run('curl -I http://%s/', fqdn)
assert https_enforcement.rc == 0
assert 'HTTP/1.1 301 Moved Permanently' in https_enforcement.stdout
assert 'Location: https://%s/' % fqdn in https_enforcement.stdout
https_enforcement = host.run('curl -I https://%s/', fqdn)
assert https_enforcement.rc == 0
assert 'Strict-Transport-Security: max-age=31536000; includeSubDomains' in https_enforcement.stdout
|