Changeset - d075c64c765d
[Not reviewed]
0 5 0
Branko Majic (branko) - 4 years ago 2020-05-05 23:49:00
branko@majic.rs
MAR-152: Drop support for Debian 8 Jessie from the mail_forwader role.
5 files changed with 2 insertions and 72 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -1308,13 +1308,12 @@ Parameters
 

	
 
Distribution compatibility
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
Role is compatible with the following distributions:
 

	
 
- Debian 8 (Jessie)
 
- Debian 9 (Stretch)
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
roles/mail_forwarder/molecule/default/molecule.yml
Show inline comments
 
@@ -14,69 +14,33 @@ lint:
 

	
 
platforms:
 

	
 
  - name: mail-server
 
    groups:
 
      - mail-servers
 
    box: debian/contrib-jessie64
 
    box: debian/contrib-stretch64
 
    memory: 256
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 10.31.127.10
 
        network_name: private_network
 
        type: static
 

	
 
  - name: client1
 
    groups:
 
      - clients
 
    box: debian/contrib-jessie64
 
    box: debian/contrib-stretch64
 
    memory: 256
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 10.31.127.11
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-mandatory-jessie64
 
    groups:
 
      - parameters-mandatory
 
    box: debian/contrib-jessie64
 
    memory: 256
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 10.31.127.20
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-optional-jessie64
 
    groups:
 
      - parameters-optional
 
    box: debian/contrib-jessie64
 
    memory: 256
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 10.31.127.21
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-no-incoming-jessie64
 
    groups:
 
      - parameters-no-incoming
 
    box: debian/contrib-jessie64
 
    memory: 256
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 10.31.127.22
 
        network_name: private_network
 
        type: static
 

	
 
  - name: parameters-mandatory-stretch64
 
    groups:
 
      - parameters-mandatory
 
    box: debian/contrib-stretch64
 
    memory: 256
 
    cpus: 1
roles/mail_forwarder/molecule/default/prepare.yml
Show inline comments
 
@@ -31,15 +31,12 @@
 
        group: root
 
        mode: 0644
 
        state: present
 
      with_dict:
 
        10.31.127.10: "mail-server domain1"
 
        10.31.127.11: "client1"
 
        10.31.127.20: "parameters-mandatory-jessie64"
 
        10.31.127.21: "parameters-optional-jessie64"
 
        10.31.127.22: "parameters-no-incoming-jessie64"
 
        10.31.127.30: "parameters-mandatory-stretch64"
 
        10.31.127.31: "parameters-optional-stretch64"
 
        10.31.127.32: "parameters-no-incoming-stretch64"
 

	
 
- hosts: clients
 
  become: true
roles/mail_forwarder/molecule/default/tests/test_connectivity_from_client.py
Show inline comments
 
@@ -12,24 +12,12 @@ def test_connectivity_from_client(host):
 
    Tests connectivity towards mail forwarder servers from client
 
    (non-relay). Connectivity should fail for both.
 
    """
 

	
 
    with host.sudo():
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-mandatory-jessie64')
 
        assert ping.rc != 0
 
        assert "100% packet loss" in ping.stderr
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-optional-jessie64')
 
        assert ping.rc != 0
 
        assert "100% packet loss" in ping.stderr
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-no-incoming-jessie64')
 
        assert "100% packet loss" in ping.stderr
 
        assert ping.rc != 0
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-mandatory-stretch64')
 
        assert ping.rc != 0
 
        assert "100% packet loss" in ping.stderr
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-optional-stretch64')
 
        assert ping.rc != 0
roles/mail_forwarder/molecule/default/tests/test_connectivity_from_relay.py
Show inline comments
 
@@ -12,23 +12,12 @@ def test_connectivity_from_relay(host):
 
    Tests connectivity towards mail forwarder servers from relay. Connection
 
    towards parameters-mandatory should fail.
 
    """
 

	
 
    with host.sudo():
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-mandatory-jessie64')
 
        assert ping.rc != 0
 
        assert "100% packet loss" in ping.stderr
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-optional-jessie64')
 
        assert ping.rc == 0
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-no-incoming-jessie64')
 
        assert "100% packet loss" in ping.stderr
 
        assert ping.rc != 0
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-mandatory-stretch64')
 
        assert ping.rc != 0
 
        assert "100% packet loss" in ping.stderr
 

	
 
        ping = host.run('hping3 -S -p 25 -c 1 parameters-optional-stretch64')
 
        assert ping.rc == 0
 
@@ -41,27 +30,20 @@ def test_connectivity_from_relay(host):
 
def test_mail_reception_from_relay(host):
 
    """
 
    Tests if mails can be sent from relay to servers configured to use the
 
    relay.
 
    """
 

	
 
    send = host.run('swaks --suppress-data --to root@parameters-optional-jessie64 --server parameters-optional-jessie64')
 
    assert send.rc == 0
 

	
 
    send = host.run('swaks --suppress-data --to root@parameters-optional-stretch64 --server parameters-optional-stretch64')
 
    assert send.rc == 0
 

	
 

	
 
def test_open_relay(host):
 
    """
 
    Tests if mail forwarder behaves as open relay.
 
    """
 

	
 
    no_recipients_accepted = 24
 

	
 
    send = host.run('swaks --suppress-data --to root@client1 --server parameters-optional-jessie64')
 
    assert send.rc == no_recipients_accepted
 
    assert "Relay access denied" in send.stdout
 

	
 
    send = host.run('swaks --suppress-data --to root@client1 --server parameters-optional-stretch64')
 
    assert send.rc == no_recipients_accepted
 
    assert "Relay access denied" in send.stdout
0 comments (0 inline, 0 general)