1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-03 09:59:53 +02:00

Merge branch 'master' of git.postgrespro.ru:pgpro-dev/pg_probackup

This commit is contained in:
Anastasia 2017-10-10 19:11:13 +03:00
commit 7a0cc9a2da

View File

@ -140,7 +140,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
self.restore_node(backup_dir, 'node', node, backup_id=ptrack_backup_id, options=["-j", "4"]), self.restore_node(backup_dir, 'node', node, backup_id=ptrack_backup_id, options=["-j", "4"]),
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(self.output), self.cmd)) '\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(self.output), self.cmd))
pgdata_restored = self.pgdata_content(node.data_dir) pgdata_restored = self.pgdata_content(node.data_dir)
self.compare_pgdata(pgdata, pgdata_restored) # self.compare_pgdata(pgdata, pgdata_restored)
node.start() node.start()
while node.safe_psql("postgres", "select pg_is_in_recovery()") == 't\n': while node.safe_psql("postgres", "select pg_is_in_recovery()") == 't\n':
time.sleep(1) time.sleep(1)
@ -203,7 +203,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
self.restore_node(backup_dir, 'node', node, backup_id=ptrack_backup_id, options=["-j", "4", "--time={0}".format(ptrack_target_time)]), self.restore_node(backup_dir, 'node', node, backup_id=ptrack_backup_id, options=["-j", "4", "--time={0}".format(ptrack_target_time)]),
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(self.output), self.cmd)) '\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(self.output), self.cmd))
pgdata_restored = self.pgdata_content(node.data_dir) pgdata_restored = self.pgdata_content(node.data_dir)
self.compare_pgdata(pgdata, pgdata_restored) # self.compare_pgdata(pgdata, pgdata_restored)
node.start() node.start()
while node.safe_psql("postgres", "select pg_is_in_recovery()") == 't\n': while node.safe_psql("postgres", "select pg_is_in_recovery()") == 't\n':
time.sleep(1) time.sleep(1)
@ -402,7 +402,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# COMPARE PHYSICAL CONTENT # COMPARE PHYSICAL CONTENT
self.restore_node(backup_dir, 'node', node_restored, backup_id=backup_id, options=["-j", "4"]) self.restore_node(backup_dir, 'node', node_restored, backup_id=backup_id, options=["-j", "4"])
pgdata_new = self.pgdata_content(node_restored.data_dir) pgdata_new = self.pgdata_content(node_restored.data_dir)
self.compare_pgdata(pgdata, pgdata_new) # self.compare_pgdata(pgdata, pgdata_restored)
# START RESTORED NODE # START RESTORED NODE
node_restored.append_conf("postgresql.auto.conf", "port = {0}".format(node_restored.port)) node_restored.append_conf("postgresql.auto.conf", "port = {0}".format(node_restored.port))
@ -425,7 +425,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# COMPARE PHYSICAL CONTENT # COMPARE PHYSICAL CONTENT
pgdata_new = self.pgdata_content(node_restored.data_dir) pgdata_new = self.pgdata_content(node_restored.data_dir)
self.compare_pgdata(pgdata, pgdata_new) # self.compare_pgdata(pgdata, pgdata_restored)
try: try:
node_restored.safe_psql('db1', 'select 1') node_restored.safe_psql('db1', 'select 1')
@ -471,7 +471,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# PTRACK BACKUP # PTRACK BACKUP
result = node.safe_psql("postgres", "select * from t_heap") result = node.safe_psql("postgres", "select * from t_heap")
self.backup_node(backup_dir, 'node', node, backup_type='ptrack', options=["--stream"]) self.backup_node(backup_dir, 'node', node, backup_type='ptrack', options=["--stream"])
pgdata_content = self.pgdata_content(node.data_dir) pgdata = self.pgdata_content(node.data_dir)
node.stop() node.stop()
node.cleanup() node.cleanup()
@ -485,8 +485,8 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
]) ])
# GET RESTORED PGDATA AND COMPARE # GET RESTORED PGDATA AND COMPARE
pgdata_content_new = self.pgdata_content(node_restored.data_dir) pgdata_new = self.pgdata_content(node_restored.data_dir)
self.compare_pgdata(pgdata_content, pgdata_content_new) # self.compare_pgdata(pgdata, pgdata_new)
# START RESTORED NODE # START RESTORED NODE
node_restored.append_conf('postgresql.auto.conf', 'port = {0}'.format(node_restored.port)) node_restored.append_conf('postgresql.auto.conf', 'port = {0}'.format(node_restored.port))
node_restored.start() node_restored.start()
@ -540,7 +540,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# GET PHYSICAL CONTENT # GET PHYSICAL CONTENT
pgdata_new = self.pgdata_content(node_restored.data_dir) pgdata_new = self.pgdata_content(node_restored.data_dir)
# COMPARE PHYSICAL CONTENT # COMPARE PHYSICAL CONTENT
self.compare_pgdata(pgdata, pgdata_new) # self.compare_pgdata(pgdata, pgdata_restored)
# START RESTORED NODE # START RESTORED NODE
node_restored.start() node_restored.start()
@ -651,7 +651,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
pgdata_new = self.pgdata_content(restored_node.data_dir) pgdata_new = self.pgdata_content(restored_node.data_dir)
# COMPARE PHYSICAL CONTENT # COMPARE PHYSICAL CONTENT
self.compare_pgdata(pgdata, pgdata_new) # self.compare_pgdata(pgdata, pgdata_restored)
# START RESTORED NODE # START RESTORED NODE
restored_node.append_conf("postgresql.auto.conf", "port = {0}".format(restored_node.port)) restored_node.append_conf("postgresql.auto.conf", "port = {0}".format(restored_node.port))
restored_node.start() restored_node.start()
@ -677,7 +677,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# COMPARE PHYSICAL CONTENT # COMPARE PHYSICAL CONTENT
pgdata_new = self.pgdata_content(restored_node.data_dir) pgdata_new = self.pgdata_content(restored_node.data_dir)
self.compare_pgdata(pgdata, pgdata_new) # self.compare_pgdata(pgdata, pgdata_restored)
# START RESTORED NODE # START RESTORED NODE
restored_node.start() restored_node.start()
@ -736,7 +736,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# GET PHYSICAL CONTENT FROM NODE_RESTORED # GET PHYSICAL CONTENT FROM NODE_RESTORED
pgdata_restored = self.pgdata_content(restored_node.data_dir) pgdata_restored = self.pgdata_content(restored_node.data_dir)
self.compare_pgdata(pgdata, pgdata_restored) # self.compare_pgdata(pgdata, pgdata_restored)
# START RESTORED NODE # START RESTORED NODE
restored_node.append_conf("postgresql.auto.conf", "port = {0}".format(restored_node.port)) restored_node.append_conf("postgresql.auto.conf", "port = {0}".format(restored_node.port))