@@ -442,20 +442,58 @@ def test_tablespace_in_pgdata_pgpro_1376(self):
442
442
tblspc_path = (os .path .join (node .data_dir , 'pg_clog' , '100500' ))
443
443
)
444
444
445
+ self .create_tblspace_in_node (
446
+ node , 'tblspace2' ,
447
+ tblspc_path = (os .path .join (node .data_dir ))
448
+ )
449
+
450
+ node .safe_psql (
451
+ "postgres" ,
452
+ "create table t_heap1 tablespace tblspace1 as select 1 as id, "
453
+ "md5(i::text) as text, "
454
+ "md5(repeat(i::text,10))::tsvector as tsvector "
455
+ "from generate_series(0,1000) i" )
456
+
445
457
node .safe_psql (
446
458
"postgres" ,
447
- "create table t_heap tablespace tblspace1 as select 1 as id, "
459
+ "create table t_heap2 tablespace tblspace2 as select 1 as id, "
448
460
"md5(i::text) as text, "
449
461
"md5(repeat(i::text,10))::tsvector as tsvector "
450
462
"from generate_series(0,1000) i" )
451
463
464
+ try :
465
+ self .backup_node (
466
+ backup_dir , 'node' , node , backup_type = "full" ,
467
+ options = ["-j" , "4" , "--stream" ])
468
+ # we should die here because exception is what we expect to happen
469
+ self .assertEqual (
470
+ 1 , 0 ,
471
+ "Expecting Error because of too many levels "
472
+ "of symbolic linking\n "
473
+ " Output: {0} \n CMD: {1}" .format (
474
+ repr (self .output ), self .cmd ))
475
+ except ProbackupException as e :
476
+ self .assertTrue (
477
+ 'Too many levels of symbolic links' in e .message ,
478
+ "\n Unexpected Error Message: {0}\n CMD: {1}" .format (
479
+ repr (e .message ), self .cmd ))
480
+
481
+ node .safe_psql (
482
+ "postgres" ,
483
+ "drop table t_heap2" )
484
+ node .safe_psql (
485
+ "postgres" ,
486
+ "drop tablespace tblspace2" )
487
+
452
488
self .backup_node (
453
- backup_dir , 'node' , node , backup_type = "full" ,
454
- options = ["-j" , "4" , "--stream" ])
489
+ backup_dir , 'node' , node , backup_type = "full" ,
490
+ options = ["-j" , "4" , "--stream" ])
491
+
492
+ pgdata = self .pgdata_content (node .data_dir )
455
493
456
494
relfilenode = node .safe_psql (
457
495
"postgres" ,
458
- "select 't_heap '::regclass::oid"
496
+ "select 't_heap1 '::regclass::oid"
459
497
).rstrip ()
460
498
461
499
list = []
@@ -475,3 +513,12 @@ def test_tablespace_in_pgdata_pgpro_1376(self):
475
513
"Following file copied twice by backup:\n {0}" .format (
476
514
message )
477
515
)
516
+
517
+ node .cleanup ()
518
+
519
+ self .restore_node (
520
+ backup_dir , 'node' , node , options = ["-j" , "4" ])
521
+
522
+ if self .paranoia :
523
+ pgdata_restored = self .pgdata_content (node .data_dir )
524
+ self .compare_pgdata (pgdata , pgdata_restored )
0 commit comments