|
@@ -13,18 +13,18 @@ def test_run_arbitrary_borg_calls_borg_with_flags():
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'break-lock', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'break-lock', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['break-lock', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['break-lock', '::'],
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -34,11 +34,11 @@ def test_run_arbitrary_borg_with_log_info_calls_borg_with_info_flag():
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'break-lock', '--info', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'break-lock', '--info', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
insert_logging_mock(logging.INFO)
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
|
@@ -46,7 +46,7 @@ def test_run_arbitrary_borg_with_log_info_calls_borg_with_info_flag():
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['break-lock', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['break-lock', '::'],
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -56,11 +56,11 @@ def test_run_arbitrary_borg_with_log_debug_calls_borg_with_debug_flag():
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'break-lock', '--debug', '--show-rc', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'break-lock', '--debug', '--show-rc', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
insert_logging_mock(logging.DEBUG)
|
|
insert_logging_mock(logging.DEBUG)
|
|
|
|
|
|
@@ -68,7 +68,7 @@ def test_run_arbitrary_borg_with_log_debug_calls_borg_with_debug_flag():
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['break-lock', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['break-lock', '::'],
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -81,18 +81,18 @@ def test_run_arbitrary_borg_with_lock_wait_calls_borg_with_lock_wait_flags():
|
|
)
|
|
)
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'break-lock', '--lock-wait', '5', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'break-lock', '--lock-wait', '5', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config=storage_config,
|
|
storage_config=storage_config,
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['break-lock', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['break-lock', '::'],
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -102,18 +102,18 @@ def test_run_arbitrary_borg_with_archive_calls_borg_with_archive_flag():
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'break-lock', '$REPOSITORY::$ARCHIVE'),
|
|
|
|
|
|
+ ('borg', 'break-lock', '::$ARCHIVE'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': 'archive'},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': 'archive'},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['break-lock', '$REPOSITORY::$ARCHIVE'],
|
|
|
|
|
|
+ options=['break-lock', '::$ARCHIVE'],
|
|
archive='archive',
|
|
archive='archive',
|
|
)
|
|
)
|
|
|
|
|
|
@@ -124,18 +124,18 @@ def test_run_arbitrary_borg_with_local_path_calls_borg_via_local_path():
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg1', 'break-lock', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg1', 'break-lock', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg1',
|
|
borg_local_path='borg1',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['break-lock', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['break-lock', '::'],
|
|
local_path='borg1',
|
|
local_path='borg1',
|
|
)
|
|
)
|
|
|
|
|
|
@@ -148,18 +148,18 @@ def test_run_arbitrary_borg_with_remote_path_calls_borg_with_remote_path_flags()
|
|
).and_return(())
|
|
).and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'break-lock', '--remote-path', 'borg1', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'break-lock', '--remote-path', 'borg1', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['break-lock', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['break-lock', '::'],
|
|
remote_path='borg1',
|
|
remote_path='borg1',
|
|
)
|
|
)
|
|
|
|
|
|
@@ -170,18 +170,18 @@ def test_run_arbitrary_borg_passes_borg_specific_flags_to_borg():
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'list', '--progress', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'list', '--progress', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['list', '--progress', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['list', '--progress', '::'],
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -191,18 +191,18 @@ def test_run_arbitrary_borg_omits_dash_dash_in_flags_passed_to_borg():
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'break-lock', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'break-lock', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['--', 'break-lock', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['--', 'break-lock', '::'],
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -216,7 +216,7 @@ def test_run_arbitrary_borg_without_borg_specific_flags_does_not_raise():
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
|
|
|
|
module.run_arbitrary_borg(
|
|
module.run_arbitrary_borg(
|
|
@@ -233,11 +233,11 @@ def test_run_arbitrary_borg_passes_key_sub_command_to_borg_before_injected_flags
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'key', 'export', '--info', '$REPOSITORY'),
|
|
|
|
|
|
+ ('borg', 'key', 'export', '--info', '::'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
insert_logging_mock(logging.INFO)
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
|
@@ -245,7 +245,7 @@ def test_run_arbitrary_borg_passes_key_sub_command_to_borg_before_injected_flags
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['key', 'export', '$REPOSITORY'],
|
|
|
|
|
|
+ options=['key', 'export', '::'],
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -255,11 +255,11 @@ def test_run_arbitrary_borg_passes_debug_sub_command_to_borg_before_injected_fla
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.flags).should_receive('make_flags').and_return(())
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module.environment).should_receive('make_environment')
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'debug', 'dump-manifest', '--info', '$REPOSITORY', 'path'),
|
|
|
|
|
|
+ ('borg', 'debug', 'dump-manifest', '--info', '::', 'path'),
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
output_file=module.borgmatic.execute.DO_NOT_CAPTURE,
|
|
borg_local_path='borg',
|
|
borg_local_path='borg',
|
|
shell=True,
|
|
shell=True,
|
|
- extra_environment={'REPOSITORY': 'repo', 'ARCHIVE': ''},
|
|
|
|
|
|
+ extra_environment={'BORG_REPO': 'repo', 'ARCHIVE': ''},
|
|
)
|
|
)
|
|
insert_logging_mock(logging.INFO)
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
|
@@ -267,5 +267,5 @@ def test_run_arbitrary_borg_passes_debug_sub_command_to_borg_before_injected_fla
|
|
repository_path='repo',
|
|
repository_path='repo',
|
|
storage_config={},
|
|
storage_config={},
|
|
local_borg_version='1.2.3',
|
|
local_borg_version='1.2.3',
|
|
- options=['debug', 'dump-manifest', '$REPOSITORY', 'path'],
|
|
|
|
|
|
+ options=['debug', 'dump-manifest', '::', 'path'],
|
|
)
|
|
)
|