Changeset - 619c33cd4857
[Not reviewed]
0 3 0
Branko Majic (branko) - 4 years ago 2020-01-06 14:30:03
branko@majic.rs
MAR-148: Fix backup_client tests related to file content comparison (trailing newline handling).
3 files changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
roles/backup_client/molecule/default/tests/test_default.py
Show inline comments
 
@@ -171,7 +171,7 @@ def test_cron_entry(host):
 
    assert cron.user == 'root'
 
    assert cron.group == 'root'
 
    assert cron.mode == 0o644
 
    assert cron.content == "#Ansible: backup\n0 2 * * * root /usr/bin/duply main backup"
 
    assert cron.content == "#Ansible: backup\n0 2 * * * root /usr/bin/duply main backup\n"
 

	
 

	
 
def test_duply_include_file(host):
roles/backup_client/molecule/default/tests/test_parameters_mandatory.py
Show inline comments
 
@@ -16,7 +16,9 @@ def test_gnupg_private_keys_file_content(host):
 
    with host.sudo():
 
        gnupg_private_keys = host.file('/etc/duply/main/private_keys.asc')
 

	
 
        assert gnupg_private_keys.content == open('tests/data/gnupg/parameters-mandatory.asc', 'r').read().strip()
 
        # The rstrip() is added because Ansible strips last newline
 
        # when using the file lookup plugin.
 
        assert gnupg_private_keys.content == open('tests/data/gnupg/parameters-mandatory.asc', 'r').read().rstrip()
 

	
 

	
 
def test_gnupg_public_keys_file_content(host):
 
@@ -40,7 +42,7 @@ def test_backup_ssh_key_file_content(host):
 

	
 
        ssh_key = host.file('/etc/duply/main/ssh/identity')
 

	
 
        assert ssh_key.content == open('tests/data/ssh/parameters-mandatory', 'r').read().strip()
 
        assert ssh_key.content == open('tests/data/ssh/parameters-mandatory', 'r').read()
 

	
 

	
 
def test_known_hosts_content(host):
 
@@ -52,7 +54,7 @@ def test_known_hosts_content(host):
 

	
 
        known_hosts = host.file('/etc/duply/main/ssh/known_hosts')
 

	
 
        assert known_hosts.content == open('tests/data/ssh/parameters-mandatory-known_hosts', 'r').read().rstrip()
 
        assert known_hosts.content == open('tests/data/ssh/parameters-mandatory-known_hosts', 'r').read()
 

	
 

	
 
def test_duply_configuration_content(host):
roles/backup_client/molecule/default/tests/test_parameters_optional.py
Show inline comments
 
@@ -53,7 +53,7 @@ def test_known_hosts_content(host):
 

	
 
        known_hosts = host.file('/etc/duply/main/ssh/known_hosts')
 

	
 
        assert known_hosts.content == open('tests/data/ssh/parameters-optional-known_hosts', 'r').read().rstrip()
 
        assert known_hosts.content == open('tests/data/ssh/parameters-optional-known_hosts', 'r').read()
 

	
 

	
 
def test_duply_configuration_content(host):
0 comments (0 inline, 0 general)