From 081fc8466e9db17235083f9e83fc858768385a06 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 28 Jan 2018 00:31:14 +0100 Subject: [PATCH] testinfra: remove some postfix tests duplicating Ansible The original is at install_files/ansible-base/roles/postfix/templates/main.cf --- testinfra/mon/test_postfix.py | 42 ----------------------------------- 1 file changed, 42 deletions(-) diff --git a/testinfra/mon/test_postfix.py b/testinfra/mon/test_postfix.py index 65ce4841cd..cb36f84006 100644 --- a/testinfra/mon/test_postfix.py +++ b/testinfra/mon/test_postfix.py @@ -25,48 +25,6 @@ def test_postfix_headers(File, header): assert re.search(regex, f.content, re.M) -@pytest.mark.parametrize('setting', [ - 'relayhost = [smtp.gmail.com]:587', - 'smtp_sasl_auth_enable = yes', - 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd', - 'smtp_sasl_security_options = noanonymous', - 'smtp_use_tls = yes', - 'smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache', - 'smtp_tls_security_level = secure', - 'smtp_tls_CApath = /etc/ssl/certs', - 'smtp_tls_ciphers = high', - 'smtp_tls_protocols = TLSv1.2 TLSv1.1 TLSv1 !SSLv3 !SSLv2', - 'myhostname = ossec.server', - 'myorigin = $myhostname', - 'smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)', - 'biff = no', - 'append_dot_mydomain = no', - 'readme_directory = no', - 'smtp_header_checks = regexp:/etc/postfix/header_checks', - 'mailbox_command = /usr/bin/procmail', - 'inet_interfaces = loopback-only', - 'alias_maps = hash:/etc/aliases', - 'alias_database = hash:/etc/aliases', - 'mydestination = $myhostname, localhost.localdomain , localhost', - 'mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128', - 'mailbox_size_limit = 0', - 'recipient_delimiter = +', -]) -def test_postfix_settings(File, setting): - """ - Check all postfix configuration lines. There are technically multiple - configuration paths regarding the TLS settings, particularly the - fingerprint verification logic, but only the base default config is tested - currently. - """ - f = File("/etc/postfix/main.cf") - assert f.is_file - assert f.user == 'root' - assert oct(f.mode) == "0644" - regex = '^{}$'.format(re.escape(setting)) - assert re.search(regex, f.content, re.M) - - def test_postfix_generic_maps(File): """ Regression test to check that generic Postfix maps are not configured