8
8
module_name = 'compatibility'
9
9
10
10
11
+ def check_manual_tests_enabled ():
12
+ return 'PGPROBACKUP_MANUAL' in os .environ and os .environ ['PGPROBACKUP_MANUAL' ]== 'ON'
13
+
14
+
15
+ def check_ssh_agent_path_exists ():
16
+ return 'PGPROBACKUP_SSH_AGENT_PATH' in os .environ
17
+
18
+
11
19
class CompatibilityTest (ProbackupTest ,unittest .TestCase ):
12
20
13
21
def setUp (self ):
14
22
self .fname = self .id ().split ('.' )[3 ]
15
23
16
24
# @unittest.expectedFailure
17
- @unittest .skip ("skip" )
25
+ @unittest .skipUnless (check_manual_tests_enabled (),'skip manual test' )
26
+ @unittest .skipUnless (check_ssh_agent_path_exists (),'skip no ssh agent path exist' )
27
+ # @unittest.skip("skip")
18
28
def test_catchup_with_different_remote_major_pg (self ):
19
29
"""
20
30
Decription in jira issue PBCKP-236
21
- This test requires builds both PGPROEE11 and PGPROEE9_6
31
+ This test exposures ticket error using pg_probackup builds for both PGPROEE11 and PGPROEE9_6
32
+
33
+ Prerequisites:
34
+ - pg_probackup git tag for PBCKP 2.5.1
35
+ - master pg_probackup build should be made for PGPROEE11
36
+ - agent pg_probackup build should be made for PGPROEE9_6
22
37
23
- prerequisites:
24
- - git tag for PBCKP 2.5.1
25
- - master probackup build should be inside PGPROEE11
26
- - agent probackup build is inside PGPROEE9_6
38
+ Calling probackup PGPROEE9_6 pg_probackup agent from PGPROEE11 pg_probackup master for DELTA backup causes
39
+ the PBCKP-236 problem
27
40
28
- calling probackup PGPROEE9_6 agent from PGPROEE11 probackup master for DELTA backup causes the PBCKP-236 problem
41
+ Please give env variables PROBACKUP_MANUAL=ON;PGPROBACKUP_SSH_AGENT_PATH=<pg_probackup_ssh_agent_path>
42
+ for the test
29
43
30
- please correct path for agent's pg_path_remote_version = '/home/avaness/postgres/postgres.build.ee.9.6/bin/'
44
+ Please make path for agent's pgprobackup_ssh_agent_path = '/home/avaness/postgres/postgres.build.ee.9.6/bin/'
45
+ without pg_probackup executable
31
46
"""
32
47
33
48
self .verbose = True
34
49
self .remote = True
35
- # please use your own local path
36
- pg_path_remote_version = '/home/avaness/postgres/postgres.build.clean/bin'
50
+ # please use your own local path like
51
+ # pgprobackup_ssh_agent_path = '/home/avaness/postgres/postgres.build.clean/bin/'
52
+ pgprobackup_ssh_agent_path = os .environ ['PGPROBACKUP_SSH_AGENT_PATH' ]
37
53
38
54
src_pg = self .make_simple_node (
39
55
base_dir = os .path .join (module_name ,self .fname ,'src' ),
@@ -47,14 +63,13 @@ def test_catchup_with_different_remote_major_pg(self):
47
63
# do full catchup
48
64
dst_pg = self .make_empty_node (os .path .join (module_name ,self .fname ,'dst' ))
49
65
self .catchup_node (
50
- backup_mode = 'FULL' ,
51
- source_pgdata = src_pg .data_dir ,
52
- destination_node = dst_pg ,
66
+ backup_mode = 'FULL' ,
67
+ source_pgdata = src_pg .data_dir ,
68
+ destination_node = dst_pg ,
53
69
options = ['-d' ,'postgres' ,'-p' ,str (src_pg .port ),'--stream' ]
54
70
)
55
71
56
- dst_options = {}
57
- dst_options ['port' ]= str (dst_pg .port )
72
+ dst_options = {'port' :str (dst_pg .port )}
58
73
self .set_auto_conf (dst_pg ,dst_options )
59
74
dst_pg .slow_start ()
60
75
dst_pg .stop ()
@@ -66,11 +81,11 @@ def test_catchup_with_different_remote_major_pg(self):
66
81
# do delta catchup with remote pg_probackup agent with another postgres major version
67
82
# this DELTA backup should fail without PBCKP-236 patch.
68
83
self .catchup_node (
69
- backup_mode = 'DELTA' ,
70
- source_pgdata = src_pg .data_dir ,
71
- destination_node = dst_pg ,
84
+ backup_mode = 'DELTA' ,
85
+ source_pgdata = src_pg .data_dir ,
86
+ destination_node = dst_pg ,
72
87
# here's substitution of --remoge-path pg_probackup agent compiled with another postgres version
73
- options = ['-d' ,'postgres' ,'-p' ,str (src_pg .port ),'--stream' ,'--remote-path=' + pg_path_remote_version ]
88
+ options = ['-d' ,'postgres' ,'-p' ,str (src_pg .port ),'--stream' ,'--remote-path=' + pgprobackup_ssh_agent_path ]
74
89
)
75
90
76
91
# Clean after yourself