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

Commit5cf1556

Browse files
committed
tests: added restore.RestoreTest.test_lost_non_data_file
1 parentad20823 commit5cf1556

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

‎tests/restore.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,3 +2298,46 @@ def test_restore_concurrent_drop_table(self):
22982298

22992299
# Clean after yourself
23002300
self.del_test_dir(module_name,fname)
2301+
2302+
# @unittest.skip("skip")
2303+
deftest_lost_non_data_file(self):
2304+
""""""
2305+
fname=self.id().split('.')[3]
2306+
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
2307+
node=self.make_simple_node(
2308+
base_dir=os.path.join(module_name,fname,'node'),
2309+
set_replication=True,
2310+
initdb_params=['--data-checksums'])
2311+
2312+
self.init_pb(backup_dir)
2313+
self.add_instance(backup_dir,'node',node)
2314+
node.slow_start()
2315+
2316+
# FULL backup
2317+
backup_id=self.backup_node(
2318+
backup_dir,'node',node,options=['--stream'])
2319+
2320+
file=os.path.join(
2321+
backup_dir,'backups','node',
2322+
backup_id,'database','postgresql.auto.conf')
2323+
2324+
os.remove(file)
2325+
2326+
node.cleanup()
2327+
2328+
try:
2329+
self.restore_node(
2330+
backup_dir,'node',node,options=['--no-validate'])
2331+
self.assertEqual(
2332+
1,0,
2333+
"Expecting Error because of non-data file dissapearance.\n "
2334+
"Output: {0}\n CMD: {1}".format(
2335+
self.output,self.cmd))
2336+
exceptProbackupExceptionase:
2337+
self.assertIn(
2338+
'Insert correct error message',e.message,
2339+
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
2340+
repr(e.message),self.cmd))
2341+
2342+
# Clean after yourself
2343+
self.del_test_dir(module_name,fname)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp