1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-07-16 07:14:15 +02:00

[Issue #246] added tests.exclude.ExcludeTest.test_exclude_temp_files

This commit is contained in:
Grigory Smolkin
2020-08-14 14:47:02 +03:00
parent 1d87d9ffdd
commit b7a4439433

View File

@ -8,6 +8,45 @@ module_name = 'exclude'
class ExcludeTest(ProbackupTest, unittest.TestCase): class ExcludeTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_exclude_temp_files(self):
"""
"""
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
set_replication=True,
initdb_params=['--data-checksums'],
pg_options={
'logging_collector': 'on',
'log_filename': 'postgresql.log'})
self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node)
node.slow_start()
oid = node.safe_psql(
'postgres',
"select oid from pg_database where datname = 'postgres'").rstrip()
file = os.path.join(node.data_dir, 'base', oid, 'pgsql_tmp7351.16')
with open(file, 'w') as f:
f.write("HELLO")
f.flush()
f.close
full_id = self.backup_node(
backup_dir, 'node', node, backup_type='full', options=['--stream'])
file = os.path.join(
backup_dir, 'backups', 'node', full_id,
'database', 'base', oid, 'pgsql_tmp7351.16')
self.assertFalse(os.path.exists(file))
# Clean after yourself
self.del_test_dir(module_name, fname)
# @unittest.skip("skip") # @unittest.skip("skip")
# @unittest.expectedFailure # @unittest.expectedFailure
def test_exclude_temp_tables(self): def test_exclude_temp_tables(self):