Changeset - 72c8481f0498
[Not reviewed]
0 3 0
Branko Majic (branko) - 2 months ago 2025-01-22 15:42:12
branko@majic.rs
MAR-233: Add IPv6 connectivity tests for the xmpp_server role.
3 files changed with 21 insertions and 2 deletions:
0 comments (0 inline, 0 general) First comment
roles/xmpp_server/molecule/default/molecule.yml
Show inline comments
 
@@ -38,12 +38,17 @@ platforms:
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.21
 
        network_name: private_network
 
        type: static
 
      - auto_config: true
 
        ip: fd00::192:168:56:21
 
        network_name: private_network
 
        netmask: 116
 
        type: static
 

	
 
  - name: parameters-mandatory-bookworm
 
    groups:
 
      - parameters-mandatory
 
      - bookworm
 
    box: debian/bookworm64
 
@@ -51,12 +56,17 @@ platforms:
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.31
 
        network_name: private_network
 
        type: static
 
      - auto_config: true
 
        ip: fd00::192:168:56:31
 
        network_name: private_network
 
        netmask: 116
 
        type: static
 

	
 
  - name: parameters-optional-bookworm
 
    groups:
 
      - parameters-optional
 
      - bookworm
 
    box: debian/bookworm64
 
@@ -64,12 +74,17 @@ platforms:
 
    cpus: 1
 
    interfaces:
 
      - auto_config: true
 
        ip: 192.168.56.32
 
        network_name: private_network
 
        type: static
 
      - auto_config: true
 
        ip: fd00::192:168:56:32
 
        network_name: private_network
 
        netmask: 116
 
        type: static
 

	
 

	
 
provisioner:
 
  name: ansible
 
  playbooks:
 
    cleanup: cleanup.yml
roles/xmpp_server/molecule/default/prepare.yml
Show inline comments
 
@@ -90,12 +90,15 @@
 
        state: present
 
      with_dict:
 
        192.168.56.11: "ldap-server backup-server"
 
        192.168.56.21: "client-bookworm"
 
        192.168.56.31: "parameters-mandatory domain1 proxy.domain1 conference.domain1"
 
        192.168.56.32: "parameters-optional domain2 proxy.domain2 conference.domain2 domain3 proxy.domain3 conference.domain3"
 
        fd00::192:168:56:21: "client-bookworm"
 
        fd00::192:168:56:31: "parameters-mandatory domain1 proxy.domain1 conference.domain1"
 
        fd00::192:168:56:32: "parameters-optional domain2 proxy.domain2 conference.domain2 domain3 proxy.domain3 conference.domain3"
 

	
 
- name: Prepare, helpers
 
  hosts: clients
 
  become: true
 
  tasks:
 

	
roles/xmpp_server/molecule/default/tests/test_client.py
Show inline comments
 
@@ -8,20 +8,21 @@ import testinfra.utils.ansible_runner
 
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('clients')
 

	
 

	
 
@pytest.mark.parametrize('server', ['parameters-mandatory', 'parameters-optional'])
 
@pytest.mark.parametrize('port', [5222, 5223, 5000, 5269])
 
def test_connectivity(host, server, port):
 
@pytest.mark.parametrize('ip_protocol', [4, 6])
 
def test_connectivity(host, server, port, ip_protocol):
 
    """
 
    Tests connectivity to the XMPP server (ports that should be reachable).
 
    """
 

	
 
    with host.sudo():
 

	
 
        scan = host.run('nmap -p %s -oG - %s', str(port), server)
 
        scan = host.run('nmap -%s -p %s -oG - %s', str(ip_protocol), str(port), server)
 
        assert scan.rc == 0
 
        assert "Ports: %d/open/tcp//" % port in scan.stdout
 

	
 

	
 
@pytest.mark.parametrize("username, password, domain", [
 
    ["john.doe", "johnpassword", "domain1"],
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now