mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2026-06-21 01:34:15 +02:00
tests: added truncate_every_file_in_dir
This commit is contained in:
@@ -584,6 +584,12 @@ class ProbackupTest(object):
|
||||
|
||||
return filelist_diff
|
||||
|
||||
# used for partial restore
|
||||
def truncate_every_file_in_dir(self, path):
|
||||
for file in os.listdir(path):
|
||||
with open(os.path.join(path, file), "w") as f:
|
||||
f.close()
|
||||
|
||||
def check_ptrack_recovery(self, idx_dict):
|
||||
size = idx_dict['size']
|
||||
for PageNum in range(size):
|
||||
@@ -734,20 +740,24 @@ class ProbackupTest(object):
|
||||
|
||||
def backup_node(
|
||||
self, backup_dir, instance, node, data_dir=False,
|
||||
backup_type='full', options=[], asynchronous=False, gdb=False,
|
||||
backup_type='full', datname=False, options=[],
|
||||
asynchronous=False, gdb=False,
|
||||
old_binary=False, return_id=True
|
||||
):
|
||||
if not node and not data_dir:
|
||||
print('You must provide ether node or data_dir for backup')
|
||||
exit(1)
|
||||
|
||||
if not datname:
|
||||
datname = 'postgres'
|
||||
|
||||
cmd_list = [
|
||||
'backup',
|
||||
'-B', backup_dir,
|
||||
'--instance={0}'.format(instance),
|
||||
# "-D", pgdata,
|
||||
'-p', '%i' % node.port,
|
||||
'-d', 'postgres'
|
||||
'-d', datname
|
||||
]
|
||||
|
||||
if data_dir:
|
||||
|
||||
Reference in New Issue
Block a user