File diff c1abe824342c → 3c51248b600c
roles/xmpp_server/molecule/default/tests/test_backup.py
Show inline comments
 
@@ -12,15 +12,30 @@ def test_backup(host):
 
    Tests if Prosody data directory is correctly backed-up.
 
    """
 

	
 
    # Deliver a couple of messages in order to make sure the directory structure
 
    # is created.
 
    send = host.run("echo 'Hello' | sendxmpp --tls-ca-path /usr/local/share/ca-certificates/testca.crt "
 
                    "-t -u jane.doe -p janepassword -j domain2:5222 jane.doe@domain2")
 
    assert send.rc == 0
 

	
 
    send = host.run("echo 'Hello' | sendxmpp --tls-ca-path /usr/local/share/ca-certificates/testca.crt "
 
                    "-t -u mick.doe -p mickpassword -j domain3:5222 mick.doe@domain3")
 
    assert send.rc == 0
 
    distribution_release = host.ansible("setup")["ansible_facts"]["ansible_distribution_release"]
 

	
 
    # Ugly, but functional for now.
 
    if distribution_release == "bullseye":
 
        # Deliver a couple of messages in order to make sure the directory structure
 
        # is created.
 
        send = host.run("echo 'Hello' | sendxmpp --tls-ca-path /usr/local/share/ca-certificates/testca.crt "
 
                        "-t -u jane.doe -p janepassword -j domain2:5222 jane.doe@domain2")
 
        assert send.rc == 0
 

	
 
        send = host.run("echo 'Hello' | sendxmpp --tls-ca-path /usr/local/share/ca-certificates/testca.crt "
 
                        "-t -u mick.doe -p mickpassword -j domain3:5222 mick.doe@domain3")
 
        assert send.rc == 0
 
    else:
 
        send = host.run(f"echo 'Hello' | go-sendxmpp --debug "
 
                        f"--username jane.doe@domain2 --password janepassword --jserver domain2:5222 "
 
                        f"jane.doe@domain2")
 
        assert send.rc == 0
 

	
 
        send = host.run(f"echo 'Hello' | go-sendxmpp --debug "
 
                        f"--username mick.doe@domain3 --password mickpassword --jserver domain3:5222 "
 
                        f"mick.doe@domain3")
 
        assert send.rc == 0
 

	
 

	
 
    with host.sudo():