Changeset - 6c1d08d39449
roles/common/molecule/default/tests/test_default.py
Show inline comments
 
@@ -20,8 +20,8 @@ def test_pam_umask(host):
 
    assert pam_auth_update_config.group == 'root'
 
    assert pam_auth_update_config.mode == 0o644
 

	
 
    assert host.file('/etc/pam.d/common-session').contains('session[[:blank:]]\+required[[:blank:]]\+pam_umask.so')
 
    assert host.file('/etc/pam.d/common-session-noninteractive').contains('session[[:blank:]]\+required[[:blank:]]\+pam_umask.so')
 
    assert host.file('/etc/pam.d/common-session').contains(r'session[[:blank:]]\+required[[:blank:]]\+pam_umask.so')
 
    assert host.file('/etc/pam.d/common-session-noninteractive').contains(r'session[[:blank:]]\+required[[:blank:]]\+pam_umask.so')
 

	
 

	
 
def test_login_umask(host):
 
@@ -29,7 +29,7 @@ def test_login_umask(host):
 
    Tests set-up of default UMASK via /etc/login.defs.
 
    """
 

	
 
    assert host.file('/etc/login.defs').contains('UMASK[[:blank:]]\+027')
 
    assert host.file('/etc/login.defs').contains(r'UMASK[[:blank:]]\+027')
 

	
 

	
 
def test_adduser_umask(host):
roles/common/molecule/default/tests/test_parameters_optional.py
Show inline comments
 
@@ -318,7 +318,7 @@ def test_ntp_server_configuration(host):
 

	
 
        # Extract only the relevant sections of files (exculde empty
 
        # lines and comments).
 
        configuration = [c.strip() for c in configuration if re.match('^\s*(|#.*)$', c) is None]
 
        configuration = [c.strip() for c in configuration if re.match(r'^\s*(|#.*)$', c) is None]
 

	
 
        # Ensure correct servers have been configured in the pool.
 
        servers = [c for c in configuration if c.startswith('server')]
roles/mail_forwarder/molecule/default/tests/test_mandatory.py
Show inline comments
 
@@ -65,6 +65,6 @@ def test_direct_mail_sending(host):
 
    with host.sudo():
 
        mail_log = host.file('/var/log/mail.log')
 
        # Pattern used to verify the mail was sent directly on default port.
 
        pattern = "%s: to=<root@domain1>, relay=domain1\[[^]]*\]:25.*status=sent" % message_id
 
        pattern = r"%s: to=<root@domain1>, relay=domain1\[[^]]*\]:25.*status=sent" % message_id
 

	
 
        assert re.search(pattern, mail_log.content) is not None
roles/mail_forwarder/molecule/default/tests/test_optional.py
Show inline comments
 
@@ -123,6 +123,6 @@ def test_tls_enforced_towards_relay_mail_server(host):
 

	
 
        with host.sudo():
 
            mail_log = host.file('/var/log/mail.log')
 
            pattern = "%s: to=<root@domain1>, relay=domain1.*status=deferred \(Server certificate not verified\)" % message_id
 
            pattern = r"%s: to=<root@domain1>, relay=domain1.*status=deferred \(Server certificate not verified\)" % message_id
 

	
 
            assert re.search(pattern, mail_log.content) is not None
roles/mail_server/molecule/default/tests/test_client2.py
Show inline comments
 
@@ -178,8 +178,8 @@ def test_dovecot_inbox_separator(host):
 
    Tests if inbox separator has been configured correctly.
 
    """
 

	
 
    pattern_slash_separator = re.compile('WARNING:imap-cli:Ignoring "LIST" response part : \([^)]*\) "/" INBOX')
 
    pattern_dot_separator = re.compile('WARNING:imap-cli:Ignoring "LIST" response part : \([^)]*\) "\." INBOX')
 
    pattern_slash_separator = re.compile(r'WARNING:imap-cli:Ignoring "LIST" response part : \([^)]*\) "/" INBOX')
 
    pattern_dot_separator = re.compile(r'WARNING:imap-cli:Ignoring "LIST" response part : \([^)]*\) "\." INBOX')
 

	
 
    status = host.run("imapcli status -c ~/imapcli-parameters-mandatory-john_doe.conf")
 
    assert pattern_slash_separator.search(status.stdout) is not None
