|
@@ -206,7 +206,9 @@ def test_create_archive_calls_borg_with_parameters():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -232,7 +234,9 @@ def test_create_archive_with_patterns_calls_borg_with_patterns():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(pattern_flags)
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create') + pattern_flags + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create') + pattern_flags + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -258,7 +262,9 @@ def test_create_archive_with_exclude_patterns_calls_borg_with_excludes():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(exclude_flags)
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create') + exclude_flags + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create') + exclude_flags + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -284,6 +290,7 @@ def test_create_archive_with_log_info_calls_borg_with_info_parameter():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--list', '--filter', 'AME-', '--info', '--stats') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
@@ -308,7 +315,9 @@ def test_create_archive_with_log_info_and_json_suppresses_most_borg_output():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS, output_log_level=None
|
|
|
+ ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=None,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
@@ -336,6 +345,7 @@ def test_create_archive_with_log_debug_calls_borg_with_debug_parameter():
|
|
|
('borg', 'create', '--list', '--filter', 'AME-', '--stats', '--debug', '--show-rc')
|
|
|
+ ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.DEBUG)
|
|
|
|
|
@@ -359,7 +369,9 @@ def test_create_archive_with_log_debug_and_json_suppresses_most_borg_output():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS, output_log_level=None
|
|
|
+ ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=None,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.DEBUG)
|
|
|
|
|
@@ -385,7 +397,9 @@ def test_create_archive_with_dry_run_calls_borg_with_dry_run_parameter():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--dry-run') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create', '--dry-run') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -414,6 +428,7 @@ def test_create_archive_with_dry_run_and_log_info_calls_borg_without_stats_param
|
|
|
('borg', 'create', '--list', '--filter', 'AME-', '--info', '--dry-run')
|
|
|
+ ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
@@ -443,6 +458,7 @@ def test_create_archive_with_dry_run_and_log_debug_calls_borg_without_stats_para
|
|
|
('borg', 'create', '--list', '--filter', 'AME-', '--debug', '--show-rc', '--dry-run')
|
|
|
+ ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.DEBUG)
|
|
|
|
|
@@ -468,6 +484,7 @@ def test_create_archive_with_checkpoint_interval_calls_borg_with_checkpoint_inte
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--checkpoint-interval', '600') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -492,6 +509,7 @@ def test_create_archive_with_chunker_params_calls_borg_with_chunker_params_param
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--chunker-params', '1,2,3,4') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -516,6 +534,7 @@ def test_create_archive_with_compression_calls_borg_with_compression_parameters(
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--compression', 'rle') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -540,6 +559,7 @@ def test_create_archive_with_remote_rate_limit_calls_borg_with_remote_ratelimit_
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--remote-ratelimit', '100') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -562,7 +582,9 @@ def test_create_archive_with_one_file_system_calls_borg_with_one_file_system_par
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--one-file-system') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create', '--one-file-system') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -586,7 +608,9 @@ def test_create_archive_with_numeric_owner_calls_borg_with_numeric_owner_paramet
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--numeric-owner') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create', '--numeric-owner') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -610,7 +634,9 @@ def test_create_archive_with_read_special_calls_borg_with_read_special_parameter
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--read-special') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create', '--read-special') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -635,7 +661,9 @@ def test_create_archive_with_option_true_calls_borg_without_corresponding_parame
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -662,6 +690,7 @@ def test_create_archive_with_option_false_calls_borg_with_corresponding_paramete
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--no' + option_name.replace('_', '')) + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -687,6 +716,7 @@ def test_create_archive_with_files_cache_calls_borg_with_files_cache_parameters(
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--files-cache', 'ctime,size') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -710,7 +740,9 @@ def test_create_archive_with_local_path_calls_borg_via_local_path():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg1', 'create') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg1', 'create') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -736,6 +768,7 @@ def test_create_archive_with_remote_path_calls_borg_with_remote_path_parameters(
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--remote-path', 'borg1') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -759,7 +792,9 @@ def test_create_archive_with_umask_calls_borg_with_umask_parameters():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--umask', '740') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create', '--umask', '740') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -782,7 +817,9 @@ def test_create_archive_with_lock_wait_calls_borg_with_lock_wait_parameters():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--lock-wait', '5') + ARCHIVE_WITH_PATHS, output_log_level=logging.INFO
|
|
|
+ ('borg', 'create', '--lock-wait', '5') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -805,7 +842,9 @@ def test_create_archive_with_stats_calls_borg_with_stats_parameter():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--stats') + ARCHIVE_WITH_PATHS, output_log_level=logging.WARNING
|
|
|
+ ('borg', 'create', '--stats') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.WARNING,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -829,7 +868,8 @@ def test_create_archive_with_progress_and_log_info_calls_borg_with_progress_para
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command_without_capture').with_args(
|
|
|
- ('borg', 'create', '--info', '--stats', '--progress') + ARCHIVE_WITH_PATHS
|
|
|
+ ('borg', 'create', '--info', '--stats', '--progress') + ARCHIVE_WITH_PATHS,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
@@ -854,7 +894,7 @@ def test_create_archive_with_progress_calls_borg_with_progress_parameter():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command_without_capture').with_args(
|
|
|
- ('borg', 'create', '--progress') + ARCHIVE_WITH_PATHS
|
|
|
+ ('borg', 'create', '--progress') + ARCHIVE_WITH_PATHS, error_on_warnings=False
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -878,7 +918,9 @@ def test_create_archive_with_json_calls_borg_with_json_parameter():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS, output_log_level=None
|
|
|
+ ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=None,
|
|
|
+ error_on_warnings=False,
|
|
|
).and_return('[]')
|
|
|
|
|
|
json_output = module.create_archive(
|
|
@@ -904,7 +946,9 @@ def test_create_archive_with_stats_and_json_calls_borg_without_stats_parameter()
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS, output_log_level=None
|
|
|
+ ('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=None,
|
|
|
+ error_on_warnings=False,
|
|
|
).and_return('[]')
|
|
|
|
|
|
json_output = module.create_archive(
|
|
@@ -933,6 +977,7 @@ def test_create_archive_with_source_directories_glob_expands():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return(['foo', 'food'])
|
|
|
|
|
@@ -958,6 +1003,7 @@ def test_create_archive_with_non_matching_source_directories_glob_passes_through
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo*'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return([])
|
|
|
|
|
@@ -983,6 +1029,7 @@ def test_create_archive_with_glob_calls_borg_with_expanded_directories():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -1005,7 +1052,9 @@ def test_create_archive_with_archive_name_format_calls_borg_with_archive_name():
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', 'repo::ARCHIVE_NAME', 'foo', 'bar'), output_log_level=logging.INFO
|
|
|
+ ('borg', 'create', 'repo::ARCHIVE_NAME', 'foo', 'bar'),
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -1030,6 +1079,7 @@ def test_create_archive_with_archive_name_format_accepts_borg_placeholders():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::Documents_{hostname}-{now}', 'foo', 'bar'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|