fix ptrack

This commit is contained in:
sfalkon
2017-11-03 10:26:23 +03:00
parent 61d5e2ad3d
commit d8ec38cb62
2 changed files with 13 additions and 3 deletions
+5
View File
@@ -9,6 +9,10 @@ import hashlib
import re
import pwd
try:
from testgres import configure_testgres
except:
pass
idx_ptrack = {
't_heap': {
@@ -129,6 +133,7 @@ class ProbackupTest(object):
if self.test_env['PGPRO_PARANOIA_MODE'] == 'ON':
self.paranoia = True
configure_testgres(cache_initdb=False, cache_pg_config=False)
self.helpers_path = os.path.dirname(os.path.realpath(__file__))
self.dir_path = os.path.abspath(os.path.join(self.helpers_path, os.pardir))
self.tmp_path = os.path.abspath(os.path.join(self.dir_path, 'tmp_dirs'))
+8 -3
View File
@@ -3,7 +3,11 @@ import unittest
from .helpers.ptrack_helpers import ProbackupTest, ProbackupException
from datetime import datetime, timedelta
import subprocess
from testgres import ClusterTestgresException
try:
from testgres import ClusterException
except:
from testgres import ClusterTestgresException as ClusterException
import shutil, sys, time
@@ -221,7 +225,8 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_ptrack_pgpro417(self):
"""Make node, take full backup, take ptrack backup, delete ptrack backup. Try to take ptrack backup, which should fail"""
"""Make node, take full backup, take ptrack backup, delete ptrack backup. Try to take ptrack backup,
which should fail """
self.maxDiff = None
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
@@ -439,7 +444,7 @@ class PtrackBackupTest(ProbackupTest, unittest.TestCase):
# we should die here because exception is what we expect to happen
self.assertEqual(1, 0, "Expecting Error because we are connecting to deleted database.\n Output: {0} \n CMD: {1}".format(
repr(self.output), self.cmd))
except ClusterTestgresException as e:
except ClusterException as e:
self.assertTrue('FATAL: database "db1" does not exist' in e.message,
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(e.message), self.cmd))