roles/mail_server/molecule/default/tests/test_default.py
Show inline comments
 
@@ -70,7 +70,7 @@ def test_clamav_milter(host):
 

	
 
    server_did_not_accept_mail = 26
 

	
 
    eicar = 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
 
    eicar = 'X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
 

	
 
    send_mail = host.run("swaks --to john.doe@domain1 --server localhost --attach '%s'" % eicar)
 

	
 
@@ -242,7 +242,7 @@ def test_postfix_delivery_to_dovecot(host):
 

	
 
    with host.sudo():
 
        mail_log = host.file('/var/log/mail.log')
 
        pattern = "dovecot: lda\(john.doe@domain1\): msgid=<%s>: saved mail to INBOX" % message_id
 
        pattern = r"dovecot: lda\(john.doe@domain1\): msgid=<%s>: saved mail to INBOX" % message_id
 
        assert re.search(pattern, mail_log.content) is not None
 

	
 

	
roles/mail_server/molecule/default/tests/test_optional.py
Show inline comments
 
@@ -121,7 +121,7 @@ def test_local_aliases(host):
 

	
 
    with host.sudo():
 
        mail_log = host.file('/var/log/mail.log')
 
        pattern = "dovecot: lda\(john.doe@domain1\): msgid=<%s>: saved mail to INBOX" % message_id
 
        pattern = r"dovecot: lda\(john.doe@domain1\): msgid=<%s>: saved mail to INBOX" % message_id
 
        assert re.search(pattern, mail_log.content) is not None
 

	
 

	
roles/php_website/molecule/default/tests/test_parameters_mandatory.py
Show inline comments
 
@@ -124,7 +124,7 @@ def test_mail_forwarding(host):
 
        mail_log = host.file('/var/log/mail.log')
 

	
 
        # First extract message ID of forwarded mail.
 
        pattern = "%s: to=<web-parameters-mandatory@localhost>.*status=sent \(forwarded as ([^)]*)\)" % original_queue_id
 
        pattern = r"%s: to=<web-parameters-mandatory@localhost>.*status=sent \(forwarded as ([^)]*)\)" % original_queue_id
 
        forward_queue_id = re.search(pattern, mail_log.content).group(1)
 

	
 
        # Now try to determine where the forward ended-up at.
roles/php_website/molecule/default/tests/test_parameters_optional.py
Show inline comments
 
@@ -124,7 +124,7 @@ def test_mail_forwarding(host):
 
        mail_log = host.file('/var/log/mail.log')
 

	
 
        # First extract message ID of forwarded mail.
 
        pattern = "%s: to=<web-parameters-optional_local@localhost>.*status=sent \(forwarded as ([^)]*)\)" % message_id
 
        pattern = r"%s: to=<web-parameters-optional_local@localhost>.*status=sent \(forwarded as ([^)]*)\)" % message_id
 
        message_id = re.search(pattern, mail_log.content).group(1)
 

	
 
        # Now try to determine where the forward ended-up at.
roles/wsgi_website/molecule/default/tests/test_default.py
Show inline comments
 
@@ -219,7 +219,7 @@ def test_mail_forwarding(host, original_destination, expected_destination_user):
 
        mail_log = host.file('/var/log/mail.log')
 

	
 
        # First extract message ID of forwarded mail.
 
        pattern = "%s: to=<%s>.*status=sent \(forwarded as ([^)]*)\)" % (original_queue_id, original_destination)
 
        pattern = r"%s: to=<%s>.*status=sent \(forwarded as ([^)]*)\)" % (original_queue_id, original_destination)
 
        forward_queue_id = re.search(pattern, mail_log.content).group(1)
 

	
 
        # Now try to determine where the forward ended-up at.
0 comments (0 inline, 0 general)