|
@@ -29,7 +29,7 @@ def test_dump_databases_runs_pg_dump_for_each_database():
|
|
|
'databases/localhost/{}'.format(name),
|
|
|
),
|
|
|
shell=True,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
run_to_completion=False,
|
|
|
).and_return(process).once()
|
|
|
|
|
@@ -74,7 +74,7 @@ def test_dump_databases_runs_pg_dump_with_hostname_and_port():
|
|
|
'databases/database.example.org/foo',
|
|
|
),
|
|
|
shell=True,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
run_to_completion=False,
|
|
|
).and_return(process).once()
|
|
|
|
|
@@ -105,7 +105,7 @@ def test_dump_databases_runs_pg_dump_with_username_and_password():
|
|
|
'databases/localhost/foo',
|
|
|
),
|
|
|
shell=True,
|
|
|
- extra_environment={'PGPASSWORD': 'trustsome1'},
|
|
|
+ extra_environment={'PGPASSWORD': 'trustsome1', 'PGSSLMODE': 'disable'},
|
|
|
run_to_completion=False,
|
|
|
).and_return(process).once()
|
|
|
|
|
@@ -135,7 +135,7 @@ def test_dump_databases_runs_pg_dump_with_directory_format():
|
|
|
'foo',
|
|
|
),
|
|
|
shell=True,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
run_to_completion=False,
|
|
|
).and_return(process).once()
|
|
|
|
|
@@ -165,7 +165,7 @@ def test_dump_databases_runs_pg_dump_with_options():
|
|
|
'databases/localhost/foo',
|
|
|
),
|
|
|
shell=True,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
run_to_completion=False,
|
|
|
).and_return(process).once()
|
|
|
|
|
@@ -184,7 +184,7 @@ def test_dump_databases_runs_pg_dumpall_for_all_databases():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('pg_dumpall', '--no-password', '--clean', '--if-exists', '>', 'databases/localhost/all'),
|
|
|
shell=True,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
run_to_completion=False,
|
|
|
).and_return(process).once()
|
|
|
|
|
@@ -210,12 +210,12 @@ def test_restore_database_dump_runs_pg_restore():
|
|
|
processes=[extract_process],
|
|
|
output_log_level=logging.DEBUG,
|
|
|
input_file=extract_process.stdout,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
borg_local_path='borg',
|
|
|
).once()
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('psql', '--no-password', '--quiet', '--dbname', 'foo', '--command', 'ANALYZE'),
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
).once()
|
|
|
|
|
|
module.restore_database_dump(
|
|
@@ -260,7 +260,7 @@ def test_restore_database_dump_runs_pg_restore_with_hostname_and_port():
|
|
|
processes=[extract_process],
|
|
|
output_log_level=logging.DEBUG,
|
|
|
input_file=extract_process.stdout,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
borg_local_path='borg',
|
|
|
).once()
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
@@ -277,7 +277,7 @@ def test_restore_database_dump_runs_pg_restore_with_hostname_and_port():
|
|
|
'--command',
|
|
|
'ANALYZE',
|
|
|
),
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
).once()
|
|
|
|
|
|
module.restore_database_dump(
|
|
@@ -306,7 +306,7 @@ def test_restore_database_dump_runs_pg_restore_with_username_and_password():
|
|
|
processes=[extract_process],
|
|
|
output_log_level=logging.DEBUG,
|
|
|
input_file=extract_process.stdout,
|
|
|
- extra_environment={'PGPASSWORD': 'trustsome1'},
|
|
|
+ extra_environment={'PGPASSWORD': 'trustsome1', 'PGSSLMODE': 'disable'},
|
|
|
borg_local_path='borg',
|
|
|
).once()
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
@@ -321,7 +321,7 @@ def test_restore_database_dump_runs_pg_restore_with_username_and_password():
|
|
|
'--command',
|
|
|
'ANALYZE',
|
|
|
),
|
|
|
- extra_environment={'PGPASSWORD': 'trustsome1'},
|
|
|
+ extra_environment={'PGPASSWORD': 'trustsome1', 'PGSSLMODE': 'disable'},
|
|
|
).once()
|
|
|
|
|
|
module.restore_database_dump(
|
|
@@ -340,11 +340,11 @@ def test_restore_database_dump_runs_psql_for_all_database_dump():
|
|
|
processes=[extract_process],
|
|
|
output_log_level=logging.DEBUG,
|
|
|
input_file=extract_process.stdout,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
borg_local_path='borg',
|
|
|
).once()
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('psql', '--no-password', '--quiet', '--command', 'ANALYZE'), extra_environment=None
|
|
|
+ ('psql', '--no-password', '--quiet', '--command', 'ANALYZE'), extra_environment={'PGSSLMODE': 'disable'}
|
|
|
).once()
|
|
|
|
|
|
module.restore_database_dump(
|
|
@@ -383,12 +383,12 @@ def test_restore_database_dump_without_extract_process_restores_from_disk():
|
|
|
processes=[],
|
|
|
output_log_level=logging.DEBUG,
|
|
|
input_file=None,
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
borg_local_path='borg',
|
|
|
).once()
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('psql', '--no-password', '--quiet', '--dbname', 'foo', '--command', 'ANALYZE'),
|
|
|
- extra_environment=None,
|
|
|
+ extra_environment={'PGSSLMODE': 'disable'},
|
|
|
).once()
|
|
|
|
|
|
module.restore_database_dump(
|