From ef7e95e22acfe0335f5e581a37180d59377c765a Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 21 Aug 2022 23:29:13 -0700 Subject: [PATCH] Fix end-to-end tests. --- borgmatic/config/schema.yaml | 2 +- tests/end-to-end/test_borgmatic.py | 5 +++-- tests/end-to-end/test_override.py | 8 +++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/borgmatic/config/schema.yaml b/borgmatic/config/schema.yaml index 806bcce..1729062 100644 --- a/borgmatic/config/schema.yaml +++ b/borgmatic/config/schema.yaml @@ -41,7 +41,7 @@ properties: service file to the ReadWritePaths list. example: - ssh://user@backupserver/./sourcehostname.borg - - ssh://user@backupserver/./{fqdn}" + - ssh://user@backupserver/./{fqdn} - /var/local/backups/local.borg working_directory: type: string diff --git a/tests/end-to-end/test_borgmatic.py b/tests/end-to-end/test_borgmatic.py index b84e33f..c2d1029 100644 --- a/tests/end-to-end/test_borgmatic.py +++ b/tests/end-to-end/test_borgmatic.py @@ -18,8 +18,9 @@ def generate_configuration(config_path, repository_path): config = ( open(config_path) .read() - .replace('user@backupserver:sourcehostname.borg', repository_path) - .replace('- user@backupserver:{fqdn}', '') + .replace('ssh://user@backupserver/./sourcehostname.borg', repository_path) + .replace('- ssh://user@backupserver/./{fqdn}', '') + .replace('- /var/local/backups/local.borg', '') .replace('- /home/user/path with spaces', '') .replace('- /home', '- {}'.format(config_path)) .replace('- /etc', '') diff --git a/tests/end-to-end/test_override.py b/tests/end-to-end/test_override.py index a1ddb2e..0a42018 100644 --- a/tests/end-to-end/test_override.py +++ b/tests/end-to-end/test_override.py @@ -16,8 +16,9 @@ def generate_configuration(config_path, repository_path): config = ( open(config_path) .read() - .replace('user@backupserver:sourcehostname.borg', repository_path) - .replace('- user@backupserver:{fqdn}', '') + .replace('ssh://user@backupserver/./sourcehostname.borg', repository_path) + .replace('- ssh://user@backupserver/./{fqdn}', '') + .replace('- /var/local/backups/local.borg', '') .replace('- /home/user/path with spaces', '') .replace('- /home', '- {}'.format(config_path)) .replace('- /etc', '') @@ -32,11 +33,8 @@ def generate_configuration(config_path, repository_path): def test_override_get_normalized(): temporary_directory = tempfile.mkdtemp() repository_path = os.path.join(temporary_directory, 'test.borg') - extract_path = os.path.join(temporary_directory, 'extract') original_working_directory = os.getcwd() - os.mkdir(extract_path) - os.chdir(extract_path) try: config_path = os.path.join(temporary_directory, 'test.yaml')