Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a64e56

Browse files
committed
tests: added validate.ValidateTest.test_validation_after_backup
1 parentc3c05e8 commit6a64e56

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

‎tests/validate.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3365,6 +3365,44 @@ def test_corrupt_pg_control_via_resetxlog(self):
33653365
# Clean after yourself
33663366
self.del_test_dir(module_name,fname)
33673367

3368+
# @unittest.skip("skip")
3369+
deftest_validation_after_backup(self):
3370+
""""""
3371+
fname=self.id().split('.')[3]
3372+
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
3373+
node=self.make_simple_node(
3374+
base_dir=os.path.join(module_name,fname,'node'),
3375+
set_replication=True,
3376+
initdb_params=['--data-checksums'])
3377+
3378+
self.init_pb(backup_dir)
3379+
self.add_instance(backup_dir,'node',node)
3380+
node.slow_start()
3381+
3382+
# FULL backup
3383+
gdb=self.backup_node(
3384+
backup_dir,'node',node,gdb=True,options=['--stream'])
3385+
3386+
gdb.set_breakpoint('pgBackupValidate')
3387+
gdb.run_until_break()
3388+
3389+
backup_id=self.show_pb(backup_dir,'node')[0]['id']
3390+
3391+
file=os.path.join(
3392+
backup_dir,"backups","node",backup_id,
3393+
"database","postgresql.conf")
3394+
os.remove(file)
3395+
3396+
gdb.continue_execution_until_exit()
3397+
3398+
self.assertEqual(
3399+
'CORRUPT',
3400+
self.show_pb(backup_dir,'node',backup_id)['status'],
3401+
'Backup STATUS should be "ERROR"')
3402+
3403+
# Clean after yourself
3404+
self.del_test_dir(module_name,fname)
3405+
33683406
# validate empty backup list
33693407
# page from future during validate
33703408
# page from future during backup

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp