File diff d8ba2419467c → 776dde4d751e
roles/mail_forwarder/molecule/default/tests/test_default.py
Show inline comments
 
import os
 
import re
 

	
 
import testinfra.utils.ansible_runner
 

	
 
@@ -64,6 +65,22 @@ def test_postfix_main_cf_file(host):
 
    assert config.mode == 0o644
 

	
 

	
 
def test_postfix_main_configuration_is_valid(host):
 
    """
 
    Tests if Postfix main configuration is valid and not producing any
 
    warnings.
 
    """
 

	
 
    postconf = host.run('/usr/sbin/postconf')
 

	
 
    # Clean-up the SSH warning from the beginning of stderr if
 
    # present.
 
    stderr = re.sub("^Warning: Permanently added.*?\r\n", "", postconf.stderr)
 

	
 
    assert postconf.rc == 0
 
    assert stderr == ""
 

	
 

	
 
def test_services(host):
 
    """
 
    Tests if all the necessary services are enabled and running.