From 2c08cb2c2f4be17fb317f87546a94e5f51e1fb9a Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Thu, 31 Jan 2019 18:57:28 +0300 Subject: [PATCH] tests: test_locking_simple_2() added --- tests/locking.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tests/locking.py b/tests/locking.py index d92510a5..ae5431a8 100644 --- a/tests/locking.py +++ b/tests/locking.py @@ -11,7 +11,7 @@ class LockingTest(ProbackupTest, unittest.TestCase): # @unittest.skip("skip") # @unittest.expectedFailure - def test_locking_simple(self): + def test_locking_simple_1(self): """""" fname = self.id().split('.')[3] node = self.make_simple_node( @@ -36,8 +36,6 @@ class LockingTest(ProbackupTest, unittest.TestCase): if gdb.continue_execution_until_break(20) != 'breakpoint-hit': self.AssertTrue(False, 'Failed to hit breakpoint') - gdb._execute('signal SIGKILL') - self.validate_pb(backup_dir) self.assertEqual( @@ -46,5 +44,35 @@ class LockingTest(ProbackupTest, unittest.TestCase): self.assertEqual( 'ERROR', self.show_pb(backup_dir, 'node')[1]['status']) + # Clean after yourself + self.del_test_dir(module_name, fname) + + def test_locking_simple_2(self): + """""" + fname = self.id().split('.')[3] + node = self.make_simple_node( + base_dir=os.path.join(module_name, fname, 'node'), + initdb_params=['--data-checksums'], + pg_options={'wal_level': 'replica'}) + + backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') + self.init_pb(backup_dir) + self.add_instance(backup_dir, 'node', node) + self.set_archiving(backup_dir, 'node', node) + node.slow_start() + + self.backup_node(backup_dir, 'node', node) + + gdb = self.backup_node( + backup_dir, 'node', node, gdb=True) + + gdb.set_breakpoint('copy_file') + gdb.run_until_break() + + if gdb.continue_execution_until_break(20) != 'breakpoint-hit': + self.AssertTrue(False, 'Failed to hit breakpoint') + + self.validate_pb(backup_dir) + # Clean after yourself self.del_test_dir(module_name, fname) \ No newline at end of file