1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-26 22:20:10 +02:00

tests: minor fixes for Windows

This commit is contained in:
Grigory Smolkin 2019-04-30 00:30:25 +03:00
parent a71288249e
commit 091b7c6e4b
2 changed files with 20 additions and 15 deletions

View File

@ -296,9 +296,11 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
wals_dir = os.path.join(backup_dir, 'wal', 'node')
if self.archive_compress:
file = os.path.join(wals_dir, '000000010000000000000001.gz')
filename = '000000010000000000000001.gz'
file = os.path.join(wals_dir, filename)
else:
file = os.path.join(wals_dir, '000000010000000000000001')
filename = '000000010000000000000001'
file = os.path.join(wals_dir, filename)
with open(file, 'a') as f:
f.write(b"blablablaadssaaaaaaaaaaaaaaa")
@ -319,7 +321,8 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
'LOG: archive command failed with exit code 1' in log_content and
'DETAIL: The failed archive command was:' in log_content and
'INFO: pg_probackup archive-push from' in log_content and
'ERROR: WAL segment "{0}" already exists.'.format(file) in log_content,
'ERROR: WAL segment ' in log_content and
'{0}" already exists.'.format(filename) in log_content,
'Expecting error messages about failed archive_command'
)
self.assertFalse('pg_probackup archive-push completed successfully' in log_content)
@ -369,9 +372,11 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
wals_dir = os.path.join(backup_dir, 'wal', 'node')
if self.archive_compress:
file = os.path.join(wals_dir, '000000010000000000000001.gz')
filename = '000000010000000000000001.gz'
file = os.path.join(wals_dir, filename)
else:
file = os.path.join(wals_dir, '000000010000000000000001')
filename = '000000010000000000000001'
file = os.path.join(wals_dir, filename)
with open(file, 'a') as f:
f.write(b"blablablaadssaaaaaaaaaaaaaaa")
@ -392,7 +397,7 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
'LOG: archive command failed with exit code 1' in log_content and
'DETAIL: The failed archive command was:' in log_content and
'INFO: pg_probackup archive-push from' in log_content and
'ERROR: WAL segment "{0}" already exists.'.format(file) in log_content,
'{0}" already exists.'.format(filename) in log_content,
'Expecting error messages about failed archive_command'
)
self.assertFalse('pg_probackup archive-push completed successfully' in log_content)

View File

@ -610,17 +610,17 @@ class BackupTest(ProbackupTest, unittest.TestCase):
"drop tablespace some_lame_tablespace")
self.backup_node(
backup_dir, 'node', node, backup_type="delta",
options=["-j", "4", "--stream"])
backup_dir, 'node', node, backup_type="delta",
options=["-j", "4", "--stream"])
self.restore_node(
backup_dir, 'node', node_restored,
options=[
"-j", "4",
"-T", "{0}={1}".format(
tblspace1_old_path, tblspace1_new_path),
"-T", "{0}={1}".format(
tblspace2_old_path, tblspace2_new_path)])
backup_dir, 'node', node_restored,
options=[
"-j", "4",
"-T", "{0}={1}".format(
tblspace1_old_path, tblspace1_new_path),
"-T", "{0}={1}".format(
tblspace2_old_path, tblspace2_new_path)])
if self.paranoia:
pgdata = self.pgdata_content(node.data_dir)